1 module iup.gl;
2 
3 import iup.iup: Ihandle;
4 
5 /* Attributes
6 ** To set the appropriate visual (pixel format) the following
7 ** attributes may be specified. Their values should be set
8 ** before the canvas is mapped to the scrren.
9 ** After mapping, changing their values has no effect.
10 */
11 /* IUP_SINGLE (defaut) or IUP_DOUBLE */
12 enum const(char) * IUP_BUFFER = "BUFFER";
13 /* IUP_NO (defaut) or IUP_YES */
14 enum const(char) * IUP_STEREO = "STEREO";
15 /* Number of bits if index mode */
16 enum const(char) * IUP_BUFFER_SIZE = "BUFFER_SIZE";
17 /* Number of red bits */
18 enum const(char) * IUP_RED_SIZE = "RED_SIZE";
19 /* Number of green bits */
20 enum const(char) * IUP_GREEN_SIZE = "GREEN_SIZE";
21 /* Number of blue bits */
22 enum const(char) * IUP_BLUE_SIZE = "BLUE_SIZE";
23 /* Number of alpha bits */
24 enum const(char) * IUP_ALPHA_SIZE = "ALPHA_SIZE";
25 /* Number of bits in depth buffer */
26 enum const(char) * IUP_DEPTH_SIZE = "DEPTH_SIZE";
27 /* Number of bits in stencil buffer */
28 enum const(char) * IUP_STENCIL_SIZE = "STENCIL_SIZE";
29 /* Number of red bits in accum. buffer */
30 enum const(char) * IUP_ACCUM_RED_SIZE = "ACCUM_RED_SIZE";
31 /* Number of green bits in accum. buffer */
32 enum const(char) * IUP_ACCUM_GREEN_SIZE = "ACCUM_GREEN_SIZE";
33 /* Number of blue bits in accum. buffer */
34 enum const(char) * IUP_ACCUM_BLUE_SIZE = "ACCUM_BLUE_SIZE";
35 /* Number of alpha bits in accum. buffer */
36 enum const(char) * IUP_ACCUM_ALPHA_SIZE = "ACCUM_ALPHA_SIZE";
37 
38 /* Attribute values */
39 
40 enum const(char) * IUP_DOUBLE = "DOUBLE";
41 
42 enum const(char) * IUP_SINGLE = "SINGLE";
43 
44 enum const(char) * IUP_INDEX = "INDEX";
45 
46 enum const(char) * IUP_RGBA = "RGBA";
47 
48 enum const(char) * IUP_YES = "YES";
49 
50 enum const(char) * IUP_NO = "NO";
51 
52 extern(C) {
53     void IupGLCanvasOpen();
54 
55     Ihandle *IupGLCanvas(const char *action);
56     Ihandle* IupGLBackgroundBox(Ihandle* child);
57 
58     void IupGLMakeCurrent(Ihandle* ih);
59     int IupGLIsCurrent(Ihandle* ih);
60     void IupGLSwapBuffers(Ihandle* ih);
61     void IupGLPalette(Ihandle* ih, int index, float r, float g, float b);
62     void IupGLUseFont(Ihandle* ih, int first, int count, int list_base);
63     void IupGLWait(int gl);
64 }