src/video/directfb/SDL_DirectFB_opengl.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 16 Aug 2010 09:04:55 -0700
changeset 4636 b196d2758026
parent 3697 f7b03b6838cb
child 5199 164f20ba08eb
permissions -rw-r--r--
Couriersud to Sam

Hi Sam,

20100815_1.diff contains updates for the directfb driver:

- more documentation, mainly on software OpenGL in README.directfb
- Revised error handling leading to leaner code
- Improved/fixed OpenGL handling of multiple contexts.
- Made the built-in simple window manager handle OpenGL windows.
- Rewrote pixelformat mapping - this was quite ugly before.

Well, all software GL, but working :-)
slouken@2737
     1
/*
slouken@2737
     2
    SDL - Simple DirectMedia Layer
slouken@3697
     3
    Copyright (C) 1997-2010 Sam Lantinga
slouken@2737
     4
slouken@2737
     5
    This library is free software; you can redistribute it and/or
slouken@2737
     6
    modify it under the terms of the GNU Lesser General Public
slouken@2737
     7
    License as published by the Free Software Foundation; either
slouken@2737
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@2737
     9
slouken@2737
    10
    This library is distributed in the hope that it will be useful,
slouken@2737
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@2737
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@2737
    13
    Lesser General Public License for more details.
slouken@2737
    14
slouken@2737
    15
    You should have received a copy of the GNU Lesser General Public
slouken@2737
    16
    License along with this library; if not, write to the Free Software
slouken@2737
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@2737
    18
slouken@2737
    19
    Sam Lantinga
slouken@2737
    20
    slouken@libsdl.org
slouken@2737
    21
*/
slouken@2737
    22
#include "SDL_config.h"
slouken@2737
    23
slouken@2737
    24
#ifndef _SDL_directfb_opengl_h
slouken@2737
    25
#define _SDL_directfb_opengl_h
slouken@2737
    26
slouken@2737
    27
#if SDL_DIRECTFB_OPENGL
slouken@2737
    28
#include "SDL_opengl.h"
slouken@2737
    29
slouken@2737
    30
typedef struct _DirectFB_GLContext DirectFB_GLContext;
slouken@2737
    31
struct _DirectFB_GLContext
slouken@2737
    32
{
slouken@2737
    33
    IDirectFBGL *context;
slouken@2737
    34
    DirectFB_GLContext *next;
slouken@4636
    35
    
slouken@4636
    36
    SDL_Window *sdl_window;
slouken@4636
    37
    int is_locked;
slouken@2737
    38
};
slouken@2737
    39
slouken@2737
    40
/* OpenGL functions */
slouken@2737
    41
extern int DirectFB_GL_Initialize(_THIS);
slouken@2737
    42
extern void DirectFB_GL_Shutdown(_THIS);
slouken@2737
    43
slouken@2737
    44
extern int DirectFB_GL_LoadLibrary(_THIS, const char *path);
slouken@2737
    45
extern void *DirectFB_GL_GetProcAddress(_THIS, const char *proc);
slouken@2737
    46
extern SDL_GLContext DirectFB_GL_CreateContext(_THIS, SDL_Window * window);
slouken@2737
    47
extern int DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window,
slouken@2737
    48
                                   SDL_GLContext context);
slouken@2737
    49
extern int DirectFB_GL_SetSwapInterval(_THIS, int interval);
slouken@2737
    50
extern int DirectFB_GL_GetSwapInterval(_THIS);
slouken@2737
    51
extern void DirectFB_GL_SwapWindow(_THIS, SDL_Window * window);
slouken@2737
    52
extern void DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context);
slouken@2737
    53
slouken@4636
    54
extern void DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window);
slouken@4636
    55
extern void DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window);
slouken@4636
    56
extern void DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window);
slouken@4636
    57
slouken@2737
    58
#endif /* SDL_DIRECTFB_OPENGL */
slouken@2737
    59
slouken@2737
    60
#endif /* _SDL_directfb_opengl_h */
slouken@2737
    61
slouken@2737
    62
/* vi: set ts=4 sw=4 expandtab: */