DOS and glide driver updates from Daniel Borca
[mesa.git] / include / GL / dmesa.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 5.0
4 *
5 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /*
26 * DOS/DJGPP device driver v1.4 for Mesa
27 *
28 * Copyright (C) 2002 - Borca Daniel
29 * Email : dborca@users.sourceforge.net
30 * Web : http://www.geocities.com/dborca
31 */
32
33
34 #ifndef DMESA_H_included
35 #define DMESA_H_included
36
37 #define DMESA_MAJOR_VERSION 5
38 #define DMESA_MINOR_VERSION 0
39
40 /* Sample Usage:
41 *
42 * 1. Call DMesaCreateVisual() to initialize graphics.
43 * 2. Call DMesaCreateContext() to create a DMesa rendering context.
44 * 3. Call DMesaCreateBuffer() to define the window.
45 * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
46 * 5. Make gl* calls to render your graphics.
47 * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
48 * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
49 */
50
51 typedef struct dmesa_context *DMesaContext;
52 typedef struct dmesa_visual *DMesaVisual;
53 typedef struct dmesa_buffer *DMesaBuffer;
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /*
60 * Create a new Visual and set graphics mode.
61 */
62 DMesaVisual DMesaCreateVisual (GLint width, /* X res */
63 GLint height, /* Y res */
64 GLint colDepth, /* BPP */
65 GLint refresh, /* refresh rate: 0=default */
66 GLboolean dbFlag, /* double-buffered */
67 GLboolean rgbFlag, /* RGB mode */
68 GLboolean alphaFlag,/* alpha buffer requested */
69 GLint depthSize, /* requested bits/depth */
70 GLint stencilSize, /* requested bits/stencil */
71 GLint accumSize); /* requested bits/accum */
72
73 /*
74 * Destroy Visual and restore screen.
75 */
76 void DMesaDestroyVisual (DMesaVisual v);
77
78
79
80 /*
81 * Create a new Context for rendering.
82 */
83 DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
84
85 /*
86 * Destroy Context.
87 */
88 void DMesaDestroyContext (DMesaContext c);
89
90 /*
91 * Return a handle to the current context.
92 */
93 void *DMesaGetCurrentContext (void);
94
95
96
97 /*
98 * Create a new Buffer (window).
99 */
100 DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
101 GLint xpos, GLint ypos,
102 GLint width, GLint height);
103
104 /*
105 * Destroy Buffer.
106 */
107 void DMesaDestroyBuffer (DMesaBuffer b);
108
109 /*
110 * Swap the front and back buffers for the given Buffer.
111 * No action is taken if the buffer is not double buffered.
112 */
113 void DMesaSwapBuffers (DMesaBuffer b);
114
115 /*
116 * Bind Buffer to Context and make the Context the current one.
117 */
118 GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
119
120
121
122 /*
123 * Move/Resize current Buffer.
124 */
125 GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
126 GLboolean DMesaResizeBuffer (GLint width, GLint height);
127
128 /*
129 * Set palette index, using normalized values.
130 */
131 void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
132
133 /*
134 * DMesa state retrieval.
135 */
136 #define DMESA_GET_SCREEN_SIZE 0x0100
137 #define DMESA_GET_DRIVER_CAPS 0x0200
138
139 #define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
140 #define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
141 int DMesaGetIntegerv (GLenum pname, GLint *params);
142
143 #ifdef __cplusplus
144 }
145 #endif
146
147 #endif