|
SDLGameEngine
|
00001 /* 00002 * Copyright (c) 2007 Heiko Irrgang 00003 * 00004 * The license and distribution terms for this file may be 00005 * found in the file COPYING in this distribution or at 00006 * http://93-interactive.com/cms/products/software/sdl-game-engine/license/ 00007 */ 00008 00009 #include <sge.h> 00010 00011 SDL_Surface *screen; 00012 00013 void sgeOpenScreen(const char *title, int width, int height, int depth, int fullscreen) { 00014 Uint32 flags=_DEFAULT_VIDEOMODE_FLAGS_; 00015 00016 if (fullscreen) { 00017 flags|=SDL_FULLSCREEN; 00018 } 00019 00020 screen=SDL_SetVideoMode(width, height, depth, flags); 00021 if (screen==NULL) { 00022 sgeBailOut("error opening screen: %s\n", SDL_GetError()); 00023 } 00024 SDL_WM_SetCaption(title, NULL); 00025 } 00026 00027 void sgeHideMouse() { 00028 SDL_ShowCursor(SDL_DISABLE); 00029 } 00030 00031 void sgeShowMouse() { 00032 SDL_ShowCursor(SDL_ENABLE); 00033 } 00034 00035 void sgeCloseScreen() { 00036 } 00037 00038 inline void sgeFlip(void) { 00039 SDL_Flip(screen); 00040 }