Go to the documentation of this file.
21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_NACL
25 #include "ppapi/c/pp_errors.h"
26 #include "ppapi/c/pp_instance.h"
27 #include "ppapi_simple/ps.h"
28 #include "ppapi_simple/ps_interface.h"
29 #include "ppapi_simple/ps_event.h"
30 #include "nacl_io/nacl_io.h"
37 #include "../SDL_sysvideo.h"
38 #include "../../events/SDL_events_c.h"
40 #define NACLVID_DRIVER_NAME "nacl"
74 static int NACL_VideoInit(
_THIS);
75 static void NACL_VideoQuit(
_THIS);
77 static int NACL_Available(
void) {
78 return PSGetInstanceId() != 0;
103 device->driverdata = &nacl;
106 device->VideoInit = NACL_VideoInit;
107 device->VideoQuit = NACL_VideoQuit;
114 device->SetDisplayMode = NACL_SetDisplayMode;
116 device->free = NACL_DeleteDevice;
134 NACLVID_DRIVER_NAME,
"SDL Native Client Video Driver",
135 NACL_Available, NACL_CreateDevice
138 int NACL_VideoInit(
_THIS) {
144 mode.w = driverdata->
w;
145 mode.h = driverdata->
h;
146 mode.refresh_rate = 0;
155 driverdata->
instance = PSGetInstanceId();
158 driverdata->
ppb_core = PSInterfaceCore();
162 driverdata->
ppb_view = PSInterfaceView();
163 driverdata->
ppb_var = PSInterfaceVar();
164 driverdata->
ppb_input_event = (PPB_InputEvent*) PSGetInterface(PPB_INPUT_EVENT_INTERFACE);
165 driverdata->
ppb_keyboard_input_event = (PPB_KeyboardInputEvent*) PSGetInterface(PPB_KEYBOARD_INPUT_EVENT_INTERFACE);
166 driverdata->
ppb_mouse_input_event = (PPB_MouseInputEvent*) PSGetInterface(PPB_MOUSE_INPUT_EVENT_INTERFACE);
167 driverdata->
ppb_wheel_input_event = (PPB_WheelInputEvent*) PSGetInterface(PPB_WHEEL_INPUT_EVENT_INTERFACE);
168 driverdata->
ppb_touch_input_event = (PPB_TouchInputEvent*) PSGetInterface(PPB_TOUCH_INPUT_EVENT_INTERFACE);
173 PSEventSetFilter(PSE_ALL);
179 void NACL_VideoQuit(
_THIS) {
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
int NACL_GLES_SetSwapInterval(_THIS, int interval)
void NACL_DestroyWindow(_THIS, SDL_Window *window)
GLint GLint GLsizei width
const PPB_MouseInputEvent * ppb_mouse_input_event
@ SDL_WINDOWEVENT_RESIZED
const PPB_View * ppb_view
const PPB_InputEvent * ppb_input_event
void NACL_PumpEvents(_THIS)
void NACL_SetScreenResolution(int width, int height, Uint32 format)
void * NACL_GLES_GetProcAddress(_THIS, const char *proc)
The structure that defines a display mode.
SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
const PPB_MessageLoop * ppb_message_loop
static screen_context_t context
const PPB_KeyboardInputEvent * ppb_keyboard_input_event
static SDL_VideoDevice * _this
const PPB_ImageData * ppb_image_data
GLint GLint GLsizei GLsizei height
int NACL_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
SDL_VideoDisplay * displays
void NACL_GLES_UnloadLibrary(_THIS)
void NACL_GLES_DeleteContext(_THIS, SDL_GLContext context)
#define SDL_GL_GetCurrentContext
VideoBootStrap NACL_bootstrap
SDL_GLContext NACL_GLES_CreateContext(_THIS, SDL_Window *window)
#define SDL_OutOfMemory()
int SDL_AddBasicVideoDisplay(const SDL_DisplayMode *desktop_mode)
const PPB_WheelInputEvent * ppb_wheel_input_event
int NACL_CreateWindow(_THIS, SDL_Window *window)
const PPB_Core * ppb_core
int NACL_GLES_LoadLibrary(_THIS, const char *path)
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
const PPB_Fullscreen * ppb_fullscreen
const PPB_Instance * ppb_instance
const PPB_Graphics3D * ppb_graphics
int NACL_GLES_GetSwapInterval(_THIS)
const PPB_TouchInputEvent * ppb_touch_input_event
static SDL_AudioDeviceID device
void NACL_SetWindowTitle(_THIS, SDL_Window *window)
int NACL_GLES_SwapWindow(_THIS, SDL_Window *window)