资料收集站

SDL

Wednesday
Dec 03rd
Text size
  • Increase font size
  • Default font size
  • Decrease font size

Events

Chapter 8. Events

Introduction

Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to:

SDL_Init(SDL_INIT_VIDEO);
Interally, SDL stores all the events waiting to be handled in an event queue. Using functions like SDL_PollEvent and SDL_PeepEvents you can observe and handle waiting input events.

The key to event handling in SDL is the SDL_Event union. The event queue itself is composed of a series of SDL_Event unions, one for each waiting event. SDL_Event unions are read from the queue with the SDL_PollEvent function and it is then up to the application to process the information stored with them.

Comments (0)Add Comment

Write comment

busy
 

Google 搜索

相关文章

在线用户

We have 80 guests online