src/video/ataricommon/SDL_atarigl_c.h
author Patrice Mandin <patmandin@gmail.com>
Thu, 25 Nov 2004 15:47:49 +0000
changeset 989 475166d13b44
child 991 12b13601a544
permissions -rw-r--r--
Factorize OSMesa OpenGL code for Atari drivers
patmandin@989
     1
/*
patmandin@989
     2
    SDL - Simple DirectMedia Layer
patmandin@989
     3
    Copyright (C) 1997-2004 Sam Lantinga
patmandin@989
     4
patmandin@989
     5
    This library is free software; you can redistribute it and/or
patmandin@989
     6
    modify it under the terms of the GNU Library General Public
patmandin@989
     7
    License as published by the Free Software Foundation; either
patmandin@989
     8
    version 2 of the License, or (at your option) any later version.
patmandin@989
     9
patmandin@989
    10
    This library is distributed in the hope that it will be useful,
patmandin@989
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
patmandin@989
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
patmandin@989
    13
    Library General Public License for more details.
patmandin@989
    14
patmandin@989
    15
    You should have received a copy of the GNU Library General Public
patmandin@989
    16
    License along with this library; if not, write to the Free
patmandin@989
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
patmandin@989
    18
patmandin@989
    19
    Sam Lantinga
patmandin@989
    20
    slouken@libsdl.org
patmandin@989
    21
*/
patmandin@989
    22
patmandin@989
    23
/* Atari OSMesa.ldg implementation of SDL OpenGL support */
patmandin@989
    24
patmandin@989
    25
#ifndef _SDL_ATARIGL_H_
patmandin@989
    26
#define _SDL_ATARIGL_H_
patmandin@989
    27
patmandin@989
    28
#ifdef HAVE_OPENGL
patmandin@989
    29
#include <GL/osmesa.h>
patmandin@989
    30
#endif
patmandin@989
    31
patmandin@989
    32
#include "SDL_sysvideo.h"
patmandin@989
    33
#define _THIS   SDL_VideoDevice *this
patmandin@989
    34
patmandin@989
    35
struct SDL_PrivateGLData {
patmandin@989
    36
	/* to stop switching drivers while we have a valid context */
patmandin@989
    37
    int gl_active; 
patmandin@989
    38
patmandin@989
    39
	/* for unsupported OSMesa buffer formats */
patmandin@989
    40
	void (*ConvertSurface)(SDL_Surface *surface);	
patmandin@989
    41
patmandin@989
    42
#ifdef HAVE_OPENGL
patmandin@989
    43
	OSMesaContext	ctx;
patmandin@989
    44
#endif
patmandin@989
    45
};
patmandin@989
    46
patmandin@989
    47
/* Old variable names */
patmandin@989
    48
#define gl_active	(this->gl_data->gl_active)
patmandin@989
    49
#define gl_ctx		(this->gl_data->ctx)
patmandin@989
    50
#define gl_convert	(this->gl_data->ConvertSurface)
patmandin@989
    51
patmandin@989
    52
/* OpenGL functions */
patmandin@989
    53
extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current);
patmandin@989
    54
extern void SDL_AtariGL_Quit(_THIS);
patmandin@989
    55
patmandin@989
    56
extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
patmandin@989
    57
extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
patmandin@989
    58
extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
patmandin@989
    59
extern int SDL_AtariGL_MakeCurrent(_THIS);
patmandin@989
    60
extern void SDL_AtariGL_SwapBuffers(_THIS);
patmandin@989
    61
patmandin@989
    62
#endif /* _SDL_ATARIGL_H_ */