aboutsummaryrefslogtreecommitdiffstats
path: root/CNativeCode/glxtool.h
blob: 03e28a5ad1efca0af19c806df6e060cde4b158e9 (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
#ifndef _GLXTOOL_H
	/**
	 * glxtool.h
	 *
	 * Copyright (C) 2001  Sven Goethel
	 *
	 * GNU Library General Public License 
	 * as published by the Free Software Foundation
	 *
	 * http://www.gnu.org/copyleft/lgpl.html
	 * General dynamical loading OpenGL (GL/GLU) support for:
	 */

	#define _GLXTOOL_H

    #include <X11/Xlib.h>
  	#include <X11/Xutil.h>
  	#include <X11/Xatom.h>
  
	#include "gltool.h"
	  
	#include "glx-disp-var.h"

	typedef struct {
		XVisualInfo * visual;
		GLXContext    gc;
		int           success;  /* 1: OK, 0: ERROR */
	} VisualGC;
  
	LIBAPI int LIBAPIENTRY get_GC
		( Display *display, Window win, XVisualInfo *visual,
		    GLXContext *gc, GLXContext gc_share,
		    int 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,
				       int * pOwnWin,
			               XSetWindowAttributes * pOwnWinAttr,
				       unsigned long ownWinmask,
				       GLXContext shareWith,
				       int offscreen,
				       Pixmap *pix,
				       int verbose
				     );

	LIBAPI XVisualInfo * LIBAPIENTRY findVisualIdByID
				( XVisualInfo ** visualList, 
					int visualID, Display *disp,
					Window win, int verbose);

	LIBAPI XVisualInfo * LIBAPIENTRY findVisualIdByFeature
					( XVisualInfo ** visualList, 
					     Display *disp, Window win,
					     GLCapabilities *glCaps,
					     int verbose);

	LIBAPI int LIBAPIENTRY testVisualInfo 
			( Display *display, XVisualInfo * vi, 
			     GLCapabilities *glCaps, int verbose);

	LIBAPI int LIBAPIENTRY setGLCapabilities 
				( Display * disp, 
				XVisualInfo * visual, GLCapabilities *glCaps);

	LIBAPI void LIBAPIENTRY printAllVisualInfo 
				( Display *disp, Window win, int verbose);
	LIBAPI void LIBAPIENTRY printVisualInfo 
				( Display *display, XVisualInfo * vi);

	LIBAPI Window LIBAPIENTRY createOwnOverlayWin
			          (Display *display, 
				   Window rootwini, Window parentWin,
			           XSetWindowAttributes * pOwnWinAttr,
				   unsigned long ownWinmask,
				   XVisualInfo *visual, int width, int height);

	LIBAPI void LIBAPIENTRY destroyOwnOverlayWin
				 (Display *display, Window *newWin,
				  XSetWindowAttributes * pOwnWinAttr);

	/**
	 * do not call this one directly,
	 * use fetch_GL_FUNCS (gltool.h) instead
	 */
	LIBAPI void LIBAPIENTRY fetch_GLX_FUNCS 
				(const char * libGLName, 
					 const char * libGLUName, int force);

	LIBAPI int LIBAPIENTRY x11gl_myErrorHandler(
				  Display *pDisp, XErrorEvent *p_error);

	LIBAPI int LIBAPIENTRY x11gl_myIOErrorHandler(Display *pDisp);

#endif