src/video/pandora/SDL_pandora.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 31 May 2009 11:53:12 +0000
changeset 3161 494559cc723b
child 3697 f7b03b6838cb
permissions -rw-r--r--
OpenPandora support added by David Carré
slouken@3161
     1
/*
slouken@3161
     2
    SDL - Simple DirectMedia Layer
slouken@3161
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@3161
     4
slouken@3161
     5
    This library is free software; you can redistribute it and/or
slouken@3161
     6
    modify it under the terms of the GNU Lesser General Public
slouken@3161
     7
    License as published by the Free Software Foundation; either
slouken@3161
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@3161
     9
slouken@3161
    10
    This library is distributed in the hope that it will be useful,
slouken@3161
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@3161
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@3161
    13
    Lesser General Public License for more details.
slouken@3161
    14
slouken@3161
    15
    You should have received a copy of the GNU Lesser General Public
slouken@3161
    16
    License along with this library; if not, write to the Free Software
slouken@3161
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@3161
    18
slouken@3161
    19
    Sam Lantinga
slouken@3161
    20
    slouken@libsdl.org
slouken@3161
    21
slouken@3161
    22
    Open Pandora SDL driver
slouken@3161
    23
    Copyright (C) 2009 David Carré
slouken@3161
    24
    (cpasjuste@gmail.com)
slouken@3161
    25
*/
slouken@3161
    26
slouken@3161
    27
#ifndef __SDL_PANDORA_H__
slouken@3161
    28
#define __SDL_PANDORA_H__
slouken@3161
    29
slouken@3161
    30
#include <GLES/egl.h>
slouken@3161
    31
slouken@3161
    32
#include "SDL_config.h"
slouken@3161
    33
#include "../SDL_sysvideo.h"
slouken@3161
    34
slouken@3161
    35
typedef struct SDL_VideoData
slouken@3161
    36
{
slouken@3161
    37
    SDL_bool egl_initialized;   /* OpenGL ES device initialization status */
slouken@3161
    38
    EGLDisplay egl_display;     /* OpenGL ES display connection           */
slouken@3161
    39
    uint32_t egl_refcount;      /* OpenGL ES reference count              */
slouken@3161
    40
    uint32_t swapinterval;      /* OpenGL ES default swap interval        */
slouken@3161
    41
slouken@3161
    42
} SDL_VideoData;
slouken@3161
    43
slouken@3161
    44
slouken@3161
    45
typedef struct SDL_DisplayData
slouken@3161
    46
{
slouken@3161
    47
slouken@3161
    48
} SDL_DisplayData;
slouken@3161
    49
slouken@3161
    50
slouken@3161
    51
typedef struct SDL_WindowData
slouken@3161
    52
{
slouken@3161
    53
    SDL_bool uses_gles;         /* if true window must support OpenGL ES */
slouken@3161
    54
slouken@3161
    55
    EGLConfig gles_configs[32];
slouken@3161
    56
    EGLint gles_config;         /* OpenGL ES configuration index      */
slouken@3161
    57
    EGLContext gles_context;    /* OpenGL ES context                  */
slouken@3161
    58
    EGLint gles_attributes[256];        /* OpenGL ES attributes for context   */
slouken@3161
    59
    EGLSurface gles_surface;    /* OpenGL ES target rendering surface */
slouken@3161
    60
slouken@3161
    61
} SDL_WindowData;
slouken@3161
    62
slouken@3161
    63
slouken@3161
    64
/****************************************************************************/
slouken@3161
    65
/* SDL_VideoDevice functions declaration                                    */
slouken@3161
    66
/****************************************************************************/
slouken@3161
    67
slouken@3161
    68
/* Display and window functions */
slouken@3161
    69
int PND_videoinit(_THIS);
slouken@3161
    70
void PND_videoquit(_THIS);
slouken@3161
    71
void PND_getdisplaymodes(_THIS);
slouken@3161
    72
int PND_setdisplaymode(_THIS, SDL_DisplayMode * mode);
slouken@3161
    73
int PND_setdisplaypalette(_THIS, SDL_Palette * palette);
slouken@3161
    74
int PND_getdisplaypalette(_THIS, SDL_Palette * palette);
slouken@3161
    75
int PND_setdisplaygammaramp(_THIS, Uint16 * ramp);
slouken@3161
    76
int PND_getdisplaygammaramp(_THIS, Uint16 * ramp);
slouken@3161
    77
int PND_createwindow(_THIS, SDL_Window * window);
slouken@3161
    78
int PND_createwindowfrom(_THIS, SDL_Window * window, const void *data);
slouken@3161
    79
void PND_setwindowtitle(_THIS, SDL_Window * window);
slouken@3161
    80
void PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
slouken@3161
    81
void PND_setwindowposition(_THIS, SDL_Window * window);
slouken@3161
    82
void PND_setwindowsize(_THIS, SDL_Window * window);
slouken@3161
    83
void PND_showwindow(_THIS, SDL_Window * window);
slouken@3161
    84
void PND_hidewindow(_THIS, SDL_Window * window);
slouken@3161
    85
void PND_raisewindow(_THIS, SDL_Window * window);
slouken@3161
    86
void PND_maximizewindow(_THIS, SDL_Window * window);
slouken@3161
    87
void PND_minimizewindow(_THIS, SDL_Window * window);
slouken@3161
    88
void PND_restorewindow(_THIS, SDL_Window * window);
slouken@3161
    89
void PND_setwindowgrab(_THIS, SDL_Window * window);
slouken@3161
    90
void PND_destroywindow(_THIS, SDL_Window * window);
slouken@3161
    91
slouken@3161
    92
/* Window manager function */
slouken@3161
    93
SDL_bool PND_getwindowwminfo(_THIS, SDL_Window * window,
slouken@3161
    94
                             struct SDL_SysWMinfo *info);
slouken@3161
    95
slouken@3161
    96
/* OpenGL/OpenGL ES functions */
slouken@3161
    97
int PND_gl_loadlibrary(_THIS, const char *path);
slouken@3161
    98
void *PND_gl_getprocaddres(_THIS, const char *proc);
slouken@3161
    99
void PND_gl_unloadlibrary(_THIS);
slouken@3161
   100
SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window * window);
slouken@3161
   101
int PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
slouken@3161
   102
int PND_gl_setswapinterval(_THIS, int interval);
slouken@3161
   103
int PND_gl_getswapinterval(_THIS);
slouken@3161
   104
void PND_gl_swapwindow(_THIS, SDL_Window * window);
slouken@3161
   105
void PND_gl_deletecontext(_THIS, SDL_GLContext context);
slouken@3161
   106
slouken@3161
   107
slouken@3161
   108
#endif /* __SDL_PANDORA_H__ */
slouken@3161
   109
slouken@3161
   110
/* vi: set ts=4 sw=4 expandtab: */