blob: 40a9951bce5ba77756aae108aff1d1cd0a1f9e7e [file] [log] [blame]
Brian Paul9e5e5e32001-06-20 19:52:11 +00001/* $Id: svgamesa.h,v 1.5 2001/06/20 19:52:11 brianp Exp $ */
jtgafb833d1999-08-19 00:55:39 +00002
3/*
4 * Mesa 3-D graphics library
Brian Paul9e5e5e32001-06-20 19:52:11 +00005 * Version: 3.5
6 * Copyright (C) 1995-2001 Brian Paul
jtgafb833d1999-08-19 00:55:39 +00007 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23
24/*
jtgafb833d1999-08-19 00:55:39 +000025 * SVGA/Mesa interface for Linux.
26 */
27
28
29/*
30 * Intro to using the VGA/Mesa interface
31 *
32 * 1. #include the <vga.h> file
33 * 2. Call vga_init() to initialize the SVGA library.
34 * 3. Call vga_setmode() to specify the screen size and color depth.
35 * 4. Call SVGAMesaCreateContext() to setup a Mesa context. If using 8-bit
36 * color Mesa assumes color index mode, if using 16-bit or deeper color
37 * Mesa assumes RGB mode.
38 * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context.
39 * 6. You can now use the Mesa API functions.
40 * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT)
41 * to restore the original text screen.
42 *
43 * Notes
44 * 1. You must run your executable as root (or use the set UID-bit) because
45 * the SVGA library requires it.
46 * 2. The SVGA driver is not fully implemented yet. See svgamesa.c for what
47 * has to be done yet.
48 */
49
50
51#ifndef SVGAMESA_H
52#define SVGAMESA_H
53
54
55#define SVGAMESA_MAJOR_VERSION 3
Brian Paul9e5e5e32001-06-20 19:52:11 +000056#define SVGAMESA_MINOR_VERSION 5
jtgafb833d1999-08-19 00:55:39 +000057
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63
64#include "GL/gl.h"
65
66
67
68/*
69 * This is the SVGAMesa context 'handle':
70 */
71typedef struct svgamesa_context *SVGAMesaContext;
72
73
74
75/*
76 * doubleBuffer flag new in version 2.4
77 */
Brian Paul50a46ab2000-01-22 20:09:30 +000078extern int SVGAMesaInit( int GraphMode );
79
80extern int SVGAMesaClose( void );
81
jtgafb833d1999-08-19 00:55:39 +000082extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer );
83
84extern void SVGAMesaDestroyContext( SVGAMesaContext ctx );
85
86extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx );
87
jtgafb833d1999-08-19 00:55:39 +000088extern void SVGAMesaSwapBuffers( void );
89
Brian Paul50a46ab2000-01-22 20:09:30 +000090extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue);
91
92extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
jtgafb833d1999-08-19 00:55:39 +000093
94#ifdef __cplusplus
95}
96#endif
97
98
99#endif