Index: SDL12/src/video/gapi/SDL_gapivideo.c =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/gapi/SDL_gapivideo.c,v retrieving revision 1.11 diff -r1.11 SDL_gapivideo.c 40c40 < // TODO: fix running GAPI apps from landscape mode - --- > // TODO: fix running GAPI apps from landscape mode - 53c53 < #include "../windib/SDL_dibevents_c.h" --- > #include "../windib/SDL_dibevents_c.h" 95c95 < static void GAPI_WinPAINT(_THIS, HDC hdc); --- > static void GAPI_WinPAINT(_THIS, HDC hdc); 103c103 < name = (PFN##type)GetProcAddress( g_hGapiLib, _T(import) ); --- > name = (PFN##type)GetProcAddress( g_hGapiLib, _T(import) ); 119c119 < } RawFrameBufferInfo; --- > } RawFrameBufferInfo; 130c130 < so lets avoid using GxOpenDisplay there via GETGXINFO trick --- > so lets avoid using GxOpenDisplay there via GETGXINFO trick 145c145 < } GXDeviceInfo; --- > } GXDeviceInfo; 150c150 < HDC hdc = GetDC(NULL); --- > HDC hdc = GetDC(NULL); 279c279 < device->UpdateMouse = WIN_UpdateMouse; --- > device->UpdateMouse = WIN_UpdateMouse; 299,301c299,301 < device->CreateWMCursor = WIN_CreateWMCursor; < device->ShowWMCursor = WIN_ShowWMCursor; < device->WarpWMCursor = WIN_WarpWMCursor; --- > device->CreateWMCursor = WIN_CreateWMCursor; > device->ShowWMCursor = WIN_ShowWMCursor; > device->WarpWMCursor = WIN_WarpWMCursor; 310c310 < HandleMessage = DIB_HandleMessage; --- > HandleMessage = DIB_HandleMessage; 333c333 < if( g_hGapiLib ) --- > if( g_hGapiLib ) 339c339 < --- > 375c375 < if ((oemstr[12] == 'H') && (oemstr[13] == '3') && (oemstr[14] == '8') && (this->hidden->gxProperties.cbxPitch > 0)) --- > if ((oemstr[12] == 'H') && (oemstr[13] == '3') && (oemstr[14] == '8') && (this->hidden->gxProperties.cbxPitch > 0)) 408c408 < this->hidden->needUpdate = 0; --- > this->hidden->needUpdate = 0; 485c485 < --- > 505a506,507 > WIN_FlushMessageQueue(); > 512c514 < --- > 514,515c516,517 < GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth); < GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight); --- > GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth); > GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight); 519c521 < if( g_bRawBufferAvailable && --- > if( g_bRawBufferAvailable && 528,529c530,531 < GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth); < GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight); --- > GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth); > GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight); 572c574 < } --- > } 587,589c589,591 < SDL_Surface *video; < Uint32 Rmask, Gmask, Bmask; < DWORD style; --- > SDL_Surface *video; > Uint32 Rmask, Gmask, Bmask; > DWORD style; 609c611 < case 15: --- > case 15: 650c652 < FillStructs(this, 1); // gapi is found but we use VGA resolution --- > FillStructs(this, 1); // gapi is found but we use VGA resolution 660c662 < if( (width > height) && (GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN))) --- > if( (width > height) && (GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN))) 691c693 < --- > 700c702 < video->pitch = SDL_CalculatePitch(video); --- > video->pitch = SDL_CalculatePitch(video); 716c718 < if(gapiBuffer) --- > if(gapiBuffer) 722c724 < video->pixels = gapiBuffer; --- > video->pixels = gapiBuffer; 732a735 > WIN_FlushMessageQueue(); 753c756 < gapi->videoMem = gapi->gxFunc.GXBeginDraw(); --- > gapi->videoMem = gapi->gxFunc.GXBeginDraw(); 833c836 < { --- > { 835c838 < if( ((((unsigned)destPointer & 3) != 0) && (gapi->gapiOrientation == SDL_ORIENTATION_LEFT)) --- > if( ((((unsigned)destPointer & 3) != 0) && (gapi->gapiOrientation == SDL_ORIENTATION_LEFT)) 837c840 < || (lines == 1) ) --- > || (lines == 1) ) 876c879 < if( (((unsigned)destPointer & 3) == 0) && (width > 0)) --- > if( (((unsigned)destPointer & 3) == 0) && (width > 0)) 909c912 < if( (((unsigned)destPointer & 3) != 0) || (lines == 1) ) --- > if( (((unsigned)destPointer & 3) != 0) || (lines == 1) ) 918c921 < --- > 947c950 < c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); --- > c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); 960c963 < c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); --- > c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); 989c992 < c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); --- > c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); 1008c1011 < c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); --- > c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK); 1095c1098 < gapi->videoMem = gapi->gxFunc.GXBeginDraw(); --- > gapi->videoMem = gapi->gxFunc.GXBeginDraw(); 1106,1116d1108 < static void FlushMessageQueue() < { < MSG msg; < while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) { < if ( msg.message == WM_QUIT ) break; < TranslateMessage( &msg ); < DispatchMessage( &msg ); < } < } < < 1124c1116 < if ( SDL_Window ) --- > if ( SDL_Window ) 1127c1119 < this->hidden->gxFunc.GXCloseDisplay(); --- > this->hidden->gxFunc.GXCloseDisplay(); 1141c1133 < FlushMessageQueue(); --- > WIN_FlushMessageQueue(); 1147c1139 < if( aygshell ) --- > if( aygshell ) 1192c1184 < DWORD* pColors = (DWORD*)&pBMI->bmiColors; --- > DWORD* pColors = (DWORD*)&pBMI->bmiColors; 1205c1197 < --- > 1229c1221 < int GAPI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) --- > int GAPI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) Index: SDL12/src/video/wincommon/SDL_syswm.c =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/wincommon/SDL_syswm.c,v retrieving revision 1.22 diff -r1.22 SDL_syswm.c 35a36,49 > /* JC 14 Mar 2006 > This is used all over the place, in the windib driver and in the dx5 driver > So we may as well stick it here instead of having multiple copies scattered about > */ > > void WIN_FlushMessageQueue() > { > MSG msg; > while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) { > if ( msg.message == WM_QUIT ) break; > TranslateMessage( &msg ); > DispatchMessage( &msg ); > } > } 111c125 < --- > 140c154 < if (icon->format->palette && --- > if (icon->format->palette && 166c180 < */ --- > */ Index: SDL12/src/video/wincommon/SDL_syswm_c.h =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/wincommon/SDL_syswm_c.h,v retrieving revision 1.7 diff -r1.7 SDL_syswm_c.h 29a30,31 > extern void WIN_FlushMessageQueue(); > Index: SDL12/src/video/wincommon/SDL_wingl.c =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/wincommon/SDL_wingl.c,v retrieving revision 1.29 diff -r1.29 SDL_wingl.c 30a31 > #include "SDL_syswm_c.h" 50a52,53 > WIN_FlushMessageQueue(); > 58a62 > WIN_FlushMessageQueue(); 84c88 < --- > 91c95 < --- > 93c97 < --- > 98c102 < --- > 105c109 < --- > 117c121 < --- > 120a125,128 > > > WIN_FlushMessageQueue(); > 154c162 < --- > 160a169 > WIN_FlushMessageQueue(); 234c243 < --- > 370c379 < --- > 513c522 < int WIN_GL_LoadLibrary(_THIS, const char* path) --- > int WIN_GL_LoadLibrary(_THIS, const char* path) Index: SDL12/src/video/windib/SDL_dibvideo.c =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/windib/SDL_dibvideo.c,v retrieving revision 1.45 diff -r1.45 SDL_dibvideo.c 257c257 < --- > 279c279 < --- > 293a294,301 > > /* JC 14 Mar 2006 > Flush the message loop or this can cause big problems later > Especially if the user decides to use dialog boxes or assert()! > */ > > WIN_FlushMessageQueue(); > 341c349 < #ifdef _WIN32_WCE --- > #ifdef _WIN32_WCE 357c365 < // emulate other bpp (8, 32) and use triple buffer, --- > // emulate other bpp (8, 32) and use triple buffer, 362c370 < GetDeviceCaps(GetDC(NULL), HORZRES), --- > GetDeviceCaps(GetDC(NULL), HORZRES), 426c434 < --- > 434c442 < * the first call just fills in the BITMAPINFOHEADER; the --- > * the first call just fills in the BITMAPINFOHEADER; the 472c480 < const DWORD windowstyle = --- > const DWORD windowstyle = 820a829,835 > /* JC 14 Mar 2006 > Flush the message loop or this can cause big problems later > Especially if the user decides to use dialog boxes or assert()! > */ > > WIN_FlushMessageQueue(); > 1017,1026d1031 < static void FlushMessageQueue() < { < MSG msg; < while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) { < if ( msg.message == WM_QUIT ) break; < TranslateMessage( &msg ); < DispatchMessage( &msg ); < } < } < 1054c1059 < FlushMessageQueue(); --- > WIN_FlushMessageQueue(); 1061c1066 < if( aygshell ) --- > if( aygshell ) Index: SDL12/src/video/windx5/SDL_dx5video.c =================================================================== RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/windx5/SDL_dx5video.c,v retrieving revision 1.43 diff -r1.43 SDL_dx5video.c 426c426 < static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface, --- > static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface, 875c875 < total_mem = DDCaps.dwVidMemTotal; --- > total_mem = DDCaps.dwVidMemTotal; 904a905,907 > > WIN_FlushMessageQueue(); > 956c959 < --- > 1007c1010 < const DWORD windowstyle = --- > const DWORD windowstyle = 1269c1272 < bounds.left, bounds.top, --- > bounds.left, bounds.top, 1296c1299 < return(DX5_SetVideoMode(this, current, width, height, bpp, flags & ~SDL_FULLSCREEN)); --- > return(DX5_SetVideoMode(this, current, width, height, bpp, flags & ~SDL_FULLSCREEN)); 1319c1322 < result = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &dd_surface1, NULL); --- > result = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &dd_surface1, NULL); 1325c1328 < &ddsd, &dd_surface1, NULL); --- > &ddsd, &dd_surface1, NULL); 1414c1417 < || (video->format->BitsPerPixel != --- > || (video->format->BitsPerPixel != 1444c1447 < /* If not fullscreen, locking is possible, but it doesn't do what --- > /* If not fullscreen, locking is possible, but it doesn't do what 1446c1449 < the appropriate portion of the entire screen is modified, not --- > the appropriate portion of the entire screen is modified, not 1606a1610,1611 > WIN_FlushMessageQueue(); > 1616c1621 < static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface, --- > static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface, 1677c1682 < &ddsd, &dd_surface1, NULL); --- > &ddsd, &dd_surface1, NULL); 1716c1721 < --- > 1753c1758 < if ( (ddsd.ddpfPixelFormat.u1.dwRGBBitCount != --- > if ( (ddsd.ddpfPixelFormat.u1.dwRGBBitCount != 1759c1764 < if ( (ddsd.ddpfPixelFormat.dwRGBBitCount != --- > if ( (ddsd.ddpfPixelFormat.dwRGBBitCount != 1796c1801 < errors in this function, and the cleanup is the same in --- > errors in this function, and the cleanup is the same in 1832c1837 < --- > 1842c1847 < fprintf(stderr, "\tR = 0x%X, G = 0x%X, B = 0x%X\n", --- > fprintf(stderr, "\tR = 0x%X, G = 0x%X, B = 0x%X\n", 2020c2025 < result = IDirectDrawSurface3_Lock(dd_surface, NULL, &ddsd, --- > result = IDirectDrawSurface3_Lock(dd_surface, NULL, &ddsd, 2101c2106 < result = IDirectDrawSurface3_Blt(SDL_primary, &dst, --- > result = IDirectDrawSurface3_Blt(SDL_primary, &dst, 2107c2112 < IDirectDrawSurface3_Blt(SDL_primary, &dst, --- > IDirectDrawSurface3_Blt(SDL_primary, &dst, 2348,2357d2352 < static void FlushMessageQueue() < { < MSG msg; < while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) { < if ( msg.message == WM_QUIT ) break; < TranslateMessage( &msg ); < DispatchMessage( &msg ); < } < } < 2401c2396 < FlushMessageQueue(); --- > WIN_FlushMessageQueue(); 2466c2461 < SDL_memcpy(saved, palette->colors, --- > SDL_memcpy(saved, palette->colors,