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