]> gitweb.factorcode.org Git - factor.git/blob - core/ui/x11/glx.factor
c1117a12ab50394855006befb08256af432ec0a7
[factor.git] / core / ui / x11 / glx.factor
1 ! Copyright (C) 2005, 2006 Eduardo Cavazos and Alex Chapman
2 ! See http://factorcode.org/license.txt for BSD license.
3 !
4 ! based on glx.h from xfree86, and some of glxtokens.h
5 IN: x11
6 USING: alien ;
7
8 LIBRARY: glx
9
10 ! Visual Config Attributes (glXGetConfig, glXGetFBConfigAttrib)
11 : GLX_USE_GL            1  ; ! support GLX rendering
12 : GLX_BUFFER_SIZE       2  ; ! depth of the color buffer
13 : GLX_LEVEL             3  ; ! level in plane stacking
14 : GLX_RGBA              4  ; ! true if RGBA mode
15 : GLX_DOUBLEBUFFER      5  ; ! double buffering supported
16 : GLX_STEREO            6  ; ! stereo buffering supported
17 : GLX_AUX_BUFFERS       7  ; ! number of aux buffers
18 : GLX_RED_SIZE          8  ; ! number of red component bits
19 : GLX_GREEN_SIZE        9  ; ! number of green component bits
20 : GLX_BLUE_SIZE         10 ; ! number of blue component bits
21 : GLX_ALPHA_SIZE        11 ; ! number of alpha component bits
22 : GLX_DEPTH_SIZE        12 ; ! number of depth bits
23 : GLX_STENCIL_SIZE      13 ; ! number of stencil bits
24 : GLX_ACCUM_RED_SIZE    14 ; ! number of red accum bits
25 : GLX_ACCUM_GREEN_SIZE  15 ; ! number of green accum bits
26 : GLX_ACCUM_BLUE_SIZE   16 ; ! number of blue accum bits
27 : GLX_ACCUM_ALPHA_SIZE  17 ; ! number of alpha accum bits
28
29 TYPEDEF: XID GLXContextID
30 TYPEDEF: XID GLXPixmap
31 TYPEDEF: XID GLXDrawable
32 TYPEDEF: XID GLXPbuffer
33 TYPEDEF: XID GLXWindow
34 TYPEDEF: XID GLXFBConfigID
35 TYPEDEF: void* GLXContext  ! typedef struct __GLXcontextRec *GLXContext;
36 TYPEDEF: void* GLXFBConfig ! typedef struct __GLXFBConfigRec *GLXFBConfig;
37
38 FUNCTION: XVisualInfo* glXChooseVisual ( Display* dpy, int screen, int* attribList ) ;
39 FUNCTION: void glXCopyContext ( Display* dpy, GLXContext src, GLXContext dst, ulong mask ) ;
40 FUNCTION: GLXContext glXCreateContext ( Display* dpy, XVisualInfo* vis, GLXContext shareList, bool direct ) ;
41 FUNCTION: GLXPixmap glXCreateGLXPixmap ( Display* dpy, XVisualInfo* vis, Pixmap pixmap ) ;
42 FUNCTION: void glXDestroyContext ( Display* dpy, GLXContext ctx ) ;
43 FUNCTION: void glXDestroyGLXPixmap ( Display* dpy, GLXPixmap pix ) ;
44 FUNCTION: int glXGetConfig ( Display* dpy, XVisualInfo* vis, int attrib, int* value) ;
45 FUNCTION: GLXContext glXGetCurrentContext ( ) ;
46 FUNCTION: GLXDrawable glXGetCurrentDrawable ( ) ;
47 FUNCTION: bool glXIsDirect ( Display* dpy, GLXContext ctx ) ;
48 FUNCTION: bool glXMakeCurrent ( Display* dpy, GLXDrawable drawable, GLXContext ctx ) ;
49 FUNCTION: bool glXQueryExtension ( Display* dpy, int* errorBase, int* eventBase ) ;
50 FUNCTION: bool glXQueryVersion ( Display* dpy, int* major, int* minor ) ;
51 FUNCTION: void glXSwapBuffers ( Display* dpy, GLXDrawable drawable ) ;
52 FUNCTION: void glXUseXFont ( Font font, int first, int count, int listBase ) ;
53 FUNCTION: void glXWaitGL ( ) ;
54 FUNCTION: void glXWaitX ( ) ;
55 FUNCTION: char* glXGetClientString ( Display* dpy, int name ) ;
56 FUNCTION: char* glXQueryServerString ( Display* dpy, int screen, int name ) ;
57 FUNCTION: char* glXQueryExtensionsString ( Display* dpy, int screen ) ;
58
59 ! New for GLX 1.3
60 FUNCTION: GLXFBConfig* glXGetFBConfigs ( Display* dpy, int screen, int* nelements ) ;
61 FUNCTION: GLXFBConfig* glXChooseFBConfig ( Display* dpy, int screen, int* attrib_list, int* nelements ) ;
62 FUNCTION: int glXGetFBConfigAttrib ( Display* dpy, GLXFBConfig config, int attribute, int* value ) ;
63 FUNCTION: XVisualInfo* glXGetVisualFromFBConfig ( Display* dpy, GLXFBConfig config ) ;
64 FUNCTION: GLXWindow glXCreateWindow ( Display* dpy, GLXFBConfig config, Window win, int* attrib_list ) ;
65 FUNCTION: void glXDestroyWindow ( Display* dpy, GLXWindow win ) ;
66 FUNCTION: GLXPixmap glXCreatePixmap ( Display* dpy, GLXFBConfig config, Pixmap pixmap, int* attrib_list ) ;
67 FUNCTION: void glXDestroyPixmap ( Display* dpy, GLXPixmap pixmap ) ;
68 FUNCTION: GLXPbuffer glXCreatePbuffer ( Display* dpy, GLXFBConfig config, int* attrib_list ) ;
69 FUNCTION: void glXDestroyPbuffer ( Display* dpy, GLXPbuffer pbuf ) ;
70 FUNCTION: void glXQueryDrawable ( Display* dpy, GLXDrawable draw, int attribute, uint* value ) ;
71 FUNCTION: GLXContext glXCreateNewContext ( Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, bool direct ) ;
72 FUNCTION: bool glXMakeContextCurrent ( Display* display, GLXDrawable draw, GLXDrawable read, GLXContext ctx ) ;
73 FUNCTION: GLXDrawable glXGetCurrentReadDrawable ( ) ;
74 FUNCTION: Display*  glXGetCurrentDisplay ( ) ;
75 FUNCTION: int glXQueryContext ( Display* dpy, GLXContext ctx, int attribute, int* value ) ;
76 FUNCTION: void glXSelectEvent ( Display* dpy, GLXDrawable draw, ulong event_mask ) ;
77 FUNCTION: void glXGetSelectedEvent ( Display* dpy, GLXDrawable draw, ulong* event_mask ) ;
78
79 ! GLX 1.4 and later
80 ! extern void (*glXGetProcAddress(const GLubyte* procname))(void ) ;
81
82 ! glxext stuff skipped
83
84
85 ! GLX Events
86 ! (also skipped for now. only has GLXPbufferClobberEvent, the rest is handled by xlib methinks
87