summaryrefslogtreecommitdiffstats
path: root/include/GL/uglmesa.h
blob: 7ef5843504e2933a2c73fbee9fbdcb7a4407e51e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/* uglmesa.h - Public header UGL/Mesa */

/* Copyright (C) 2001 by Wind River Systems, Inc */

/*
 * Mesa 3-D graphics library
 * Version:  4.0
 *
 * The MIT License
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

/*
 * Author:
 * Stephane Raimbault <stephane.raimbault@windriver.com> 
 */

#ifndef UGLMESA_H
#define UGLMESA_H

#ifdef __cplusplus
extern "C" {
#endif

#define UGL_MESA_MAJOR_VERSION 4
#define UGL_MESA_MINOR_VERSION 0

#include <GL/gl.h>
#include <ugl/ugl.h>

/*
 * Values for display mode of uglMesaCreateContext ()
 */

/*
 * With these mask values, it's possible to test double buffer mode
 * with UGL_MESA_DOUBLE mask
 *
 * SINGLE  0000 0001
 * DOUBLE  0000 0110
 * -  SOFT 0000 0010
 * -  HARD 0000 0100
 * WINDML  0001 0000
 *
 * 
 */
#define UGL_MESA_SINGLE            0x01
#define UGL_MESA_DOUBLE            0x06
#define UGL_MESA_DOUBLE_SOFTWARE   0x02
#define UGL_MESA_DOUBLE_HARDWARE   0x04
    
#define UGL_MESA_WINDML_EXCLUSIVE  0x10

#define UGL_MESA_FULLSCREEN_WIDTH  0x0
#define UGL_MESA_FULLSCREEN_HEIGHT 0x0

/*
 * uglMesaPixelStore() parameters:
 */
    
#define UGL_MESA_ROW_LENGTH	   0x20
#define UGL_MESA_Y_UP              0x21

/* 
 * Accepted by uglMesaGetIntegerv:
 */

#define UGL_MESA_LEFT_X		        0x01
#define UGL_MESA_TOP_Y		        0x02    
#define UGL_MESA_WIDTH		        0x03
#define UGL_MESA_HEIGHT		        0x04
#define UGL_MESA_DISPLAY_WIDTH          0x05
#define UGL_MESA_DISPLAY_HEIGHT         0x06
#define UGL_MESA_COLOR_FORMAT	        0x07
#define UGL_MESA_COLOR_MODEL            0x08
#define UGL_MESA_PIXEL_FORMAT           0x09
#define UGL_MESA_TYPE		        0x0A
#define UGL_MESA_RGB		        0x0B
#define UGL_MESA_COLOR_INDEXED          0x0C
#define UGL_MESA_SINGLE_BUFFER          0x0D
#define UGL_MESA_DOUBLE_BUFFER          0x0E
#define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F
#define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10
    
/*
 * typedefs
 */

typedef struct uglMesaContext * UGL_MESA_CONTEXT;
    
UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode,
					  UGL_MESA_CONTEXT share_list);

UGL_MESA_CONTEXT  uglMesaCreateNewContextExt (GLenum mode,
					      GLint depth_bits,
					      GLint stencil_bits,
					      GLint accum_red_bits,
					      GLint accum_green_bits,
					      GLint accum_blue_bits,
					      GLint accum_alpha_bits,
					      UGL_MESA_CONTEXT share_list);

GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc,
				     GLsizei left, GLsizei top,
				     GLsizei width, GLsizei height);

GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy);

GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top);

GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh);

GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height);

void uglMesaDestroyContext (void);

UGL_MESA_CONTEXT uglMesaGetCurrentContext (void);

void uglMesaSwapBuffers (void);

void uglMesaPixelStore (GLint pname, GLint value);

void uglMesaGetIntegerv (GLint pname, GLint *value);

GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height,
				 GLint *bytesPerValue, void **buffer);

GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height,
				 GLint *format, void **buffer);

GLboolean uglMesaSetColor (GLubyte index, GLfloat red,
			   GLfloat green, GLfloat blue);
  
#ifdef __cplusplus
}
#endif


#endif