aboutsummaryrefslogtreecommitdiffstats
path: root/CNativeCode/OpenGL_misc.h
blob: 1438877605f2db529b3dcf43a3048992dfb5202d (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

#ifndef OPENGLMISC
	#define OPENGLMISC

	#include <stdio.h>
	#include <stdlib.h>
	#include <stdarg.h>

	#ifdef _WIN32_
		#include "winstuff.h"
	#endif

	#include <jni.h>

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

	#ifndef LIBAPIENTRY
		#define LIBAPIENTRY
	#endif
	#ifndef LIBAPI
		#define LIBAPI
	#endif

	#ifndef USE_64BIT_POINTER
		typedef int  PointerHolder;
	#else
		typedef long PointerHolder;
	#endif

	  /* to match the GLCapabilities values .. */

	  #define BUFFER_SINGLE 0
	  #define BUFFER_DOUBLE 1
	 
	  #define COLOR_INDEX 0
	  #define COLOR_RGBA  1
	  
	  #define STEREO_OFF 0
	  #define STEREO_ON  1

	  typedef struct {
		  jint buffer;
		  jint color;
		  jint stereo;
		  jint depthBits;
		  jint stencilBits;

		  jint redBits;
		  jint greenBits;
		  jint blueBits;
		  jint alphaBits;
		  jint accumRedBits;
		  jint accumGreenBits;
		  jint accumBlueBits;
		  jint accumAlphaBits;

		  jlong nativeVisualID;
	  } GLCapabilities;
		
	/**
	 * gets the capabilities outta java's GLCapabilities object 'capsObj'
	 * and puts those values to the C-Struct GLCapabilities !
	 */
	LIBAPI jboolean LIBAPIENTRY javaGLCapabilities2NativeGLCapabilities 
						     ( JNIEnv *env, 
						       jobject capsObj, 
						       GLCapabilities *glCaps );

	/**
	 * gets the capabilities outta the C-Struct GLCapabilities
	 * and puts those values to java's GLCapabilities object 'capsObj'
	 */
	LIBAPI jboolean LIBAPIENTRY nativeGLCapabilities2JavaGLCapabilities 
						     ( JNIEnv *env, 
						       jobject capsObj, 
						       GLCapabilities *glCaps );

		
	/**
	 * prints the contents of the GLCapabilities to stdout !
	 */
	LIBAPI void LIBAPIENTRY printGLCapabilities ( GLCapabilities *glCaps );

	/* testJavaGLTypes does important implementation plattformspecific checks:
	 *
	 * o do fit the JNI <-> GL Variables-Type Mapping 
	 * o IF ERROR OR VERBOSE -> DUMP JNI,GL Type-Length
	 */
	LIBAPI jboolean LIBAPIENTRY testJavaGLTypes(jboolean verbose);
	  
	LIBAPI void * LIBAPIENTRY getGLProcAddressHelper
				         (const char * func, int * method,
					  int debug, int verbose );
#endif