00001 #ifndef MERCURYWINDOWSDL_H 00002 #define MERCURYWINDOWSDL_H 00003 00004 #include "MercuryWindow.h" 00005 #include <SDL/SDL.h> 00006 00008 class MercuryWindowSDL : public MercuryWindow 00009 { 00010 public: 00011 MercuryWindowSDL(); 00012 ~MercuryWindowSDL(); 00013 virtual bool MakeWindow(const char* title, int width, int height, int bits, bool fullscreenflag); 00014 virtual bool MakeRender(const char* title, int width, int height, int bits, bool fullscreenflag, RendererType RT ); 00015 virtual void DestroyWindow(); 00016 virtual bool MakeOGL(); 00017 virtual bool Update(const float dTime); 00018 virtual bool HasFocus(); 00019 virtual void DestroyWindowAndRender(); 00020 virtual bool RestoreDevice(); 00021 virtual bool MakeRenderCurrent(); 00022 virtual unsigned char * GetBackDirectBuffer(); 00023 protected: 00024 virtual void SwapBuffersInternal(); 00025 private: 00026 SDL_Surface *m_surface; 00027 SDL_Event m_event; 00028 const SDL_VideoInfo *m_info; 00029 int m_flags; 00030 RendererType m_RT; 00031 unsigned char * m_BackBuffer; 00032 }; 00033 00034 #endif 00035 00036 /* 00037 * Copyright (c) 2005-2006, Joshua Allen 00038 * All rights reserved. 00039 * 00040 * Redistribution and use in source and binary forms, with or 00041 * without modification, are permitted provided that the following 00042 * conditions are met: 00043 * - Redistributions of source code must retain the above 00044 * copyright notice, this list of conditions and the following disclaimer. 00045 * - Redistributions in binary form must reproduce the above copyright 00046 * notice, this list of conditions and the following disclaimer in 00047 * the documentation and/or other materials provided with the distribution. 00048 * - Neither the name of the Mercury Engine nor the names of its 00049 * contributors may be used to endorse or promote products derived from 00050 * this software without specific prior written permission. 00051 * 00052 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00053 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00054 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00055 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 00056 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00057 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00058 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00059 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00060 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00061 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00062 */