| GL Studio C++ Runtime API

gls_gl.h
Go to the documentation of this file.
1/*! \file
2 \brief The gls_gl.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38
39*/
40#ifndef _GLS_GL_H
41#define _GLS_GL_H
42
43#ifdef WIN32
44# include <windows.h>
45#endif
46
47#ifdef GLES
48
49# ifdef GLES20 // OpenGL ES2.0
50# ifdef __APPLE__
51# ifdef GLES_ANGLE
52# include <GLES2/gl2.h>
53# include <GLES2/gl2ext.h>
54# else
55# include <OpenGLES/ES2/gl.h>
56# include <OpenGLES/ES2/glext.h>
57# endif
58# else
59# include <GLES2/gl2.h>
60# include <GLES2/gl2ext.h>
61# endif
62# else // OpenGL ES1.1
63# ifdef __APPLE__
64# include <OpenGLES/ES1/gl.h>
65# include <OpenGLES/ES1/glext.h>
66# define GL_UNSIGNED_INT GL_UNSIGNED_INT_OES
67# else
68# include <GLES/gl.h>
69# include <GLES/glext.h>
70# endif
71# endif
72
73# ifndef GL_UNSIGNED_INT
74/// Hack for ES driver that doesn't define GL_UNSIGNED_INT
75# define GL_UNSIGNED_INT 0x1405
76# endif
77
78# ifndef GLchar
79/// Hack for imx.53 board which does not define GLchar in gl2.h or gl2ext.h
80# define GLchar char
81# endif
82
83#else // Standard OpenGL
84# ifdef __APPLE__
85# include <OpenGL/gl.h>
86# else
87# include <GL/gl.h>
88# endif
89#endif
90
91#include "gls_include.h"
92
93#ifndef GLES
94// To use these debugging methods, add #define GLS_GL_DEBUGGING here.
95
96 namespace disti
97{
98# ifdef GLS_GL_DEBUGGING
99/**** alias OpenGL routines for debug library */
100 GLS_EXPORT void glColor3f( GLfloat red, GLfloat green, GLfloat blue );
101 GLS_EXPORT void glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
102 GLS_EXPORT void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
103 GLS_EXPORT void glColor4ubv( const GLubyte* v );
104 GLS_EXPORT void glNormal3fv( const GLfloat* v );
105 GLS_EXPORT void glShadeModel( GLenum mode );
106 GLS_EXPORT void glMaterialf( GLenum face, GLenum pname, GLfloat param );
107 GLS_EXPORT void glMaterialfv( GLenum face, GLenum pname, const GLfloat* params );
108
109 GLS_EXPORT void glAlphaFunc( GLenum func, GLclampf ref );
110 GLS_EXPORT void glDepthMask( GLboolean flag );
111 GLS_EXPORT void glDepthFunc( GLenum func );
112 GLS_EXPORT void glBlendFunc( GLenum sfactor, GLenum dfactor );
113
114 GLS_EXPORT void glLineWidth( GLfloat width );
115 GLS_EXPORT void glPolygonMode( GLenum face, GLenum mode );
116 GLS_EXPORT void glLineStipple( GLint factor, GLushort pattern );
117
118 GLS_EXPORT void glGetFloatv( GLenum pname, GLfloat* params );
119 GLS_EXPORT void glGetIntegerv( GLenum pname, GLint* params );
120
121 GLS_EXPORT void glEnable( GLenum cap );
122 GLS_EXPORT void glDisable( GLenum cap );
123
124 GLS_EXPORT void glBegin( GLenum mode );
125 GLS_EXPORT void glEnd();
126 GLS_EXPORT void glVertex2f( GLfloat x, GLfloat y );
127 GLS_EXPORT void glVertex3f( GLfloat x, GLfloat y, GLfloat z );
128 GLS_EXPORT void glVertex3fv( const GLfloat* v );
129 GLS_EXPORT void glPolygonOffset( GLfloat factor, GLfloat units );
130
131 GLS_EXPORT void glTexParameteri( GLenum target, GLenum pname, GLint param );
132 GLS_EXPORT void glTexParameterf( GLenum target, GLenum pname, GLfloat param );
133 GLS_EXPORT void glTexEnvf( GLenum target, GLenum pname, GLfloat param );
134 GLS_EXPORT void glTexEnvfv( GLenum target, GLenum pname, const GLfloat* params );
135 GLS_EXPORT void glTexEnvi( GLenum target, GLenum pname, GLint param );
136 GLS_EXPORT void glTexCoord2f( GLfloat s, GLfloat t );
137 GLS_EXPORT void glTexCoord2fv( const GLfloat* v );
138 GLS_EXPORT void glBindTexture( GLenum target, GLuint texture );
139
140 GLS_EXPORT void glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
141 GLS_EXPORT void glTranslatef( GLfloat x, GLfloat y, GLfloat z );
142 GLS_EXPORT void glScalef( GLfloat x, GLfloat y, GLfloat z );
143 GLS_EXPORT void glLoadIdentity();
144 GLS_EXPORT void glMatrixMode( GLenum mode );
145 GLS_EXPORT void glLoadMatrixf( const GLfloat* m );
146 GLS_EXPORT void glPushMatrix();
147 GLS_EXPORT void glPopMatrix();
148 GLS_EXPORT void glMultMatrixf( const GLfloat* m );
149 GLS_EXPORT void glMultMatrixd( const GLdouble* m );
150 GLS_EXPORT void glLightfv( GLenum light, GLenum pname, const GLfloat* params );
151 GLS_EXPORT void glLightiv( GLenum light, GLenum pname, const GLint* params );
152 GLS_EXPORT void glLighti( GLenum light, GLenum pname, GLint param );
153 GLS_EXPORT void glLightf( GLenum light, GLenum pname, GLfloat param );
154
155 GLS_EXPORT void glViewport( GLint x, GLint y, GLsizei width, GLsizei height );
156
157 GLS_EXPORT void glPixelStorei( GLenum pname, GLint param );
158 GLS_EXPORT void glTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels );
159 GLS_EXPORT void glDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* data );
160 GLS_EXPORT void glRasterPos2d( GLdouble x, GLdouble y );
161 GLS_EXPORT void glGenTextures( GLsizei n, GLuint* textures );
162 GLS_EXPORT void glTexImage2D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* data );
163 GLS_EXPORT void glDeleteTextures( GLsizei n, const GLuint* textures );
164 GLS_EXPORT GLboolean glIsTexture( GLuint texture );
165 GLS_EXPORT GLuint glGenLists( GLsizei range );
166 GLS_EXPORT void glNewList( GLuint list, GLenum mode );
167 GLS_EXPORT void glEndList();
168 GLS_EXPORT void glCallList( GLuint list );
169
170// Call this if an OpenGL error may have been set, but you want the strict checking to ignore it.
171// This will temporarily disable strict checking, print out any errors, then enable strict checking again.
172 GLS_EXPORT void StrictOpenGLChecking_ClearErrors( const char* label );
173
174// Checks for OpenGL errors and throws a disti assertion when found. Input variable label is string to notify where
175// error occured.
176 GLS_EXPORT void CheckOpenGLErrors( const char* label );
177# endif // GLS_GL_DEBUGGING
178} // end namespace disti
179#endif // !GLES
180
181#endif // _GLS_GL_H
gls_include.h
A file for all GL Studio files to include.
GLS_EXPORT
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:52
disti
Definition: bmpimage.h:47