branches/kale/src/osd/sdl/osdsdl.h
| r244576 | r244577 | |
| 13 | 13 | // System dependent defines |
| 14 | 14 | //============================================================ |
| 15 | 15 | |
| 16 | | // Process events in worker thread |
| 17 | | #if defined(SDLMAME_WIN32) || ((SDLMAME_SDL2) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_MACOSX))) |
| 18 | | #define SDLMAME_EVENTS_IN_WORKER_THREAD (1) |
| 19 | | #else |
| 20 | | #define SDLMAME_EVENTS_IN_WORKER_THREAD (0) |
| 21 | | #endif |
| 22 | 16 | |
| 23 | 17 | #if defined(SDLMAME_WIN32) |
| 24 | 18 | #if (SDLMAME_SDL2) |
| 25 | | #define SDLMAME_INIT_IN_WORKER_THREAD (0) //FIXME: breaks mt |
| 26 | | #define SDL13_COMBINE_RESIZE (1) |
| 19 | #define SDLMAME_EVENTS_IN_WORKER_THREAD (0) |
| 20 | #define SDLMAME_INIT_IN_WORKER_THREAD (0) |
| 21 | #define SDL13_COMBINE_RESIZE (0) //(1) no longer needed |
| 27 | 22 | #else |
| 23 | #define SDLMAME_EVENTS_IN_WORKER_THREAD (0) |
| 28 | 24 | #define SDLMAME_INIT_IN_WORKER_THREAD (1) |
| 29 | 25 | #define SDL13_COMBINE_RESIZE (0) |
| 30 | 26 | #endif |
| 31 | 27 | #else |
| 28 | #define SDLMAME_EVENTS_IN_WORKER_THREAD (0) |
| 32 | 29 | #define SDLMAME_INIT_IN_WORKER_THREAD (0) |
| 33 | 30 | #define SDL13_COMBINE_RESIZE (0) |
| 34 | 31 | #endif |
branches/kale/src/osd/sdl/window.c
| r244576 | r244577 | |
| 561 | 561 | window->renderer().destroy(); |
| 562 | 562 | |
| 563 | 563 | #if (SDLMAME_SDL2) |
| 564 | | if (window->fullscreen() && video_config.switchres) |
| 564 | bool is_osx = false; |
| 565 | #ifdef SDLMAME_MACOSX |
| 566 | // FIXME: This is weird behaviour and certainly a bug in SDL |
| 567 | is_osx = true; |
| 568 | #endif |
| 569 | if (window->fullscreen() && (video_config.switchres || is_osx)) |
| 565 | 570 | { |
| 566 | 571 | SDL_SetWindowFullscreen(window->sdl_window(), 0); // Try to set mode |
| 567 | 572 | SDL_SetWindowDisplayMode(window->sdl_window(), &window->m_original_mode); // Try to set mode |
| r244576 | r244577 | |
| 1224 | 1229 | window->m_extra_flags |= SDL_ASYNCBLIT; |
| 1225 | 1230 | |
| 1226 | 1231 | if (window->renderer().has_flags(osd_renderer::FLAG_NEEDS_OPENGL)) |
| 1227 | | { |
| 1232 | { |
| 1228 | 1233 | window->m_extra_flags |= SDL_DOUBLEBUF | SDL_OPENGL; |
| 1229 | 1234 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 1230 | 1235 | #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 1231 | 1236 | SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0); |
| 1232 | 1237 | #endif |
| 1233 | | //load_gl_lib(window->machine()); |
| 1234 | | } |
| 1238 | // load_gl_lib(window->machine()); |
| 1239 | } |
| 1235 | 1240 | |
| 1236 | 1241 | // create the SDL surface (which creates the window in windowed mode) |
| 1242 | #if 0 |
| 1237 | 1243 | window->m_sdlsurf = SDL_SetVideoMode(tempwidth, tempheight, |
| 1244 | 0, SDL_OPENGL | SDL_FULLSCREEN);// | window->m_extra_flags); |
| 1245 | if (!window->m_sdlsurf) |
| 1246 | printf("completely failed\n"); |
| 1247 | #endif |
| 1248 | window->m_sdlsurf = SDL_SetVideoMode(tempwidth, tempheight, |
| 1238 | 1249 | 0, SDL_SWSURFACE | SDL_ANYFORMAT | window->m_extra_flags); |
| 1239 | 1250 | |
| 1240 | 1251 | if (!window->m_sdlsurf) |
| 1252 | { |
| 1253 | osd_printf_error("SDL Error: %s\n", SDL_GetError()); |
| 1241 | 1254 | return (void *) &result[1]; |
| 1255 | } |
| 1242 | 1256 | if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(window->m_sdlsurf->flags & SDL_OPENGL) ) |
| 1243 | 1257 | { |
| 1244 | 1258 | osd_printf_error("OpenGL not supported on this driver!\n"); |
| 1245 | 1259 | return (void *) &result[1]; |
| 1246 | 1260 | } |
| 1247 | | |
| 1248 | 1261 | // set the window title |
| 1249 | 1262 | SDL_WM_SetCaption(window->m_title, "SDLMAME"); |
| 1250 | 1263 | #endif |