Mercurial > sdl-ios-xcode
comparison include/SDL_syswm.h @ 911:04a403e4ccf5
Date: Mon, 3 May 2004 03:15:01 +0100
From: David Symmonds
Subject: SDL Typedef Structs
Hi, Thanks for the SDL libraries, I have been using them for about a year
now and they are really brilliant. One thing that I have just found whilst
using them through C++ (and needing forward declarations) is that when you
typedef structs you sometimes use
typedef struct Name
{
...
}Name;
e.g. SDL_Surface
and other times use
typedef struct
{
...
}Name;
e.g. SDL_Rect
The first type works fine, when I define a header file I can just put
'struct Name;' at the top and use the Name throughout. However, the second
type is harder to use in a header, and I haven't found a way yet, other than
to include 'SDL.h' in the header file (undesirable). Would there be any harm
in changing the definition of SDL_Rect and such like to the second form?
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 18 Jul 2004 22:57:40 +0000 |
parents | 95f22f17e44a |
children | 8be85fa59cf3 |
comparison
equal
deleted
inserted
replaced
910:4ab6d1fd028f | 911:04a403e4ccf5 |
---|---|
72 | 72 |
73 /* The UNIX custom window manager information structure. | 73 /* The UNIX custom window manager information structure. |
74 When this structure is returned, it holds information about which | 74 When this structure is returned, it holds information about which |
75 low level system it is using, and will be one of SDL_SYSWM_TYPE. | 75 low level system it is using, and will be one of SDL_SYSWM_TYPE. |
76 */ | 76 */ |
77 typedef struct { | 77 typedef struct SDL_SysWMinfo { |
78 SDL_version version; | 78 SDL_version version; |
79 SDL_SYSWM_TYPE subsystem; | 79 SDL_SYSWM_TYPE subsystem; |
80 union { | 80 union { |
81 struct { | 81 struct { |
82 Display *display; /* The X11 display */ | 82 Display *display; /* The X11 display */ |
104 SDL_version version; | 104 SDL_version version; |
105 int data; | 105 int data; |
106 }; | 106 }; |
107 | 107 |
108 /* The windows custom window manager information structure */ | 108 /* The windows custom window manager information structure */ |
109 typedef struct { | 109 typedef struct SDL_SysWMinfo { |
110 SDL_version version ; | 110 SDL_version version ; |
111 GR_WINDOW_ID window ; /* The display window */ | 111 GR_WINDOW_ID window ; /* The display window */ |
112 } SDL_SysWMinfo; | 112 } SDL_SysWMinfo; |
113 | 113 |
114 #elif defined(WIN32) | 114 #elif defined(WIN32) |
123 WPARAM wParam; /* WORD message parameter */ | 123 WPARAM wParam; /* WORD message parameter */ |
124 LPARAM lParam; /* LONG message parameter */ | 124 LPARAM lParam; /* LONG message parameter */ |
125 }; | 125 }; |
126 | 126 |
127 /* The windows custom window manager information structure */ | 127 /* The windows custom window manager information structure */ |
128 typedef struct { | 128 typedef struct SDL_SysWMinfo { |
129 SDL_version version; | 129 SDL_version version; |
130 HWND window; /* The Win32 display window */ | 130 HWND window; /* The Win32 display window */ |
131 HGLRC hglrc; /* The OpenGL context, if any */ | 131 HGLRC hglrc; /* The OpenGL context, if any */ |
132 } SDL_SysWMinfo; | 132 } SDL_SysWMinfo; |
133 | 133 |
139 int eventCode; /* The window for the message */ | 139 int eventCode; /* The window for the message */ |
140 int pollBlock[64]; | 140 int pollBlock[64]; |
141 }; | 141 }; |
142 | 142 |
143 /* The RISCOS custom window manager information structure */ | 143 /* The RISCOS custom window manager information structure */ |
144 typedef struct { | 144 typedef struct SDL_SysWMinfo { |
145 SDL_version version; | 145 SDL_version version; |
146 int wimpVersion; /* Wimp version running under */ | 146 int wimpVersion; /* Wimp version running under */ |
147 int taskHandle; /* The RISCOS task handle */ | 147 int taskHandle; /* The RISCOS task handle */ |
148 int window; /* The RISCOS display window */ | 148 int window; /* The RISCOS display window */ |
149 } SDL_SysWMinfo; | 149 } SDL_SysWMinfo; |
157 SDL_version version; | 157 SDL_version version; |
158 int data; | 158 int data; |
159 }; | 159 }; |
160 | 160 |
161 /* The QNX custom window manager information structure */ | 161 /* The QNX custom window manager information structure */ |
162 typedef struct { | 162 typedef struct SDL_SysWMinfo { |
163 SDL_version version; | 163 SDL_version version; |
164 int data; | 164 int data; |
165 } SDL_SysWMinfo; | 165 } SDL_SysWMinfo; |
166 | 166 |
167 #else | 167 #else |
171 SDL_version version; | 171 SDL_version version; |
172 int data; | 172 int data; |
173 }; | 173 }; |
174 | 174 |
175 /* The generic custom window manager information structure */ | 175 /* The generic custom window manager information structure */ |
176 typedef struct { | 176 typedef struct SDL_SysWMinfo { |
177 SDL_version version; | 177 SDL_version version; |
178 int data; | 178 int data; |
179 } SDL_SysWMinfo; | 179 } SDL_SysWMinfo; |
180 | 180 |
181 #endif /* OS type */ | 181 #endif /* OS type */ |