1 /* uglmesa.h - Public header UGL/Mesa */
3 /* Copyright (C) 2001 by Wind River Systems, Inc */
6 * Mesa 3-D graphics library
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
31 * Stephane Raimbault <stephane.raimbault@windriver.com>
41 #define UGL_MESA_MAJOR_VERSION 4
42 #define UGL_MESA_MINOR_VERSION 0
48 * Values for display mode of uglMesaCreateContext ()
52 * With these mask values, it's possible to test double buffer mode
53 * with UGL_MESA_DOUBLE mask
63 #define UGL_MESA_SINGLE 0x01
64 #define UGL_MESA_DOUBLE 0x06
65 #define UGL_MESA_DOUBLE_SOFTWARE 0x02
66 #define UGL_MESA_DOUBLE_HARDWARE 0x04
68 #define UGL_MESA_WINDML_EXCLUSIVE 0x10
70 #define UGL_MESA_FULLSCREEN_WIDTH 0x0
71 #define UGL_MESA_FULLSCREEN_HEIGHT 0x0
74 * uglMesaPixelStore() parameters:
77 #define UGL_MESA_ROW_LENGTH 0x20
78 #define UGL_MESA_Y_UP 0x21
81 * Accepted by uglMesaGetIntegerv:
84 #define UGL_MESA_LEFT_X 0x01
85 #define UGL_MESA_TOP_Y 0x02
86 #define UGL_MESA_WIDTH 0x03
87 #define UGL_MESA_HEIGHT 0x04
88 #define UGL_MESA_DISPLAY_WIDTH 0x05
89 #define UGL_MESA_DISPLAY_HEIGHT 0x06
90 #define UGL_MESA_COLOR_FORMAT 0x07
91 #define UGL_MESA_COLOR_MODEL 0x08
92 #define UGL_MESA_PIXEL_FORMAT 0x09
93 #define UGL_MESA_TYPE 0x0A
94 #define UGL_MESA_RGB 0x0B
95 #define UGL_MESA_COLOR_INDEXED 0x0C
96 #define UGL_MESA_SINGLE_BUFFER 0x0D
97 #define UGL_MESA_DOUBLE_BUFFER 0x0E
98 #define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F
99 #define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10
105 typedef struct uglMesaContext
* UGL_MESA_CONTEXT
;
107 UGL_MESA_CONTEXT
uglMesaCreateNewContext (GLenum mode
,
108 UGL_MESA_CONTEXT share_list
);
110 UGL_MESA_CONTEXT
uglMesaCreateNewContextExt (GLenum mode
,
113 GLint accum_red_bits
,
114 GLint accum_green_bits
,
115 GLint accum_blue_bits
,
116 GLint accum_alpha_bits
,
117 UGL_MESA_CONTEXT share_list
);
119 GLboolean
uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc
,
120 GLsizei left
, GLsizei top
,
121 GLsizei width
, GLsizei height
);
123 GLboolean
uglMesaMoveWindow (GLsizei dx
, GLsizei dy
);
125 GLboolean
uglMesaMoveToWindow (GLsizei left
, GLsizei top
);
127 GLboolean
uglMesaResizeWindow (GLsizei dw
, GLsizei dh
);
129 GLboolean
uglMesaResizeToWindow (GLsizei width
, GLsizei height
);
131 void uglMesaDestroyContext (void);
133 UGL_MESA_CONTEXT
uglMesaGetCurrentContext (void);
135 void uglMesaSwapBuffers (void);
137 void uglMesaPixelStore (GLint pname
, GLint value
);
139 void uglMesaGetIntegerv (GLint pname
, GLint
*value
);
141 GLboolean
uglMesaGetDepthBuffer (GLint
*width
, GLint
*height
,
142 GLint
*bytesPerValue
, void **buffer
);
144 GLboolean
uglMesaGetColorBuffer (GLint
*width
, GLint
*height
,
145 GLint
*format
, void **buffer
);
147 GLboolean
uglMesaSetColor (GLubyte index
, GLfloat red
,
148 GLfloat green
, GLfloat blue
);