Wiki Page Content

Differences between revisions 10 and 11
Revision 10 as of 2013-09-05 20:30:25
Size: 766
Comment: Updated structure.
Revision 11 as of 2014-10-22 01:14:53
Size: 933
Editor: ChrisBush
Comment: Adding code example as suggested via Feedback form with slight modifications
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
You can add your code example here SDL_Event e;
for (;;)
{
    SDL_PollEvent(&e);
    if (e.type == SDL_QUIT)
    {
        std::cout << "Program quit after " << e.quit.timestamp << " ticks" << std::endl;
        break;
    }
}

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)
    {
        std::cout << "Program quit after " << e.quit.timestamp << " ticks" << std::endl;
        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.


CategoryStruct, CategoryEvents

None: SDL_QuitEvent (last edited 2014-10-23 15:55:21 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit