Previous 199869 Revisions Next

r31300 Thursday 17th July, 2014 at 03:51:46 UTC by R. Belmont
SDL: rebuild all GL textures when the core changes resolutions. [R. Belmont]
[src/osd/sdl]drawogl.c window.h

trunk/src/osd/sdl/window.h
r31299r31300
9696   int                 resize_width;
9797   int                 resize_height;
9898   osd_ticks_t         last_resize;
99#else
100   int               screen_width;
101   int             screen_height;
99102#endif
100103};
101104
trunk/src/osd/sdl/drawogl.c
r31299r31300
570570   window->width = sdl->sdlsurf->w;
571571   window->height = sdl->sdlsurf->h;
572572
573   window->screen_width = 0;
574   window->screen_height = 0;
575
573576   if ( (video_config.mode  == VIDEO_MODE_OPENGL) && !(sdl->sdlsurf->flags & SDL_OPENGL) )
574577   {
575578      osd_printf_error("OpenGL not supported on this driver!\n");
r31299r31300
763766
764767   sdl->sdlsurf = SDL_SetVideoMode(width, height, 0,
765768         SDL_SWSURFACE | SDL_ANYFORMAT | sdl->extra_flags);
769
766770   window->width = sdl->sdlsurf->w;
767771   window->height = sdl->sdlsurf->h;
768772#endif
r31299r31300
11361140
11371141#if (SDLMAME_SDL2)
11381142   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   }
11391167#endif
1168
11401169   if (sdl->init_context)
11411170   {
11421171      // do some one-time OpenGL setup

Previous 199869 Revisions Next


© 1997-2024 The MAME Team