trunk/src/osd/sdl/drawogl.c
| r31299 | r31300 | |
| 570 | 570 | window->width = sdl->sdlsurf->w; |
| 571 | 571 | window->height = sdl->sdlsurf->h; |
| 572 | 572 | |
| 573 | window->screen_width = 0; |
| 574 | window->screen_height = 0; |
| 575 | |
| 573 | 576 | if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(sdl->sdlsurf->flags & SDL_OPENGL) ) |
| 574 | 577 | { |
| 575 | 578 | osd_printf_error("OpenGL not supported on this driver!\n"); |
| r31299 | r31300 | |
| 763 | 766 | |
| 764 | 767 | sdl->sdlsurf = SDL_SetVideoMode(width, height, 0, |
| 765 | 768 | SDL_SWSURFACE | SDL_ANYFORMAT | sdl->extra_flags); |
| 769 | |
| 766 | 770 | window->width = sdl->sdlsurf->w; |
| 767 | 771 | window->height = sdl->sdlsurf->h; |
| 768 | 772 | #endif |
| r31299 | r31300 | |
| 1136 | 1140 | |
| 1137 | 1141 | #if (SDLMAME_SDL2) |
| 1138 | 1142 | SDL_GL_MakeCurrent(window->sdl_window, sdl->gl_context_id); |
| 1143 | #else |
| 1144 | if (!sdl->init_context) |
| 1145 | { |
| 1146 | screen_device_iterator myiter(window->machine().root_device()); |
| 1147 | for (screen = myiter.first(); screen != NULL; screen = myiter.next()) |
| 1148 | { |
| 1149 | if (window->index == 0) |
| 1150 | { |
| 1151 | if ((screen->width() != window->screen_width) || (screen->height() != window->screen_height)) |
| 1152 | { |
| 1153 | window->screen_width = screen->width(); |
| 1154 | window->screen_height = screen->height(); |
| 1155 | |
| 1156 | // force all textures to be regenerated |
| 1157 | drawogl_destroy_all_textures(window); |
| 1158 | } |
| 1159 | break; |
| 1160 | } |
| 1161 | else |
| 1162 | { |
| 1163 | scrnum++; |
| 1164 | } |
| 1165 | } |
| 1166 | } |
| 1139 | 1167 | #endif |
| 1168 | |
| 1140 | 1169 | if (sdl->init_context) |
| 1141 | 1170 | { |
| 1142 | 1171 | // do some one-time OpenGL setup |