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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
/*
* Copyright © 2004 David Reveman, Peter Nilsson
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the names of
* David Reveman and Peter Nilsson not be used in advertising or
* publicity pertaining to distribution of the software without
* specific, written prior permission. David Reveman and Peter Nilsson
* makes no representations about the suitability of this software for
* any purpose. It is provided "as is" without express or implied warranty.
*
* DAVID REVEMAN AND PETER NILSSON DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DAVID REVEMAN AND
* PETER NILSSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Authors: David Reveman <c99drn@cs.umu.se>
* Peter Nilsson <c99pnn@cs.umu.se>
*/
#ifndef GLITZ_GLXINT_H_INCLUDED
#define GLITZ_GLXINT_H_INCLUDED
#include "glitzint.h"
#include "glitz-glx.h"
#include <GL/gl.h>
#include <GL/glx.h>
#include "glitz_glxext.h"
#define GLITZ_GLX_FEATURE_TEXTURE_RECTANGLE_MASK (1L << 0)
#define GLITZ_GLX_FEATURE_TEXTURE_NON_POWER_OF_TWO_MASK (1L << 1)
#define GLITZ_GLX_FEATURE_TEXTURE_MIRRORED_REPEAT_MASK (1L << 2)
#define GLITZ_GLX_FEATURE_TEXTURE_BORDER_CLAMP_MASK (1L << 3)
#define GLITZ_GLX_FEATURE_MULTISAMPLE_MASK (1L << 4)
#define GLITZ_GLX_FEATURE_MULTISAMPLE_FILTER_HINT_MASK (1L << 5)
#define GLITZ_GLX_FEATURE_MULTITEXTURE_MASK (1L << 6)
#define GLITZ_GLX_FEATURE_TEXTURE_ENV_COMBINE_MASK (1L << 7)
#define GLITZ_GLX_FEATURE_TEXTURE_ENV_DOT3_MASK (1L << 8)
#define GLITZ_GLX_FEATURE_FRAGMENT_PROGRAM_MASK (1L << 9)
#define GLITZ_GLX_FEATURE_VERTEX_BUFFER_OBJECT_MASK (1L << 10)
#define GLITZ_GLX_FEATURE_PIXEL_BUFFER_OBJECT_MASK (1L << 11)
#define GLITZ_GLX_FEATURE_BLEND_COLOR_MASK (1L << 12)
#define GLITZ_GLX_FEATURE_GLX_FBCONFIG_MASK (1L << 13)
#define GLITZ_GLX_FEATURE_GLX_PBUFFER_MASK (1L << 14)
#define GLITZ_GLX_FEATURE_GLX_MAKE_CURRENT_READ_MASK (1L << 15)
#define GLITZ_GLX_FEATURE_GLX_GET_PROC_ADDRESS_MASK (1L << 16)
#define GLITZ_GLX_FEATURE_GLX_MULTISAMPLE_MASK (1L << 17)
typedef struct _glitz_glx_surface glitz_glx_surface_t;
typedef struct _glitz_glx_screen_info_t glitz_glx_screen_info_t;
typedef struct _glitz_glx_display_info_t glitz_glx_display_info_t;
typedef struct _glitz_glx_static_proc_address_list_t {
glitz_glx_get_proc_address_t get_proc_address;
glitz_glx_get_fbconfigs_t get_fbconfigs;
glitz_glx_get_fbconfig_attrib_t get_fbconfig_attrib;
glitz_glx_get_visual_from_fbconfig_t get_visual_from_fbconfig;
glitz_glx_create_pbuffer_t create_pbuffer;
glitz_glx_destroy_pbuffer_t destroy_pbuffer;
glitz_glx_make_context_current_t make_context_current;
glitz_glx_create_new_context_t create_new_context;
} glitz_glx_static_proc_address_list_t;
typedef struct _glitz_glx_thread_info_t {
glitz_glx_display_info_t **displays;
int n_displays;
char *gl_library;
void *dlhand;
} glitz_glx_thread_info_t;
struct _glitz_glx_display_info_t {
glitz_glx_thread_info_t *thread_info;
Display *display;
glitz_glx_screen_info_t **screens;
int n_screens;
};
typedef struct _glitz_glx_context_info_t {
glitz_glx_surface_t *surface;
glitz_constraint_t constraint;
} glitz_glx_context_info_t;
typedef struct _glitz_glx_context_t {
GLXContext context;
XID id;
GLXFBConfig fbconfig;
glitz_surface_backend_t backend;
glitz_gl_int_t max_viewport_dims[2];
glitz_gl_int_t max_texture_2d_size;
glitz_gl_int_t max_texture_rect_size;
} glitz_glx_context_t;
struct _glitz_glx_screen_info_t {
glitz_glx_display_info_t *display_info;
int screen;
glitz_format_t *formats;
XID *format_ids;
int n_formats;
glitz_glx_context_t **contexts;
int n_contexts;
glitz_glx_context_info_t context_stack[GLITZ_CONTEXT_STACK_SIZE];
int context_stack_size;
glitz_glx_context_t root_context;
GLXDrawable root_drawable;
Colormap root_colormap;
unsigned long feature_mask;
unsigned long glx_feature_mask;
glitz_gl_float_t gl_version;
glitz_gl_float_t glx_version;
glitz_glx_static_proc_address_list_t glx;
glitz_program_map_t program_map;
};
struct _glitz_glx_surface {
glitz_surface_t base;
glitz_glx_screen_info_t *screen_info;
glitz_glx_context_t *context;
GLXDrawable drawable;
GLXDrawable pbuffer;
};
extern glitz_status_t __internal_linkage
glitz_glx_query_extensions (glitz_glx_screen_info_t *screen_info);
extern glitz_glx_screen_info_t *__internal_linkage
glitz_glx_screen_info_get (Display *display,
int screen);
extern glitz_function_pointer_t __internal_linkage
glitz_glx_get_proc_address (glitz_glx_screen_info_t *screen_info,
const char *name);
extern glitz_glx_context_t *__internal_linkage
glitz_glx_context_get (glitz_glx_screen_info_t *screen_info,
glitz_format_t *format);
extern void __internal_linkage
glitz_glx_context_destroy (glitz_glx_screen_info_t *screen_info,
glitz_glx_context_t *context);
extern int __internal_linkage
glitz_glx_ensure_pbuffer_support (glitz_glx_screen_info_t *screen_info,
XID fbconfigid);
extern glitz_glx_context_t *__internal_linkage
glitz_glx_context_get_default (glitz_glx_screen_info_t *screen_info);
extern void __internal_linkage
glitz_glx_context_make_current (glitz_glx_surface_t *surface,
GLXContext context,
glitz_bool_t flush);
extern glitz_glx_surface_t *__internal_linkage
glitz_glx_context_push_current (glitz_glx_surface_t *surface,
glitz_constraint_t constraint);
extern glitz_glx_surface_t *__internal_linkage
glitz_glx_context_pop_current (glitz_glx_surface_t *surface);
extern void __internal_linkage
glitz_glx_context_proc_address_lookup (glitz_glx_screen_info_t *screen_info,
glitz_glx_context_t *context);
extern void __internal_linkage
glitz_glx_query_formats (glitz_glx_screen_info_t *screen_info);
extern GLXPbuffer __internal_linkage
glitz_glx_pbuffer_create (glitz_glx_screen_info_t *screen_info,
GLXFBConfig fbconfig,
glitz_texture_t *texture);
extern void __internal_linkage
glitz_glx_pbuffer_destroy (glitz_glx_screen_info_t *screen_info,
GLXPbuffer pbuffer);
extern void __internal_linkage
glitz_glx_surface_backend_init (glitz_surface_backend_t *backend);
/* Avoid unnecessary PLT entries. */
slim_hidden_proto(glitz_glx_init)
slim_hidden_proto(glitz_glx_fini)
slim_hidden_proto(glitz_glx_find_format)
slim_hidden_proto(glitz_glx_find_standard_format)
slim_hidden_proto(glitz_glx_get_visual_info_from_format)
slim_hidden_proto(glitz_glx_surface_create)
slim_hidden_proto(glitz_glx_surface_create_for_window)
#endif /* GLITZ_GLXINT_H_INCLUDED */
|