DOS 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.3 for Mesa 5.0
27 *
28 * Copyright (C) 2002 - Borca Daniel
29 * Email : dborca@yahoo.com
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
92 /*
93 * Create a new Buffer (window).
94 */
95 DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
96 GLint xpos, GLint ypos,
97 GLint width, GLint height);
98
99 /*
100 * Destroy Buffer.
101 */
102 void DMesaDestroyBuffer (DMesaBuffer b);
103
104
105
106 /*
107 * Bind Buffer to Context and make the Context the current one.
108 */
109 GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
110
111
112
113 /*
114 * Swap the front and back buffers for the given Buffer.
115 * No action is taken if the buffer is not double buffered.
116 */
117 void DMesaSwapBuffers (DMesaBuffer b);
118
119
120
121 /*
122 * Move/Resize Buffer.
123 */
124 GLboolean DMesaViewport (DMesaBuffer b,
125 GLint xpos, GLint ypos,
126 GLint width, GLint height);
127
128 /*
129 * Set CI color using normalized values.
130 */
131 void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
132
133 #ifdef __cplusplus
134 }
135 #endif
136
137 #endif