annotate src/video/wincommon/SDL_lowvideo.h @ 311:2847fd83f115

Date: Fri, 15 Mar 2002 18:24:59 GMT+1 From: Patrice Mandin <pmandin@caramail.com> Subject: [SDL] [PATCH] Atari port, bug in xbios driver driver Hello, This patch correct a stupid mistake in the FlipHWSurface function, where I forgot to update surface->pixels when using a double buffered surface.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 20 Mar 2002 02:24:29 +0000
parents ec53caed9fb2
children 1b5457c0a8ad
rev   line source
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1 /*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
297
f6ffac90895c Updated copyright information for 2002
Sam Lantinga <slouken@libsdl.org>
parents: 252
diff changeset
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6 modify it under the terms of the GNU Library General Public
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
8 version 2 of the License, or (at your option) any later version.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
13 Library General Public License for more details.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
14
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
15 You should have received a copy of the GNU Library General Public
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
16 License along with this library; if not, write to the Free
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
18
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
19 Sam Lantinga
252
e8157fcb3114 Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents: 145
diff changeset
20 slouken@libsdl.org
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
21 */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
22
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
23 #ifdef SAVE_RCSID
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
24 static char rcsid =
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
25 "@(#) $Id$";
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
26 #endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
27
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
28 #ifndef _SDL_lowvideo_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
29 #define _SDL_lowvideo_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
30
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
31 #include <windows.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
32
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33 #include "SDL_sysvideo.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
34
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
35 /* Hidden "this" pointer for the video functions */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
36 #define _THIS SDL_VideoDevice *this
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
37
304
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
38 #define WINDIB_FULLSCREEN() \
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
39 ( \
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
40 ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
41 (((SDL_VideoSurface->flags & SDL_OPENGL ) == SDL_OPENGL ) || \
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
42 (strcmp(this->name, "windib") == 0)) \
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
43 )
13
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
44 #define DDRAW_FULLSCREEN() \
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
45 ( \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
46 ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
47 ((SDL_VideoSurface->flags & SDL_OPENGL ) != SDL_OPENGL ) && \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
48 (strcmp(this->name, "directx") == 0) \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
49 )
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
50
13
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
51 #define DINPUT_FULLSCREEN() \
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
52 ( \
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
53 ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
54 (strcmp(this->name, "directx") == 0) \
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
55 )
e30a8ce27c22 Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
56
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
57 /* The main window -- and a function to set it for the audio */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
58 extern const char *SDL_Appname;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
59 extern HINSTANCE SDL_Instance;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
60 extern HWND SDL_Window;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
61 extern const char *SDL_windowid;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
62
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
63 /* Variables and functions exported to other parts of the native video
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
64 subsystem (SDL_sysevents.c)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
65 */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
66 /* Called by windows message loop when system palette is available */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
67 extern void (*WIN_RealizePalette)(_THIS);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
68
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
69 /* Called by windows message loop when the system palette changes */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
70 extern void (*WIN_PaletteChanged)(_THIS, HWND window);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
71
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
72 /* Called by windows message loop when losing or gaining gamma focus */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
73 extern void (*WIN_SwapGamma)(_THIS);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
74
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
75 /* Called by windows message loop when a portion of the screen needs update */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
76 extern void (*WIN_WinPAINT)(_THIS, HDC hdc);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
77
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
78 /* Called by windows message loop when the message isn't handled */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
79 extern LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
80
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
81 /* The window cursor (from SDL_sysmouse.c) */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
82 extern HCURSOR SDL_hcursor;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
83
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
84 /* The bounds of the window in screen coordinates */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
85 extern RECT SDL_bounds;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
86
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
87 /* Flag -- SDL is performing a resize, rather than the user */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
88 extern int SDL_resizing;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
89
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
90 /* Flag -- the mouse is in relative motion mode */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
91 extern int mouse_relative;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
92
304
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
93 /* The GDI fullscreen mode currently active */
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
94 #ifndef NO_CHANGEDISPLAYSETTINGS
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
95 extern DEVMODE SDL_fullscreen_mode;
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
96 #endif
ec53caed9fb2 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
97
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
98 /* This is really from SDL_dx5audio.c */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
99 extern void DX5_SoundFocus(HWND window);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
100
145
29a638dc26db Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 13
diff changeset
101 /* DJM: This is really from SDL_sysevents.c, we need it in
29a638dc26db Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 13
diff changeset
102 GDL_CreateWindow as well */
29a638dc26db Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 13
diff changeset
103 LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
29a638dc26db Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 13
diff changeset
104
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
105 #endif /* SDL_lowvideo_h */