Skip to content

Commit

Permalink
More Win64 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 7, 2006
1 parent d907a38 commit 4f64bdc
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
4 changes: 3 additions & 1 deletion include/SDL_config_win32.h
Expand Up @@ -150,7 +150,9 @@ typedef unsigned int uintptr_t;
#define SDL_VIDEO_OPENGL_WGL 1
#endif

/* Enable assembly routines */
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1
#endif

#endif /* _SDL_config_win32_h */
6 changes: 3 additions & 3 deletions src/timer/win32/SDL_systimer.c
Expand Up @@ -128,7 +128,7 @@ void SDL_SYS_TimerQuit(void)
/* Forward declaration because this is called by the timer callback */
int SDL_SYS_StartTimer(void);

static VOID CALLBACK TimerCallbackProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
static VOID CALLBACK TimerCallbackProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
Uint32 ms;

Expand Down Expand Up @@ -170,8 +170,8 @@ void SDL_SYS_StopTimer(void)
/* Data to handle a single periodic alarm */
static UINT timerID = 0;

static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD dwUser,
DWORD dw1, DWORD dw2)
static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD_PTR dwUser,
DWORD_PTR dw1, DWORD_PTR dw2)
{
SDL_ThreadedTimerCheck();
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/gapi/SDL_gapivideo.c
Expand Up @@ -710,7 +710,7 @@ SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current,
style = 0;

if (!SDL_windowid)
SetWindowLongPtr(SDL_Window, GWL_STYLE, style);
SetWindowLong(SDL_Window, GWL_STYLE, style);

/* Allocate bitmap */
if(gapiBuffer)
Expand Down
2 changes: 1 addition & 1 deletion src/video/wincommon/SDL_sysevents.c
Expand Up @@ -562,7 +562,7 @@ LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Aparently it's too difficult for MS to check
inside their function, so I have to do it here.
*/
style = GetWindowLongPtr(hwnd, GWL_STYLE);
style = GetWindowLong(hwnd, GWL_STYLE);
AdjustWindowRect(
&size,
style,
Expand Down
2 changes: 1 addition & 1 deletion src/video/wincommon/SDL_wingl.c
Expand Up @@ -45,7 +45,7 @@ static int WIN_GL_ResetWindow(_THIS)
/* Save the existing window attributes */
LONG style;
RECT rect = { 0, 0, 0, 0 };
style = GetWindowLongPtr(SDL_Window, GWL_STYLE);
style = GetWindowLong(SDL_Window, GWL_STYLE);
GetWindowRect(SDL_Window, &rect);
DestroyWindow(SDL_Window);
SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
Expand Down
2 changes: 1 addition & 1 deletion src/video/windib/SDL_dibevents.c
Expand Up @@ -392,7 +392,7 @@ static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym,
Uint16 wchars[2];

GetKeyboardState(keystate);
if (SDL_ToUnicode(vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1)
if (SDL_ToUnicode((UINT)vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1)
{
keysym->unicode = wchars[0];
}
Expand Down
6 changes: 3 additions & 3 deletions src/video/windib/SDL_dibvideo.c
Expand Up @@ -647,7 +647,7 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,
screen_pal = DIB_CreatePalette(bpp);
}

style = GetWindowLongPtr(SDL_Window, GWL_STYLE);
style = GetWindowLong(SDL_Window, GWL_STYLE);
style &= ~(resizestyle|WS_MAXIMIZE);
if ( (video->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
style &= ~windowstyle;
Expand Down Expand Up @@ -677,7 +677,7 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,

/* DJM: Don't piss of anyone who has setup his own window */
if ( !SDL_windowid )
SetWindowLongPtr(SDL_Window, GWL_STYLE, style);
SetWindowLong(SDL_Window, GWL_STYLE, style);

/* Delete the old bitmap if necessary */
if ( screen_bmp != NULL ) {
Expand Down Expand Up @@ -780,7 +780,7 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,
bounds.top = SDL_windowY;
bounds.right = SDL_windowX+video->w;
bounds.bottom = SDL_windowY+video->h;
AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0);
AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
width = bounds.right-bounds.left;
height = bounds.bottom-bounds.top;
if ( (flags & SDL_FULLSCREEN) ) {
Expand Down
14 changes: 7 additions & 7 deletions src/video/windx5/SDL_dx5video.c
Expand Up @@ -1123,7 +1123,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
}
#endif /* !NO_CHANGEDISPLAYSETTINGS */

style = GetWindowLongPtr(SDL_Window, GWL_STYLE);
style = GetWindowLong(SDL_Window, GWL_STYLE);
style &= ~(resizestyle|WS_MAXIMIZE);
if ( video->flags & SDL_FULLSCREEN ) {
style &= ~windowstyle;
Expand All @@ -1148,7 +1148,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,

/* DJM: Don't piss of anyone who has setup his own window */
if ( !SDL_windowid )
SetWindowLongPtr(SDL_Window, GWL_STYLE, style);
SetWindowLong(SDL_Window, GWL_STYLE, style);

/* Resize the window (copied from SDL WinDIB driver) */
if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
Expand Down Expand Up @@ -1178,7 +1178,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
bounds.top = SDL_windowY;
bounds.right = SDL_windowX+video->w;
bounds.bottom = SDL_windowY+video->h;
AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0);
AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
width = bounds.right-bounds.left;
height = bounds.bottom-bounds.top;
if ( (flags & SDL_FULLSCREEN) ) {
Expand Down Expand Up @@ -1217,7 +1217,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
}

/* Set the appropriate window style */
style = GetWindowLongPtr(SDL_Window, GWL_STYLE);
style = GetWindowLong(SDL_Window, GWL_STYLE);
style &= ~(resizestyle|WS_MAXIMIZE);
if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
style &= ~windowstyle;
Expand All @@ -1239,7 +1239,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
}
/* DJM: Don't piss of anyone who has setup his own window */
if ( !SDL_windowid )
SetWindowLongPtr(SDL_Window, GWL_STYLE, style);
SetWindowLong(SDL_Window, GWL_STYLE, style);

/* Set DirectDraw sharing mode.. exclusive when fullscreen */
if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
Expand All @@ -1264,7 +1264,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
bounds.top = 0;
bounds.right = GetSystemMetrics(SM_CXSCREEN);
bounds.bottom = GetSystemMetrics(SM_CYSCREEN);
AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0);
AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
SetWindowPos(SDL_Window, HWND_TOPMOST,
bounds.left, bounds.top,
bounds.right - bounds.left,
Expand Down Expand Up @@ -1581,7 +1581,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
bounds.top = SDL_windowY;
bounds.right = SDL_windowX+video->w;
bounds.bottom = SDL_windowY+video->h;
AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0);
AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
width = bounds.right-bounds.left;
height = bounds.bottom-bounds.top;
if ( center ) {
Expand Down

0 comments on commit 4f64bdc

Please sign in to comment.