SDL事件处理(一些数据类型)

博客介绍了SDL事件处理,对比了SDL1.2和SDL2.0中事件类型的差异。在SDL中,通过SDL_PollEvent函数获取底层事件,每个事件由特定的数据结构表示,共享int type作为首个成员。
摘要由CSDN通过智能技术生成

SDL1.2中的定义:

typedef enum {
       SDL_NOEVENT = 0,			/**< Unused (do not remove) */
       SDL_ACTIVEEVENT,			/**< Application loses/gains visibility */
       SDL_KEYDOWN,			/**< Keys pressed */
       SDL_KEYUP,			/**< Keys released */
       SDL_MOUSEMOTION,			/**< Mouse moved */
       SDL_MOUSEBUTTONDOWN,		/**< Mouse button pressed */
       SDL_MOUSEBUTTONUP,		/**< Mouse button released */
       SDL_JOYAXISMOTION,		/**< Joystick axis motion */
       SDL_JOYBALLMOTION,		/**< Joystick trackball motion */
       SDL_JOYHATMOTION,		/**< Joystick hat position change */
       SDL_JOYBUTTONDOWN,		/**< Joystick button pressed */
       SDL_JOYBUTTONUP,			/**< Joystick button released */
       SDL_QUIT,			/**< User-requested quit */
       SDL_SYSWMEVENT,			/**< System specific event */
       SDL_EVENT_RESERVEDA,		/**< Reserved for future use.. */
       SDL_EVENT_RESERVEDB,		/**< Reserved for future use.. */
       SDL_VIDEORESIZE,			/**< User resized video mode */
       SDL_VIDEOEXPOSE,			/**< Screen needs to be redrawn */
       SDL_EVENT_RESERVED2,		/**< Reserved for future use.. */
       SDL_EVENT_RESERVED3,		/**< Reserved for future use.. */
       SDL_EVENT_RESERVED4,		/**< Reserved for future use.. */
       SDL_EVENT_RESERVED5,		/**< Reserved for future use.. */
       SDL_EVENT_RESERVED6,		/**< Reserved for future use.. */
       SDL_EVENT_RESERVED7,		/**< Reserved for future use.. */
       /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
       SDL_USEREVENT = 24,
       /** This last event is only for bounding internal arrays
	*  It is the number of bits in the event mask datatype -- Uint32
        */
       SDL_NUMEVENTS = 32
} SDL_EventType;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值