|
Size: 933
Comment: Adding code example as suggested via Feedback form with slight modifications
|
← Revision 12 as of 2014-10-23 15:55:21 ⇥
Size: 904
Comment: Changed example to compile with C (was C++) and use SDL_Log().
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 16: | Line 16: |
| for (;;) { |
for (;;) { |
| Line 19: | Line 18: |
| if (e.type == SDL_QUIT) { std::cout << "Program quit after " << e.quit.timestamp << " ticks" << std::endl; |
if (e.type == SDL_QUIT) { SDL_Log("Program quit after %i ticks", e.quit.timestamp); |
SDL_QuitEvent
A structure that contains the "quit requested" event.
Data Fields
Uint32 |
type |
SDL_QUIT |
Uint32 |
timestamp |
timestamp of the event |
Code Examples
SDL_Event e;
for (;;) {
SDL_PollEvent(&e);
if (e.type == SDL_QUIT) {
SDL_Log("Program quit after %i ticks", e.quit.timestamp);
break;
}
}
Remarks
SDL_QuitEvent is a member of the SDL_Event union and is used when an event of type SDL_QUIT is reported. You would access it through the event's quit field.
Please refer to the discussion of SDL_QUIT for more details.
Related Enumerations
