SDL_displayevents.c File Reference
`#include "../SDL_internal.h"`
`#include "SDL_events.h"`
`#include "SDL_events_c.h"`
Include dependency graph for SDL_displayevents.c:

Go to the source code of this file.

## Functions

int | SDL_SendDisplayEvent (SDL_VideoDisplay *display, Uint8 displayevent, int data1)

## Function Documentation

## SDL_SendDisplayEvent()

int SDL_SendDisplayEvent | ( | SDL_VideoDisplay * | display,
|  | Uint8 | displayevent,
|  | int | data1
| ) |  |

Definition at line 30 of file SDL_displayevents.c.

{
int posted;
if (!display) {
return 0;
}
switch (displayevent) {
case SDL_DISPLAYEVENT_ORIENTATION:
if (data1 == SDL_ORIENTATION_UNKNOWN || data1 == display->orientation) {
return 0;
}
display->orientation = (SDL_DisplayOrientation)data1;
break;
}
/* Post the event, if desired */
posted = 0;
if (SDL_GetEventState(SDL_DISPLAYEVENT) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_DISPLAYEVENT;
event.display.event = displayevent;
event.display.display = SDL_GetIndexOfDisplay(display);
event.display.data1 = data1;
posted = (SDL_PushEvent(&event) > 0);
}
return (posted);
}

References SDL_VideoDisplay::orientation, SDL_DISPLAYEVENT, SDL_DISPLAYEVENT_ORIENTATION, SDL_ENABLE, SDL_GetEventState, SDL_GetIndexOfDisplay(), SDL_ORIENTATION_UNKNOWN, and SDL_PushEvent.

SDL_DISPLAYEVENT
@ SDL_DISPLAYEVENT
Definition: SDL_events.h:89
SDL_DISPLAYEVENT_ORIENTATION
@ SDL_DISPLAYEVENT_ORIENTATION
Definition: SDL_video.h:178
SDL_ENABLE
#define SDL_ENABLE
Definition: SDL_events.h:759
event
struct _cl_event * event
Definition: SDL_opengl_glext.h:2649
SDL_GetEventState
#define SDL_GetEventState(type)
Definition: SDL_events.h:772
SDL_DisplayOrientation
SDL_DisplayOrientation
Definition: SDL_video.h:181
SDL_PushEvent
#define SDL_PushEvent
Definition: SDL_dynapi_overrides.h:125
SDL_GetIndexOfDisplay
int SDL_GetIndexOfDisplay(SDL_VideoDisplay *display)
Definition: SDL_video.c:642
SDL_ORIENTATION_UNKNOWN
@ SDL_ORIENTATION_UNKNOWN
Definition: SDL_video.h:183
SDL_Event
General event structure.
Definition: SDL_events.h:557
SDL_VideoDisplay::orientation
SDL_DisplayOrientation orientation
Definition: SDL_sysvideo.h:133