-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglpp.cpp
More file actions
63 lines (50 loc) · 1.44 KB
/
glpp.cpp
File metadata and controls
63 lines (50 loc) · 1.44 KB
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
#include "glpp.h"
namespace glpp
{
#define COLOR_FUNC4( type, t ) \
void color( GL##type r, GL##type g, GL##type, GL##type b, GL##type a ) \
{ \
glColor4##t( r, g, b, a ); \
}
COLOR_FUNC4( short, s );
COLOR_FUNC4( int, i );
COLOR_FUNC4( float, f );
COLOR_FUNC4( double, d );
#undef COLOR_FUNC4
void enableClientState( GLenum cap )
{
glEnableClientState( cap );
}
void drawArrays( GLenum mode, GLint first, GLsizei count )
{
glDrawArrays( mode, first, count );
}
void disableClientState( GLenum cap )
{
glDisableClientState( cap );
}
void loadIdentity()
{
glLoadIdentity();
}
void translate( GLfloat x, GLfloat y, GLfloat z ) { glTranslatef(x,y,z); }
void translate( GLdouble x, GLdouble y, GLdouble z ) { glTranslated(x,y,z); }
#define VERTEX_FUNC2( type, t ) \
void vertex( GL##type x, GL##type y ) { glVertex2##t( x, y ); }
VERTEX_FUNC2( float, f );
#undef VERTEX_FUNC2
#define VERTEX_FUNC3( type, t ) \
void vertex( GL##type x, GL##type y, GL##type z ) { glVertex3##t( x, y, z ); }
VERTEX_FUNC3( float, f );
#undef VERTEX_FUNC3
void vertex( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
glVertex4f( x, y, z, w );
}
#define VERTEX_FUNCV( type, t, N ) \
void vertex( GL##type (&v)[N] ) { glVertex##N##t##v( v ); }
VERTEX_FUNCV( float, f, 2 );
VERTEX_FUNCV( float, f, 3 );
VERTEX_FUNCV( float, f, 4 );
#undef VERTEX_FUNCV
} // namespace glpp