src/video/nacl/SDL_naclvideo.h
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Tue, 29 Dec 2015 19:13:56 +0100
changeset 9988 08d023f75d78
parent 9619 b94b6d0bff0f
child 9998 f67cf37e9cd4
permissions -rw-r--r--
Fixed a crash if creating accelerated renderer after accessing window surface.

Partially fixes Bugzilla #3196.
gabomdq@8833
     1
/*
gabomdq@8833
     2
  Simple DirectMedia Layer
slouken@9619
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
gabomdq@8833
     4
gabomdq@8833
     5
  This software is provided 'as-is', without any express or implied
gabomdq@8833
     6
  warranty.  In no event will the authors be held liable for any damages
gabomdq@8833
     7
  arising from the use of this software.
gabomdq@8833
     8
gabomdq@8833
     9
  Permission is granted to anyone to use this software for any purpose,
gabomdq@8833
    10
  including commercial applications, and to alter it and redistribute it
gabomdq@8833
    11
  freely, subject to the following restrictions:
gabomdq@8833
    12
gabomdq@8833
    13
  1. The origin of this software must not be misrepresented; you must not
gabomdq@8833
    14
     claim that you wrote the original software. If you use this software
gabomdq@8833
    15
     in a product, an acknowledgment in the product documentation would be
gabomdq@8833
    16
     appreciated but is not required.
gabomdq@8833
    17
  2. Altered source versions must be plainly marked as such, and must not be
gabomdq@8833
    18
     misrepresented as being the original software.
gabomdq@8833
    19
  3. This notice may not be removed or altered from any source distribution.
gabomdq@8833
    20
*/
gabomdq@8833
    21
#include "../../SDL_internal.h"
gabomdq@8833
    22
gabomdq@8833
    23
#ifndef _SDL_naclvideo_h
gabomdq@8833
    24
#define _SDL_naclvideo_h
gabomdq@8833
    25
gabomdq@8833
    26
#include "../SDL_sysvideo.h"
gabomdq@8833
    27
#include "ppapi_simple/ps_interface.h"
gabomdq@8833
    28
#include "ppapi/c/pp_input_event.h"
gabomdq@8833
    29
gabomdq@8833
    30
gabomdq@8833
    31
/* Hidden "this" pointer for the video functions */
gabomdq@8833
    32
#define _THIS  SDL_VideoDevice *_this
gabomdq@8833
    33
gabomdq@8833
    34
gabomdq@8833
    35
/* Private display data */
gabomdq@8833
    36
gabomdq@8833
    37
typedef struct SDL_VideoData {
gabomdq@8833
    38
  Uint32 format;
gabomdq@8833
    39
  int w, h;
gabomdq@8833
    40
  SDL_Window *window;
gabomdq@8833
    41
gabomdq@8833
    42
  const PPB_Graphics3D *ppb_graphics;
gabomdq@8833
    43
  const PPB_MessageLoop *ppb_message_loop;
gabomdq@8833
    44
  const PPB_Core *ppb_core;
gabomdq@8833
    45
  const PPB_Fullscreen *ppb_fullscreen;
gabomdq@8833
    46
  const PPB_Instance *ppb_instance;
gabomdq@8833
    47
  const PPB_ImageData *ppb_image_data;
gabomdq@8833
    48
  const PPB_View *ppb_view;
gabomdq@8833
    49
  const PPB_Var *ppb_var;
gabomdq@8833
    50
  const PPB_InputEvent *ppb_input_event;
gabomdq@8833
    51
  const PPB_KeyboardInputEvent *ppb_keyboard_input_event;
gabomdq@8833
    52
  const PPB_MouseInputEvent *ppb_mouse_input_event;
gabomdq@8833
    53
  const PPB_WheelInputEvent *ppb_wheel_input_event;
gabomdq@8833
    54
  const PPB_TouchInputEvent *ppb_touch_input_event;
gabomdq@8833
    55
      
gabomdq@8833
    56
  PP_Resource message_loop;
gabomdq@8833
    57
  PP_Instance instance;
gabomdq@8833
    58
  
gabomdq@8833
    59
  /* FIXME: Check threading issues...otherwise use a hardcoded _this->context across all threads */
gabomdq@8833
    60
  /* PP_Resource context; */
gabomdq@8833
    61
gabomdq@8833
    62
} SDL_VideoData;
gabomdq@8833
    63
gabomdq@8833
    64
extern void NACL_SetScreenResolution(int width, int height, Uint32 format);
gabomdq@8833
    65
gabomdq@8833
    66
gabomdq@8833
    67
#endif /* _SDL_naclvideo_h */