Date: Fri, 18 Feb 2005 20:49:35 +0200 (EET)
From: ville Subject: [SDL] Changing, at least some, anonymous enums to named enums. Howdy, Could, some if not all, enums be named rather than being anonymous enums? I ran into troubles with the enum describing event types in SDL_events.h. The problem is that an anonymous enum cannot be used in C++ templates like so: enum { C }; template< typename T > void f( T ) { } f( C ); --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401297
This commit is contained in:
parent
ed6a111bc6
commit
d2ded39e88
1 changed files with 5 additions and 4 deletions
|
@ -44,7 +44,8 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Event enumerations */
|
/* Event enumerations */
|
||||||
enum { SDL_NOEVENT = 0, /* Unused (do not remove) */
|
typedef enum {
|
||||||
|
SDL_NOEVENT = 0, /* Unused (do not remove) */
|
||||||
SDL_ACTIVEEVENT, /* Application loses/gains visibility */
|
SDL_ACTIVEEVENT, /* Application loses/gains visibility */
|
||||||
SDL_KEYDOWN, /* Keys pressed */
|
SDL_KEYDOWN, /* Keys pressed */
|
||||||
SDL_KEYUP, /* Keys released */
|
SDL_KEYUP, /* Keys released */
|
||||||
|
@ -74,11 +75,11 @@ enum { SDL_NOEVENT = 0, /* Unused (do not remove) */
|
||||||
It is the number of bits in the event mask datatype -- Uint32
|
It is the number of bits in the event mask datatype -- Uint32
|
||||||
*/
|
*/
|
||||||
SDL_NUMEVENTS = 32
|
SDL_NUMEVENTS = 32
|
||||||
};
|
} SDL_EventType;
|
||||||
|
|
||||||
/* Predefined event masks */
|
/* Predefined event masks */
|
||||||
#define SDL_EVENTMASK(X) (1<<(X))
|
#define SDL_EVENTMASK(X) (1<<(X))
|
||||||
enum {
|
typedef enum {
|
||||||
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
|
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
|
||||||
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
|
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
|
||||||
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
|
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
|
||||||
|
@ -102,7 +103,7 @@ enum {
|
||||||
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
|
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
|
||||||
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
|
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
|
||||||
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
|
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
|
||||||
};
|
} SDL_EventMask ;
|
||||||
#define SDL_ALLEVENTS 0xFFFFFFFF
|
#define SDL_ALLEVENTS 0xFFFFFFFF
|
||||||
|
|
||||||
/* Application visibility event structure */
|
/* Application visibility event structure */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue