src/video/pandora/SDL_pandora.h
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 20 Jul 2016 21:00:36 +0200
changeset 10207 e66f6ab2b059
parent 9998 f67cf37e9cd4
permissions -rw-r--r--
Pandora: Fixed compile warnings in video implementation (thanks, Bombo!). Fixes Bugzilla #2734.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     2
  Simple DirectMedia Layer
9998
f67cf37e9cd4 Updated copyright to 2016
Sam Lantinga <slouken@libsdl.org>
parents: 9619
diff changeset
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     7
  arising from the use of this software.
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    11
  freely, subject to the following restrictions:
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
#ifndef __SDL_PANDORA_H__
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
#define __SDL_PANDORA_H__
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
#include <GLES/egl.h>
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
8093
b43765095a6f Make internal SDL sources include SDL_internal.h instead of SDL_config.h
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
    27
#include "../../SDL_internal.h"
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
#include "../SDL_sysvideo.h"
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
typedef struct SDL_VideoData
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
{
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
    SDL_bool egl_initialized;   /* OpenGL ES device initialization status */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
    EGLDisplay egl_display;     /* OpenGL ES display connection           */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
    uint32_t egl_refcount;      /* OpenGL ES reference count              */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
    uint32_t swapinterval;      /* OpenGL ES default swap interval        */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
} SDL_VideoData;
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
typedef struct SDL_DisplayData
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
{
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
} SDL_DisplayData;
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
typedef struct SDL_WindowData
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    47
{
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
    SDL_bool uses_gles;         /* if true window must support OpenGL ES */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    49
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    50
    EGLConfig gles_configs[32];
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
    EGLint gles_config;         /* OpenGL ES configuration index      */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    52
    EGLContext gles_context;    /* OpenGL ES context                  */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    53
    EGLint gles_attributes[256];        /* OpenGL ES attributes for context   */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
    EGLSurface gles_surface;    /* OpenGL ES target rendering surface */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
} SDL_WindowData;
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
/****************************************************************************/
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
/* SDL_VideoDevice functions declaration                                    */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
/****************************************************************************/
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    63
/* Display and window functions */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
int PND_videoinit(_THIS);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    65
void PND_videoquit(_THIS);
4471
11cedc036ca1 Hello Sam.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    66
void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display);
11cedc036ca1 Hello Sam.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    67
int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
int PND_createwindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
int PND_createwindowfrom(_THIS, SDL_Window * window, const void *data);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
void PND_setwindowtitle(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
void PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
void PND_setwindowposition(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
void PND_setwindowsize(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
void PND_showwindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
void PND_hidewindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    76
void PND_raisewindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
void PND_maximizewindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
void PND_minimizewindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    79
void PND_restorewindow(_THIS, SDL_Window * window);
10207
e66f6ab2b059 Pandora: Fixed compile warnings in video implementation (thanks, Bombo!).
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9998
diff changeset
    80
void PND_setwindowgrab(_THIS, SDL_Window * window, SDL_bool grabbed);
3161
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
void PND_destroywindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    82
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
/* Window manager function */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    84
SDL_bool PND_getwindowwminfo(_THIS, SDL_Window * window,
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    85
                             struct SDL_SysWMinfo *info);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    86
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
/* OpenGL/OpenGL ES functions */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
int PND_gl_loadlibrary(_THIS, const char *path);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
void *PND_gl_getprocaddres(_THIS, const char *proc);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    90
void PND_gl_unloadlibrary(_THIS);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    91
SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    92
int PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    93
int PND_gl_setswapinterval(_THIS, int interval);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    94
int PND_gl_getswapinterval(_THIS);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
void PND_gl_swapwindow(_THIS, SDL_Window * window);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    96
void PND_gl_deletecontext(_THIS, SDL_GLContext context);
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    99
#endif /* __SDL_PANDORA_H__ */
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   100
494559cc723b OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   101
/* vi: set ts=4 sw=4 expandtab: */