aboutsummaryrefslogtreecommitdiffstats
path: root/CNativeCode/OpenGL_X11_common.h
blob: 1bb39c4dda73f272feef26a584703eea8059411b (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
#ifndef _OPENGL_X11_COMMON_
#define _OPENGL_X11_COMMON_

  /* 
   * need to include the JAVA internal header files for macros and function
   * prototypes required to maipulated JAVA data structures and functions
   *
   * StubPreamble.h includes the structure and macro definitions neede to
   * convert JAVA data structures into C data structures.
   *
   */
  
  #include "OpenGL_misc.h"

  #include <X11/Xlib.h>
  #include <X11/Xutil.h>
  
  #include <GL/glx.h>
  #include <X11/Xatom.h>
  
  typedef struct {
  	XVisualInfo * visual;
        GLXContext    gc;
  	int           success;  /* 1: OK, 0: ERROR */
  } VisualGC;
  

  /*
   * prototypes for functions local to this file scope
   */
  LIBAPI int LIBAPIENTRY get_GC( Display *display, Window win, 
  			         XVisualInfo *visual,
                                 GLXContext *gc, GLXContext gc_share,
				 jboolean verbose );
  
  LIBAPI int LIBAPIENTRY setVisualAttribListByGLCapabilities( 
					int visualAttribList[/*>=32*/],
				        GLCapabilities *glCaps );

  LIBAPI VisualGC LIBAPIENTRY findVisualGlX( Display *display, 
			       Window rootWin,
			       Window * pWin, 
			       int width, int height,
    			       GLCapabilities *glCaps,
			       jboolean * pOwnWin,
			       GLXContext shareWith,
			       jboolean offscreen,
			       Pixmap *pix,
			       jboolean verbose
			     );
  
  LIBAPI void LIBAPIENTRY printVisualInfo ( Display *display, XVisualInfo * vi);
  LIBAPI void LIBAPIENTRY printAllVisualInfo ( Display *disp, Window win, 
  					       jboolean verbose);
  
  LIBAPI int LIBAPIENTRY testVisualInfo ( Display *display, XVisualInfo * vi, 
    			                  GLCapabilities *glCaps);
  
  LIBAPI XVisualInfo * LIBAPIENTRY findVisualIdByID( XVisualInfo ** visualList, 
					    int visualID, Display *disp,
					    Window win, jboolean verbose);

  LIBAPI XVisualInfo * LIBAPIENTRY findVisualIdByFeature( 
  				  XVisualInfo ** visualList, 
                                  Display *disp, Window win,
				  GLCapabilities *glCaps,
				  jboolean verbose);
  
  /* testX11Java does important implementation plattformspecific checks:
   *
   * o do fit X11-Vars in jint (because GLFrame stores 'em like that)
   */
  LIBAPI jboolean LIBAPIENTRY testX11Java();
  
  LIBAPI jboolean LIBAPIENTRY setGLCapabilities ( Display * disp, 
                                 XVisualInfo * visual, GLCapabilities *glCaps);

  LIBAPI int LIBAPIENTRY x11gl_myErrorHandler(
  				  Display *pDisp, XErrorEvent *p_error);
  
  LIBAPI int LIBAPIENTRY x11gl_myIOErrorHandler(Display *pDisp);
  
  LIBAPI Window LIBAPIENTRY createOwnOverlayWin(
  				  Display *display, 
  				  Window rootwini, Window parentWin,
                                  XVisualInfo *visual, int width, int height);
  
#endif