blob: 7ef5843504e2933a2c73fbee9fbdcb7a4407e51e [file] [log] [blame]
Brian Paul976c26c2001-08-20 16:07:10 +00001/* uglmesa.h - Public header UGL/Mesa */
2
3/* Copyright (C) 2001 by Wind River Systems, Inc */
4
5/*
6 * Mesa 3-D graphics library
Brian Paul78a03d32001-09-23 16:06:13 +00007 * Version: 4.0
Brian Paul976c26c2001-08-20 16:07:10 +00008 *
9 * The MIT License
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:
16 *
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
19 *
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.
27 */
28
29/*
30 * Author:
31 * Stephane Raimbault <stephane.raimbault@windriver.com>
32 */
33
34#ifndef UGLMESA_H
35#define UGLMESA_H
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
Brian Paul78a03d32001-09-23 16:06:13 +000041#define UGL_MESA_MAJOR_VERSION 4
Brian Paul976c26c2001-08-20 16:07:10 +000042#define UGL_MESA_MINOR_VERSION 0
43
44#include <GL/gl.h>
45#include <ugl/ugl.h>
46
47/*
48 * Values for display mode of uglMesaCreateContext ()
49 */
50
Brian Paul30693302001-09-10 19:21:13 +000051/*
52 * With these mask values, it's possible to test double buffer mode
53 * with UGL_MESA_DOUBLE mask
54 *
55 * SINGLE 0000 0001
56 * DOUBLE 0000 0110
57 * - SOFT 0000 0010
58 * - HARD 0000 0100
59 * WINDML 0001 0000
60 *
61 *
62 */
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
Brian Paul976c26c2001-08-20 16:07:10 +000067
Brian Paul30693302001-09-10 19:21:13 +000068#define UGL_MESA_WINDML_EXCLUSIVE 0x10
69
Brian Paul976c26c2001-08-20 16:07:10 +000070#define UGL_MESA_FULLSCREEN_WIDTH 0x0
71#define UGL_MESA_FULLSCREEN_HEIGHT 0x0
72
73/*
Brian Paul976c26c2001-08-20 16:07:10 +000074 * uglMesaPixelStore() parameters:
75 */
76
Brian Paul30693302001-09-10 19:21:13 +000077#define UGL_MESA_ROW_LENGTH 0x20
78#define UGL_MESA_Y_UP 0x21
Brian Paul976c26c2001-08-20 16:07:10 +000079
80/*
81 * Accepted by uglMesaGetIntegerv:
82 */
83
Brian Paul30693302001-09-10 19:21:13 +000084#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
100
Brian Paul976c26c2001-08-20 16:07:10 +0000101/*
102 * typedefs
103 */
104
105typedef struct uglMesaContext * UGL_MESA_CONTEXT;
106
Brian Paul30693302001-09-10 19:21:13 +0000107UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode,
Brian Paul976c26c2001-08-20 16:07:10 +0000108 UGL_MESA_CONTEXT share_list);
109
Brian Paul30693302001-09-10 19:21:13 +0000110UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum mode,
Brian Paul976c26c2001-08-20 16:07:10 +0000111 GLint depth_bits,
112 GLint stencil_bits,
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);
118
Brian Paul976c26c2001-08-20 16:07:10 +0000119GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc,
120 GLsizei left, GLsizei top,
121 GLsizei width, GLsizei height);
122
Brian Paul976c26c2001-08-20 16:07:10 +0000123GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy);
124
Brian Paul976c26c2001-08-20 16:07:10 +0000125GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top);
126
Brian Paul976c26c2001-08-20 16:07:10 +0000127GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh);
128
Brian Paul976c26c2001-08-20 16:07:10 +0000129GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height);
130
Brian Paul976c26c2001-08-20 16:07:10 +0000131void uglMesaDestroyContext (void);
132
Brian Paul976c26c2001-08-20 16:07:10 +0000133UGL_MESA_CONTEXT uglMesaGetCurrentContext (void);
134
Brian Paul976c26c2001-08-20 16:07:10 +0000135void uglMesaSwapBuffers (void);
136
Brian Paul976c26c2001-08-20 16:07:10 +0000137void uglMesaPixelStore (GLint pname, GLint value);
138
Brian Paul976c26c2001-08-20 16:07:10 +0000139void uglMesaGetIntegerv (GLint pname, GLint *value);
140
Brian Paul976c26c2001-08-20 16:07:10 +0000141GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height,
142 GLint *bytesPerValue, void **buffer);
143
Brian Paul976c26c2001-08-20 16:07:10 +0000144GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height,
145 GLint *format, void **buffer);
146
Brian Paul976c26c2001-08-20 16:07:10 +0000147GLboolean uglMesaSetColor (GLubyte index, GLfloat red,
148 GLfloat green, GLfloat blue);
149
150#ifdef __cplusplus
151}
152#endif
153
154
155#endif