[SDL] SDL-1.2.4 & cvs snapshot of Sept. 8: something not right

Kristof creasy at pandora.be
Fri Sep 13 17:57:01 PDT 2002


int SDL_PrivateResize(int w, int h)
{
  int posted;
  SDL_Event events[32];

  /* See if this event would change the video surface */
  if ( !w || !h ||
    ((last_resize.w == w) && (last_resize.h == h)) ) {
      return(0);
  }
        
This part seems fine.        
        
  last_resize.w = w;
  last_resize.h = h;
  if ( ! SDL_VideoSurface ||
     ((w == SDL_VideoSurface->w) && (h == SDL_VideoSurface->h)) ) {
       return(0);
  }
  // Proceed to post SDL_VIDEORESIZE

But this is wrong. Consider creating a resizable window of 
given size, for example:

SDL_SetVideoMode(400, 300, 32, SDL_OPENGL|SDL_RESIZABLE);

We'd like to get SDL_VIDEORESIZE every time the size of the
window is changed. But, since SDL_VideoSurface never changes,
we'll always compare the new size to (640, 480) before
posting the message.

The effect is clearly seen when just maximizing the new 
window and then restoring it - we'll get SDL_VIDEORESIZE
for the max, but not for the restore.






More information about the SDL mailing list