Hint added.
[AROS.git] / workbench / libs / gl / gla.h
blob332994502f0affa3921350f66525a5cce82d3c00
1 /*
2 Copyright 2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
7 #ifndef GLA_H
8 #define GLA_H
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
14 #include <intuition/intuition.h>
15 #include <GL/gl.h>
17 #ifndef UTILITY_TAGITEM_H
18 #include <utility/tagitem.h>
19 #endif
21 enum GLAError
23 GLA_OUT_OF_MEM = 1,
24 GLA_RASTPORT_TAG_MISSING,
25 GLA_SCREEN_TAG_MISSING,
26 GLA_WINDOW_TAG_MISSING
30 * This is the GLA context. This is an opaque pointer.
31 * All information is hidden away from user.
35 typedef APTR GLAContext;
38 * GLA Attribute tag ID's. These are used in the ti_Tag field of
39 * TagItem arrays passed to glACreateContext()
41 #define GLA_Dummy (TAG_USER + 32)
44 * Offsets from rastport layer dimensions.
45 * Typically GLA_Left = window->BorderLeft, GLA_Top = window->BorderTop
46 * Defaults: if rendering to non-GZZ window BorderLeft, BorderTop, in all other
47 * cases 0,0
49 #define GLA_Left (GLA_Dummy + 0x0002)
50 #define GLA_Right (GLA_Dummy + 0x0003)
51 #define GLA_Top (GLA_Dummy + 0x0004)
52 #define GLA_Bottom (GLA_Dummy + 0x0005)
55 * Size in pixel of requested drawing area. Used to calculate GLA_Right, GLA_Bottom
56 * if they are not passed. No defaults. Size of render area is calculated using:
57 * rastport layer width - left - right, rastport layer height - top - bottom
59 #define GLA_Width (GLA_Dummy + 0x0006)
60 #define GLA_Height (GLA_Dummy + 0x0007)
63 * Target to which rendering will be done. Currently always pass GLA_Window
65 #define GLA_Screen (GLA_Dummy + 0x0011)
66 #define GLA_Window (GLA_Dummy + 0x0012)
67 #define GLA_RastPort (GLA_Dummy + 0x0013)
70 * Following boolean flags are ignored and always considered GL_TRUE
72 #define GLA_DoubleBuf (GLA_Dummy + 0x0030)
73 #define GLA_RGBMode (GLA_Dummy + 0x0031)
74 #define GLA_AlphaFlag (GLA_Dummy + 0x0032)
76 /*
77 * GLA_NoDepth: don't allocate ZBuffer if GL_TRUE, default is GL_FALSE
78 * GLA_NoStencil: don't allocate StencilBuffer if GL_TRUE, default is GL_FALSE
79 * GLA_NoAccum: don't allocate AccumulationBuffer if GL_TRUE, default is GL_FALSE
81 #define GLA_NoDepth (GLA_Dummy + 0x0039)
82 #define GLA_NoStencil (GLA_Dummy + 0x003a)
83 #define GLA_NoAccum (GLA_Dummy + 0x003b)
86 * GLA API calls
89 typedef void (*GLAProc)();
91 GLAPI GLAContext GLAPIENTRY glACreateContextTags(Tag Tag1, ...);
92 GLAPI GLAContext GLAPIENTRY glACreateContext(struct TagItem *tagList);
93 GLAPI void GLAPIENTRY glADestroyContext(GLAContext ctx);
94 GLAPI void GLAPIENTRY glAMakeCurrent(GLAContext ctx);
95 GLAPI void GLAPIENTRY glASwapBuffers(GLAContext ctx);
96 GLAPI GLAProc GLAPIENTRY glAGetProcAddress(const GLubyte * procname);
97 GLAPI GLAContext GLAPIENTRY glAGetCurrentContext();
98 GLAPI void GLAPIENTRY glASetRast(GLAContext ctx, struct TagItem *tagList);
99 GLAPI void GLAPIENTRY glAGetConfig(GLAContext ctx, GLenum pname, GLint* params);
101 #ifdef __cplusplus
103 #endif
105 #endif /* GLA_H */