File: glx.c

package info (click to toggle)
swt-gtk 3.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 11,896 kB
  • ctags: 21,996
  • sloc: java: 102,480; ansic: 28,645; cpp: 3,683; sh: 154; makefile: 43; xml: 42
file content (316 lines) | stat: -rw-r--r-- 10,333 bytes parent folder | download
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
/*******************************************************************************
 * Copyright (c) 2000, 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/

#include "swt.h"
#include "glx_structs.h"
#include "glx_stats.h"

#define GLX_NATIVE(func) Java_org_eclipse_swt_internal_opengl_glx_GLX_##func

#ifndef NO_XVisualInfo_1sizeof
JNIEXPORT jint JNICALL GLX_NATIVE(XVisualInfo_1sizeof)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, XVisualInfo_1sizeof_FUNC);
	rc = (jint)XVisualInfo_sizeof();
	GLX_NATIVE_EXIT(env, that, XVisualInfo_1sizeof_FUNC);
	return rc;
}
#endif

#ifndef NO__1glGetIntegerv
JNIEXPORT void JNICALL GLX_NATIVE(_1glGetIntegerv)
	(JNIEnv *env, jclass that, jint arg0, jintArray arg1)
{
	jint *lparg1=NULL;
	GLX_NATIVE_ENTER(env, that, _1glGetIntegerv_FUNC);
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
	glGetIntegerv((GLenum)arg0, (GLint *)lparg1);
fail:
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
	GLX_NATIVE_EXIT(env, that, _1glGetIntegerv_FUNC);
}
#endif

#ifndef NO__1glViewport
JNIEXPORT void JNICALL GLX_NATIVE(_1glViewport)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
{
	GLX_NATIVE_ENTER(env, that, _1glViewport_FUNC);
	glViewport((GLint)arg0, (GLint)arg1, (GLsizei)arg2, (GLsizei)arg3);
	GLX_NATIVE_EXIT(env, that, _1glViewport_FUNC);
}
#endif

#ifndef NO__1glXChooseVisual
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXChooseVisual)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jintArray arg2)
{
	jint *lparg2=NULL;
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXChooseVisual_FUNC);
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
	rc = (jint)glXChooseVisual((Display *)arg0, arg1, lparg2);
fail:
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
	GLX_NATIVE_EXIT(env, that, _1glXChooseVisual_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXCopyContext
JNIEXPORT void JNICALL GLX_NATIVE(_1glXCopyContext)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
{
	GLX_NATIVE_ENTER(env, that, _1glXCopyContext_FUNC);
	glXCopyContext((Display *)arg0, (GLXContext)arg1, (GLXContext)arg2, arg3);
	GLX_NATIVE_EXIT(env, that, _1glXCopyContext_FUNC);
}
#endif

#ifndef NO__1glXCreateContext
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXCreateContext)
	(JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2, jboolean arg3)
{
	XVisualInfo _arg1, *lparg1=NULL;
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXCreateContext_FUNC);
	if (arg1) if ((lparg1 = getXVisualInfoFields(env, arg1, &_arg1)) == NULL) goto fail;
	rc = (jint)glXCreateContext((Display *)arg0, lparg1, (GLXContext)arg2, arg3);
fail:
	if (arg1 && lparg1) setXVisualInfoFields(env, arg1, lparg1);
	GLX_NATIVE_EXIT(env, that, _1glXCreateContext_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXCreateGLXPixmap
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXCreateGLXPixmap)
	(JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2)
{
	XVisualInfo _arg1, *lparg1=NULL;
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXCreateGLXPixmap_FUNC);
	if (arg1) if ((lparg1 = getXVisualInfoFields(env, arg1, &_arg1)) == NULL) goto fail;
	rc = (jint)glXCreateGLXPixmap((Display *)arg0, lparg1, (Pixmap)arg2);
fail:
	if (arg1 && lparg1) setXVisualInfoFields(env, arg1, lparg1);
	GLX_NATIVE_EXIT(env, that, _1glXCreateGLXPixmap_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXDestroyContext
JNIEXPORT void JNICALL GLX_NATIVE(_1glXDestroyContext)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	GLX_NATIVE_ENTER(env, that, _1glXDestroyContext_FUNC);
	glXDestroyContext((Display *)arg0, (GLXContext)arg1);
	GLX_NATIVE_EXIT(env, that, _1glXDestroyContext_FUNC);
}
#endif

#ifndef NO__1glXDestroyGLXPixmap
JNIEXPORT void JNICALL GLX_NATIVE(_1glXDestroyGLXPixmap)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	GLX_NATIVE_ENTER(env, that, _1glXDestroyGLXPixmap_FUNC);
	glXDestroyGLXPixmap((Display *)arg0, (GLXPixmap)arg1);
	GLX_NATIVE_EXIT(env, that, _1glXDestroyGLXPixmap_FUNC);
}
#endif

#ifndef NO__1glXGetClientString
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXGetClientString)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXGetClientString_FUNC);
	rc = (jint)glXGetClientString((Display *)arg0, arg1);
	GLX_NATIVE_EXIT(env, that, _1glXGetClientString_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXGetConfig
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXGetConfig)
	(JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2, jintArray arg3)
{
	XVisualInfo _arg1, *lparg1=NULL;
	jint *lparg3=NULL;
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXGetConfig_FUNC);
	if (arg1) if ((lparg1 = getXVisualInfoFields(env, arg1, &_arg1)) == NULL) goto fail;
	if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
	rc = (jint)glXGetConfig((Display *)arg0, lparg1, arg2, lparg3);
fail:
	if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0);
	if (arg1 && lparg1) setXVisualInfoFields(env, arg1, lparg1);
	GLX_NATIVE_EXIT(env, that, _1glXGetConfig_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXGetCurrentContext
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXGetCurrentContext)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXGetCurrentContext_FUNC);
	rc = (jint)glXGetCurrentContext();
	GLX_NATIVE_EXIT(env, that, _1glXGetCurrentContext_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXGetCurrentDrawable
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXGetCurrentDrawable)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXGetCurrentDrawable_FUNC);
	rc = (jint)glXGetCurrentDrawable();
	GLX_NATIVE_EXIT(env, that, _1glXGetCurrentDrawable_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXIsDirect
JNIEXPORT jboolean JNICALL GLX_NATIVE(_1glXIsDirect)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	jboolean rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXIsDirect_FUNC);
	rc = (jboolean)glXIsDirect((Display *)arg0, (GLXContext)arg1);
	GLX_NATIVE_EXIT(env, that, _1glXIsDirect_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXMakeCurrent
JNIEXPORT jboolean JNICALL GLX_NATIVE(_1glXMakeCurrent)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
{
	jboolean rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXMakeCurrent_FUNC);
	rc = (jboolean)glXMakeCurrent((Display *)arg0, (GLXDrawable)arg1, (GLXContext)arg2);
	GLX_NATIVE_EXIT(env, that, _1glXMakeCurrent_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXQueryExtension
JNIEXPORT jboolean JNICALL GLX_NATIVE(_1glXQueryExtension)
	(JNIEnv *env, jclass that, jint arg0, jintArray arg1, jintArray arg2)
{
	jint *lparg1=NULL;
	jint *lparg2=NULL;
	jboolean rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXQueryExtension_FUNC);
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
	rc = (jboolean)glXQueryExtension((Display *)arg0, lparg1, lparg2);
fail:
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
	GLX_NATIVE_EXIT(env, that, _1glXQueryExtension_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXQueryExtensionsString
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXQueryExtensionsString)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXQueryExtensionsString_FUNC);
	rc = (jint)glXQueryExtensionsString((Display *)arg0, arg1);
	GLX_NATIVE_EXIT(env, that, _1glXQueryExtensionsString_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXQueryServerString
JNIEXPORT jint JNICALL GLX_NATIVE(_1glXQueryServerString)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
{
	jint rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXQueryServerString_FUNC);
	rc = (jint)glXQueryServerString((Display *)arg0, arg1, arg2);
	GLX_NATIVE_EXIT(env, that, _1glXQueryServerString_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXQueryVersion
JNIEXPORT jboolean JNICALL GLX_NATIVE(_1glXQueryVersion)
	(JNIEnv *env, jclass that, jint arg0, jintArray arg1, jintArray arg2)
{
	jint *lparg1=NULL;
	jint *lparg2=NULL;
	jboolean rc = 0;
	GLX_NATIVE_ENTER(env, that, _1glXQueryVersion_FUNC);
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
	rc = (jboolean)glXQueryVersion((Display *)arg0, lparg1, lparg2);
fail:
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
	GLX_NATIVE_EXIT(env, that, _1glXQueryVersion_FUNC);
	return rc;
}
#endif

#ifndef NO__1glXSwapBuffers
JNIEXPORT void JNICALL GLX_NATIVE(_1glXSwapBuffers)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	GLX_NATIVE_ENTER(env, that, _1glXSwapBuffers_FUNC);
	glXSwapBuffers((Display *)arg0, (GLXDrawable)arg1);
	GLX_NATIVE_EXIT(env, that, _1glXSwapBuffers_FUNC);
}
#endif

#ifndef NO__1glXWaitGL
JNIEXPORT void JNICALL GLX_NATIVE(_1glXWaitGL)
	(JNIEnv *env, jclass that)
{
	GLX_NATIVE_ENTER(env, that, _1glXWaitGL_FUNC);
	glXWaitGL();
	GLX_NATIVE_EXIT(env, that, _1glXWaitGL_FUNC);
}
#endif

#ifndef NO__1glXWaitX
JNIEXPORT void JNICALL GLX_NATIVE(_1glXWaitX)
	(JNIEnv *env, jclass that)
{
	GLX_NATIVE_ENTER(env, that, _1glXWaitX_FUNC);
	glXWaitX();
	GLX_NATIVE_EXIT(env, that, _1glXWaitX_FUNC);
}
#endif

#ifndef NO_memmove
JNIEXPORT void JNICALL GLX_NATIVE(memmove)
	(JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
{
	XVisualInfo _arg0, *lparg0=NULL;
	GLX_NATIVE_ENTER(env, that, memmove_FUNC);
	if (arg0) if ((lparg0 = getXVisualInfoFields(env, arg0, &_arg0)) == NULL) goto fail;
	memmove(lparg0, (const void *)arg1, (size_t)arg2);
fail:
	if (arg0 && lparg0) setXVisualInfoFields(env, arg0, lparg0);
	GLX_NATIVE_EXIT(env, that, memmove_FUNC);
}
#endif