mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 07:39:26 +01:00
better sdl code
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@184 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
70a6054d3c
commit
d6700ebd1f
@ -392,15 +392,23 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
||||
}
|
||||
#else
|
||||
//SDL fo other OS (osx, bsd, ...)
|
||||
int videoFlags;
|
||||
int videoFlags = SDL_OPENGL;
|
||||
SDL_Surface *screen;
|
||||
const SDL_VideoInfo *videoInfo;
|
||||
|
||||
//init sdl video
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
//TODO : Display an error message
|
||||
SDL_Quit();
|
||||
return false;
|
||||
}
|
||||
//fetch video info
|
||||
videoInfo = SDL_GetVideoInfo();
|
||||
|
||||
if (!videoInfo) {
|
||||
//TODO : Display an error message
|
||||
SDL_Quit();
|
||||
return false;
|
||||
}
|
||||
//hw o sw ogl ?
|
||||
if (videoInfo->hw_available)
|
||||
videoFlags |= SDL_HWSURFACE;
|
||||
@ -416,6 +424,13 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
|
||||
screen = SDL_SetVideoMode(_twidth, _theight, 24, SDL_OPENGL|SDL_RESIZABLE);
|
||||
if (!screen) {
|
||||
//TODO : Display an error message
|
||||
SDL_Quit();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user