2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
26 * DOS/DJGPP device driver v1.3 for Mesa 5.0
28 * Copyright (C) 2002 - Borca Daniel
29 * Email : dborca@yahoo.com
30 * Web : http://www.geocities.com/dborca
34 #ifndef DMESA_H_included
35 #define DMESA_H_included
37 #define DMESA_MAJOR_VERSION 5
38 #define DMESA_MINOR_VERSION 0
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.
51 typedef struct dmesa_context
*DMesaContext
;
52 typedef struct dmesa_visual
*DMesaVisual
;
53 typedef struct dmesa_buffer
*DMesaBuffer
;
60 * Create a new Visual and set graphics mode.
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 */
74 * Destroy Visual and restore screen.
76 void DMesaDestroyVisual (DMesaVisual v
);
81 * Create a new Context for rendering.
83 DMesaContext
DMesaCreateContext (DMesaVisual visual
, DMesaContext share
);
88 void DMesaDestroyContext (DMesaContext c
);
93 * Create a new Buffer (window).
95 DMesaBuffer
DMesaCreateBuffer (DMesaVisual visual
,
96 GLint xpos
, GLint ypos
,
97 GLint width
, GLint height
);
102 void DMesaDestroyBuffer (DMesaBuffer b
);
107 * Bind Buffer to Context and make the Context the current one.
109 GLboolean
DMesaMakeCurrent (DMesaContext c
, DMesaBuffer b
);
114 * Swap the front and back buffers for the given Buffer.
115 * No action is taken if the buffer is not double buffered.
117 void DMesaSwapBuffers (DMesaBuffer b
);
122 * Move/Resize Buffer.
124 GLboolean
DMesaViewport (DMesaBuffer b
,
125 GLint xpos
, GLint ypos
,
126 GLint width
, GLint height
);
129 * Set CI color using normalized values.
131 void DMesaSetCI (int ndx
, GLfloat red
, GLfloat green
, GLfloat blue
);