Chinaunix首页 | 论坛 | 博客
  • 博客访问: 612646
  • 博文数量: 1958
  • 博客积分: 44693
  • 博客等级: 大将
  • 技术积分: 22125
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-29 15:19
文章分类

全部博文(1958)

文章存档

2012年(560)

2011年(1398)

分类: LINUX

2011-03-17 17:41:40

SDL_UserEvent

Name

SDL_UserEvent -- A user-defined event type

Structure Definition

typedef struct{ 
       Uint8 type; int code; 
      void *data1; //用户定义的数据指针 
       void *data2; 
} SDL_UserEvent;

Structure Data

type

SDL_USEREVENT through to SDL_NUMEVENTS-1

code

User defined event code

data1

User defined data pointer

data2

User defined data pointer

Description

 is in the user member of the structure . This event is unique, it is never created by SDL but only by the user. The event can be pushed onto the event queue using. The contents of the structure members are completely up to the programmer, the only requirement is that type is a value from SDL_USEREVENT to SDL_NUMEVENTS-1 (inclusive).

Examples

SDL_Event event; event.type = SDL_USEREVENT; event.user.code = my_event_code; event.user.data1 = significant_data; event.user.data2 = 0; SDL_PushEvent(&event);

See Also

阅读(1816) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~