Mercurial > sdl-ios-xcode
annotate src/video/wincommon/SDL_lowvideo.h @ 1057:e9d23bb80140
Date: Mon, 02 May 2005 04:23:16 -0500
From: Jonathan Atkins
Subject: Re: [PATCH] *CRITICAL* 8bit direct RGB palette not being created
I think that SDL_AllocFormat should create the palette for all 8bit
surfaces. And when the RGBAmasks match the normal 3:3:2:0 we need to
apply the old behavior. If the mask doesn't match that, then we need
to make the right palette assuming the masks are valid (I don't think
we validate any masks for high color surfaces...so we wouldn't here)
Then there's always a palette available for the 8bit surfaces.
This restores the normal behavior and allows for masks to create
palettes automatically for odd masks even, which would be a neato
thing to have in there, as SDL never did this before.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 16 May 2005 05:34:58 +0000 |
parents | 31fa08b36380 |
children | 86d0d01290ea |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
769
b8d311d90021
Updated copyright information for 2004 (Happy New Year!)
Sam Lantinga <slouken@libsdl.org>
parents:
453
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
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 | 21 */ |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 #ifndef _SDL_lowvideo_h | |
29 #define _SDL_lowvideo_h | |
30 | |
31 #include <windows.h> | |
32 | |
33 #include "SDL_sysvideo.h" | |
34 | |
35 /* Hidden "this" pointer for the video functions */ | |
36 #define _THIS SDL_VideoDevice *this | |
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 ( \ |
335
bc4d50d2edd9
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
325
diff
changeset
|
40 SDL_VideoSurface && \ |
304
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
41 ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \ |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
42 (((SDL_VideoSurface->flags & SDL_OPENGL ) == SDL_OPENGL ) || \ |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
43 (strcmp(this->name, "windib") == 0)) \ |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
44 ) |
13
e30a8ce27c22
Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
45 #define DDRAW_FULLSCREEN() \ |
0 | 46 ( \ |
335
bc4d50d2edd9
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
325
diff
changeset
|
47 SDL_VideoSurface && \ |
0 | 48 ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \ |
49 ((SDL_VideoSurface->flags & SDL_OPENGL ) != SDL_OPENGL ) && \ | |
50 (strcmp(this->name, "directx") == 0) \ | |
51 ) | |
52 | |
325
1b5457c0a8ad
Fixed the bug where mouse cursor and SDL mouse coordinates didn't match
Sam Lantinga <slouken@libsdl.org>
parents:
304
diff
changeset
|
53 #define DINPUT_FULLSCREEN() DDRAW_FULLSCREEN() |
13
e30a8ce27c22
Fixed double-mouse event bug on Windows using OpenGL
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
54 |
0 | 55 /* The main window -- and a function to set it for the audio */ |
453
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
338
diff
changeset
|
56 #ifdef _WIN32_WCE |
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
338
diff
changeset
|
57 extern LPWSTR SDL_Appname; |
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
338
diff
changeset
|
58 #else |
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
338
diff
changeset
|
59 extern LPSTR SDL_Appname; |
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
338
diff
changeset
|
60 #endif |
0 | 61 extern HINSTANCE SDL_Instance; |
62 extern HWND SDL_Window; | |
63 extern const char *SDL_windowid; | |
64 | |
65 /* Variables and functions exported to other parts of the native video | |
66 subsystem (SDL_sysevents.c) | |
67 */ | |
68 /* Called by windows message loop when system palette is available */ | |
69 extern void (*WIN_RealizePalette)(_THIS); | |
70 | |
71 /* Called by windows message loop when the system palette changes */ | |
72 extern void (*WIN_PaletteChanged)(_THIS, HWND window); | |
73 | |
74 /* Called by windows message loop when a portion of the screen needs update */ | |
75 extern void (*WIN_WinPAINT)(_THIS, HDC hdc); | |
76 | |
77 /* Called by windows message loop when the message isn't handled */ | |
78 extern LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); | |
79 | |
80 /* The window cursor (from SDL_sysmouse.c) */ | |
81 extern HCURSOR SDL_hcursor; | |
82 | |
83 /* The bounds of the window in screen coordinates */ | |
84 extern RECT SDL_bounds; | |
85 | |
833
31fa08b36380
Added support for SDL_VIDEO_WINDOW_POS and SDL_VIDEO_CENTERED on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
86 /* The position of the window in windowed mode */ |
31fa08b36380
Added support for SDL_VIDEO_WINDOW_POS and SDL_VIDEO_CENTERED on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
87 extern int SDL_windowX; |
31fa08b36380
Added support for SDL_VIDEO_WINDOW_POS and SDL_VIDEO_CENTERED on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
88 extern int SDL_windowY; |
31fa08b36380
Added support for SDL_VIDEO_WINDOW_POS and SDL_VIDEO_CENTERED on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
89 |
0 | 90 /* Flag -- SDL is performing a resize, rather than the user */ |
91 extern int SDL_resizing; | |
92 | |
93 /* Flag -- the mouse is in relative motion mode */ | |
94 extern int mouse_relative; | |
95 | |
304
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
96 /* The GDI fullscreen mode currently active */ |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
97 #ifndef NO_CHANGEDISPLAYSETTINGS |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
98 extern DEVMODE SDL_fullscreen_mode; |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
99 #endif |
ec53caed9fb2
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
100 |
338
518ffd98a8f6
Fixed gamma ramps in DirectX windowed and OpenGL modes
Sam Lantinga <slouken@libsdl.org>
parents:
335
diff
changeset
|
101 /* The system gamma ramp for GDI modes */ |
518ffd98a8f6
Fixed gamma ramps in DirectX windowed and OpenGL modes
Sam Lantinga <slouken@libsdl.org>
parents:
335
diff
changeset
|
102 extern WORD *gamma_saved; |
518ffd98a8f6
Fixed gamma ramps in DirectX windowed and OpenGL modes
Sam Lantinga <slouken@libsdl.org>
parents:
335
diff
changeset
|
103 |
0 | 104 /* This is really from SDL_dx5audio.c */ |
105 extern void DX5_SoundFocus(HWND window); | |
106 | |
145
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
13
diff
changeset
|
107 /* 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
|
108 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
|
109 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
|
110 |
0 | 111 #endif /* SDL_lowvideo_h */ |