diff options
author | xcomputerman <xcomputerman> | 2010-01-30 08:11:51 +0000 |
---|---|---|
committer | xcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33> | 2010-01-30 08:11:51 +0000 |
commit | bf69a60f64ae1f107d47d51a7bab63d143ec357b (patch) | |
tree | 50dad13296aa9f3ac3d17a5832446cf5c78d66b5 /legacy/evas/src/modules/engines/gl_sdl/evas_engine.c | |
parent | 2b06b06b33a471504cc9620d87adbfaede1ef606 (diff) |
Fix gl_sdl for WebOS -- need to check SDL_RESIZABLE because calling SetVideoMode() kills the GL context
SVN revision: 45730
Diffstat (limited to '')
-rw-r--r-- | legacy/evas/src/modules/engines/gl_sdl/evas_engine.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c b/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c index b4e0459ec2..e94e471988 100644 --- a/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c +++ b/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c | |||
@@ -84,13 +84,17 @@ eng_output_resize(void *data, int w, int h) | |||
84 | re->w = w; | 84 | re->w = w; |
85 | re->h = h; | 85 | re->h = h; |
86 | 86 | ||
87 | surface = SDL_SetVideoMode(w, h, 32, EVAS_SDL_GL_FLAG | 87 | if(SDL_GetVideoSurface()->flags & SDL_RESIZABLE) |
88 | | (re->info->flags.fullscreen ? SDL_FULLSCREEN : 0) | ||
89 | | (re->info->flags.noframe ? SDL_NOFRAME : 0)); | ||
90 | if (!surface) | ||
91 | { | 88 | { |
92 | ERR("Unable to change the resolution to : %ix%i", w, h); | 89 | surface = SDL_SetVideoMode(w, h, 32, EVAS_SDL_GL_FLAG |
93 | exit(-1); | 90 | | (re->info->flags.fullscreen ? SDL_FULLSCREEN : 0) |
91 | | (re->info->flags.noframe ? SDL_NOFRAME : 0)); | ||
92 | if (!surface) | ||
93 | { | ||
94 | ERR("Unable to change the resolution to : %ix%i", w, h); | ||
95 | SDL_Quit(); | ||
96 | exit(-1); | ||
97 | } | ||
94 | } | 98 | } |
95 | 99 | ||
96 | evas_gl_common_context_resize(re->gl_context, w, h); | 100 | evas_gl_common_context_resize(re->gl_context, w, h); |
@@ -1366,20 +1370,27 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe) | |||
1366 | SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); | 1370 | SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); |
1367 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); | 1371 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); |
1368 | SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); | 1372 | SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); |
1369 | SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); | ||
1370 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); | 1373 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); |
1371 | SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); | 1374 | SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); |
1375 | SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0); | ||
1372 | 1376 | ||
1373 | surface = SDL_SetVideoMode(w, h, 32, EVAS_SDL_GL_FLAG | 1377 | surface = SDL_SetVideoMode(w, h, 32, EVAS_SDL_GL_FLAG |
1374 | | (fullscreen ? SDL_FULLSCREEN : 0) | 1378 | | (fullscreen ? SDL_FULLSCREEN : 0) |
1375 | | (noframe ? SDL_NOFRAME : 0)); | 1379 | | (noframe ? SDL_NOFRAME : 0)); |
1376 | 1380 | ||
1377 | if (!surface) | 1381 | if (!surface) |
1378 | { | 1382 | { |
1379 | CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h); | 1383 | CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h); |
1384 | CRIT("SDL: %s\n", SDL_GetError()); | ||
1385 | SDL_Quit(); | ||
1380 | exit(-1); | 1386 | exit(-1); |
1381 | } | 1387 | } |
1382 | 1388 | ||
1389 | printf("Screen Depth : %d\n", SDL_GetVideoSurface()->format->BitsPerPixel); | ||
1390 | printf("Vendor : %s\n", glGetString(GL_VENDOR)); | ||
1391 | printf("Renderer : %s\n", glGetString(GL_RENDERER)); | ||
1392 | printf("Version : %s\n", glGetString(GL_VERSION)); | ||
1393 | |||
1383 | re->gl_context = evas_gl_common_context_new(); | 1394 | re->gl_context = evas_gl_common_context_new(); |
1384 | if (!re->gl_context) | 1395 | if (!re->gl_context) |
1385 | { | 1396 | { |