Mercurial > sdl-ios-xcode
annotate src/SDL.c @ 4590:1ad70fb49fcb
Fix so many things that there is little place in this column to list them all but the result is that blending modes just work now for drawing primitives.
Fixes involved:
1. Fix handling of alpha channel when SDL_BLENDMODE_NONE is set.
2. Make xrendercolor use floating-point values for color channels and then convert to 16 bit ints.
3. Fix handling of visuals in SDL_x11modes.c so that a 32 bit ARGB visual is used.
4. Fix the background pixel value in SDL_x11window.c so that the window background has an alpha value of 0xFF and not 0.
author | Sunny Sachanandani <sunnysachanandani@gmail.com> |
---|---|
date | Fri, 09 Jul 2010 21:36:41 +0530 |
parents | 5e7e1f1a4056 |
children | 791b3256fb22 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
3697 | 3 Copyright (C) 1997-2010 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1190
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1190
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 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 | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1190
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1190
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1190
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1190
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
36
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1361
diff
changeset
|
22 #include "SDL_config.h" |
0 | 23 |
24 /* Initialization code for SDL */ | |
25 | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
26 #include "SDL.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
27 #include "SDL_fatal.h" |
3647
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
28 #include "SDL_assert.h" |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
29 |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
30 #if !SDL_VIDEO_DISABLED |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
31 #include "video/SDL_leaks.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
32 #endif |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
33 |
0 | 34 /* Initialization/Cleanup routines */ |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
35 #if !SDL_JOYSTICK_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
36 extern int SDL_JoystickInit(void); |
0 | 37 extern void SDL_JoystickQuit(void); |
38 #endif | |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
39 #if !SDL_HAPTIC_DISABLED |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
40 extern int SDL_HapticInit(void); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
41 extern int SDL_HapticQuit(void); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
42 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
43 #if !SDL_TIMERS_DISABLED |
0 | 44 extern void SDL_StartTicks(void); |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
45 extern int SDL_TimerInit(void); |
0 | 46 extern void SDL_TimerQuit(void); |
47 #endif | |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
48 #if defined(__WIN32__) |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
49 extern int SDL_HelperWindowCreate(void); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
50 extern int SDL_HelperWindowDestroy(void); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
51 #endif |
0 | 52 |
3647
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
53 extern int SDL_AssertionsInit(void); |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
54 extern void SDL_AssertionsQuit(void); |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
55 |
0 | 56 /* The initialized subsystems */ |
57 static Uint32 SDL_initialized = 0; | |
58 static Uint32 ticks_started = 0; | |
59 | |
60 #ifdef CHECK_LEAKS | |
61 int surfaces_allocated = 0; | |
62 #endif | |
63 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
64 int |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
65 SDL_InitSubSystem(Uint32 flags) |
0 | 66 { |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
67 #if !SDL_VIDEO_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
68 /* Initialize the video/event subsystem */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
69 if ((flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO)) { |
1909
8f1ab2f7c722
Look at environment variables in SDL_VideoInit() and SDL_AudioInit()
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
70 if (SDL_VideoInit(NULL, (flags & SDL_INIT_EVENTTHREAD)) < 0) { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
71 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
72 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
73 SDL_initialized |= SDL_INIT_VIDEO; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
74 } |
0 | 75 #else |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
76 if (flags & SDL_INIT_VIDEO) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
77 SDL_SetError("SDL not built with video support"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
78 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
79 } |
0 | 80 #endif |
81 | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
82 #if !SDL_AUDIO_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
83 /* Initialize the audio subsystem */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
84 if ((flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO)) { |
1909
8f1ab2f7c722
Look at environment variables in SDL_VideoInit() and SDL_AudioInit()
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
85 if (SDL_AudioInit(NULL) < 0) { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
86 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
87 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
88 SDL_initialized |= SDL_INIT_AUDIO; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
89 } |
0 | 90 #else |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
91 if (flags & SDL_INIT_AUDIO) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
92 SDL_SetError("SDL not built with audio support"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
93 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
94 } |
0 | 95 #endif |
96 | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
97 #if !SDL_TIMERS_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
98 /* Initialize the timer subsystem */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
99 if (!ticks_started) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
100 SDL_StartTicks(); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
101 ticks_started = 1; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
102 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
103 if ((flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
104 if (SDL_TimerInit() < 0) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
105 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
106 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
107 SDL_initialized |= SDL_INIT_TIMER; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
108 } |
0 | 109 #else |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
110 if (flags & SDL_INIT_TIMER) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
111 SDL_SetError("SDL not built with timer support"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
112 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
113 } |
0 | 114 #endif |
115 | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
116 #if !SDL_JOYSTICK_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
117 /* Initialize the joystick subsystem */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
118 if ((flags & SDL_INIT_JOYSTICK) && !(SDL_initialized & SDL_INIT_JOYSTICK)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
119 if (SDL_JoystickInit() < 0) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
120 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
121 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
122 SDL_initialized |= SDL_INIT_JOYSTICK; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
123 } |
0 | 124 #else |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
125 if (flags & SDL_INIT_JOYSTICK) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
126 SDL_SetError("SDL not built with joystick support"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
127 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
128 } |
0 | 129 #endif |
130 | |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
131 #if !SDL_HAPTIC_DISABLED |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
132 /* Initialize the haptic subsystem */ |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
133 if ((flags & SDL_INIT_HAPTIC) && !(SDL_initialized & SDL_INIT_HAPTIC)) { |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
134 if (SDL_HapticInit() < 0) { |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
135 return (-1); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
136 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
137 SDL_initialized |= SDL_INIT_HAPTIC; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
138 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
139 #else |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
140 if (flags & SDL_INIT_HAPTIC) { |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
141 SDL_SetError("SDL not built with haptic (force feedback) support"); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
142 return (-1); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
143 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
144 #endif |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
145 return (0); |
0 | 146 } |
147 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
148 int |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
149 SDL_Init(Uint32 flags) |
0 | 150 { |
3647
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
151 if (SDL_AssertionsInit() < 0) { |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
152 return -1; |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
153 } |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
154 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
155 /* Clear the error message */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
156 SDL_ClearError(); |
0 | 157 |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
158 #if defined(__WIN32__) |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
159 if (SDL_HelperWindowCreate() < 0) { |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
160 return -1; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
161 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
162 #endif |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
163 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
164 /* Initialize the desired subsystems */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
165 if (SDL_InitSubSystem(flags) < 0) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
166 return (-1); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
167 } |
0 | 168 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
169 /* Everything is initialized */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
170 if (!(flags & SDL_INIT_NOPARACHUTE)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
171 SDL_InstallParachute(); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
172 } |
3647
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
173 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
174 return (0); |
0 | 175 } |
176 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
177 void |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
178 SDL_QuitSubSystem(Uint32 flags) |
0 | 179 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
180 /* Shut down requested initialized subsystems */ |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
181 #if !SDL_JOYSTICK_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
182 if ((flags & SDL_initialized & SDL_INIT_JOYSTICK)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
183 SDL_JoystickQuit(); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
184 SDL_initialized &= ~SDL_INIT_JOYSTICK; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
185 } |
0 | 186 #endif |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
187 #if !SDL_HAPTIC_DISABLED |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
188 if ((flags & SDL_initialized & SDL_INIT_HAPTIC)) { |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
189 SDL_HapticQuit(); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
190 SDL_initialized &= ~SDL_INIT_HAPTIC; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
191 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
192 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
193 #if !SDL_TIMERS_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
194 if ((flags & SDL_initialized & SDL_INIT_TIMER)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
195 SDL_TimerQuit(); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
196 SDL_initialized &= ~SDL_INIT_TIMER; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
197 } |
0 | 198 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
199 #if !SDL_AUDIO_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
200 if ((flags & SDL_initialized & SDL_INIT_AUDIO)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
201 SDL_AudioQuit(); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
202 SDL_initialized &= ~SDL_INIT_AUDIO; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
203 } |
0 | 204 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
205 #if !SDL_VIDEO_DISABLED |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
206 if ((flags & SDL_initialized & SDL_INIT_VIDEO)) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
207 SDL_VideoQuit(); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
208 SDL_initialized &= ~SDL_INIT_VIDEO; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
209 } |
0 | 210 #endif |
211 } | |
212 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
213 Uint32 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
214 SDL_WasInit(Uint32 flags) |
0 | 215 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
216 if (!flags) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
217 flags = SDL_INIT_EVERYTHING; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
218 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
219 return (SDL_initialized & flags); |
0 | 220 } |
221 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
222 void |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
223 SDL_Quit(void) |
0 | 224 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
225 /* Quit all subsystems */ |
1190 | 226 #ifdef DEBUG_BUILD |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
227 printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
228 fflush(stdout); |
1190 | 229 #endif |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
230 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
231 #if defined(__WIN32__) |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
232 SDL_HelperWindowDestroy(); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1909
diff
changeset
|
233 #endif |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
234 SDL_QuitSubSystem(SDL_INIT_EVERYTHING); |
0 | 235 |
236 #ifdef CHECK_LEAKS | |
1190 | 237 #ifdef DEBUG_BUILD |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
238 printf("[SDL_Quit] : CHECK_LEAKS\n"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
239 fflush(stdout); |
1190 | 240 #endif |
241 | |
3647
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
242 /* !!! FIXME: make this an assertion. */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
243 /* Print the number of surfaces not freed */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
244 if (surfaces_allocated != 0) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
245 fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n", |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
246 surfaces_allocated); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
247 } |
0 | 248 #endif |
1190 | 249 #ifdef DEBUG_BUILD |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
250 printf("[SDL_Quit] : SDL_UninstallParachute()\n"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
251 fflush(stdout); |
1190 | 252 #endif |
0 | 253 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
254 /* Uninstall any parachute signal handlers */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
255 SDL_UninstallParachute(); |
397 | 256 |
3647
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
257 SDL_AssertionsQuit(); |
c5925cd41955
First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
3319
diff
changeset
|
258 |
1190 | 259 #ifdef DEBUG_BUILD |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
260 printf("[SDL_Quit] : Returning!\n"); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
261 fflush(stdout); |
1190 | 262 #endif |
263 | |
0 | 264 } |
265 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
266 /* Get the library version number */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
267 void |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
268 SDL_GetVersion(SDL_version * ver) |
0 | 269 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
270 SDL_VERSION(ver); |
0 | 271 } |
272 | |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
273 /* Get the library source revision */ |
4419
5e7e1f1a4056
Changed revision details to be a string (an hg changeset) instead of an int.
Ryan C. Gordon <icculus@icculus.org>
parents:
3697
diff
changeset
|
274 const char * |
2996 | 275 SDL_GetRevision(void) |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
276 { |
2983
388c5a2daeac
Fine tuned revision code, updated testver
Sam Lantinga <slouken@libsdl.org>
parents:
2982
diff
changeset
|
277 return SDL_REVISION; |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
278 } |
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
279 |
3319 | 280 /* Get the name of the platform */ |
281 const char * | |
282 SDL_GetPlatform() | |
283 { | |
284 #if __AIX__ | |
285 return "AIX"; | |
286 #elif __HAIKU__ | |
287 /* Haiku must appear here before BeOS, since it also defines __BEOS__ */ | |
288 return "Haiku"; | |
289 #elif __BEOS__ | |
290 return "BeOS"; | |
291 #elif __BSDI__ | |
292 return "BSDI"; | |
293 #elif __DREAMCAST__ | |
294 return "Dreamcast"; | |
295 #elif __FREEBSD__ | |
296 return "FreeBSD"; | |
297 #elif __HPUX__ | |
298 return "HP-UX"; | |
299 #elif __IRIX__ | |
300 return "Irix"; | |
301 #elif __LINUX__ | |
302 return "Linux"; | |
303 #elif __MINT__ | |
304 return "Atari MiNT"; | |
305 #elif __MACOS__ | |
306 return "MacOS Classic"; | |
307 #elif __MACOSX__ | |
308 return "Mac OS X"; | |
309 #elif __NETBSD__ | |
310 return "NetBSD"; | |
311 #elif __OPENBSD__ | |
312 return "OpenBSD"; | |
313 #elif __OS2__ | |
314 return "OS/2"; | |
315 #elif __OSF__ | |
316 return "OSF/1"; | |
317 #elif __QNXNTO__ | |
318 return "QNX Neutrino"; | |
319 #elif __RISCOS__ | |
320 return "RISC OS"; | |
321 #elif __SOLARIS__ | |
322 return "Solaris"; | |
323 #elif __WIN32__ | |
324 #ifdef _WIN32_WCE | |
325 return "Windows CE"; | |
326 #else | |
327 return "Windows"; | |
328 #endif | |
329 #elif __IPHONEOS__ | |
330 return "iPhone OS"; | |
331 #else | |
332 return "Unknown (see SDL_platform.h)"; | |
333 #endif | |
334 } | |
335 | |
3269
a67a961e2171
Removed outdated OS/2 support
Sam Lantinga <slouken@libsdl.org>
parents:
3243
diff
changeset
|
336 #if defined(__WIN32__) |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
337 |
1465
8dfa9a6d69a5
Updated WinCE support by Dmitry (with some tweaks)
Sam Lantinga <slouken@libsdl.org>
parents:
1433
diff
changeset
|
338 #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) |
8dfa9a6d69a5
Updated WinCE support by Dmitry (with some tweaks)
Sam Lantinga <slouken@libsdl.org>
parents:
1433
diff
changeset
|
339 /* Need to include DllMain() on Watcom C for some reason.. */ |
1433
bb6839704ed6
SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
340 #define WIN32_LEAN_AND_MEAN |
bb6839704ed6
SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
341 #include <windows.h> |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
342 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
343 BOOL APIENTRY |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
344 _DllMainCRTStartup(HANDLE hModule, |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
345 DWORD ul_reason_for_call, LPVOID lpReserved) |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
346 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
347 switch (ul_reason_for_call) { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
348 case DLL_PROCESS_ATTACH: |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
349 case DLL_THREAD_ATTACH: |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
350 case DLL_THREAD_DETACH: |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
351 case DLL_PROCESS_DETACH: |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
352 break; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
353 } |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
354 return TRUE; |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
355 } |
1465
8dfa9a6d69a5
Updated WinCE support by Dmitry (with some tweaks)
Sam Lantinga <slouken@libsdl.org>
parents:
1433
diff
changeset
|
356 #endif /* building DLL with Watcom C */ |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
357 |
3269
a67a961e2171
Removed outdated OS/2 support
Sam Lantinga <slouken@libsdl.org>
parents:
3243
diff
changeset
|
358 #endif /* __WIN32__ */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
359 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1487
diff
changeset
|
360 /* vi: set ts=4 sw=4 expandtab: */ |