-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsampleRenderer.cpp
76 lines (63 loc) · 1.73 KB
/
sampleRenderer.cpp
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
64
65
66
67
68
69
70
71
72
73
74
75
76
// ________ ____ ___
// | \ / | / /
// +---+ \/ |/ /
// +--+| |\ /| <
// | || | \ / | |\ \
// | | \/ | | \ \
// \_____| |__| \__\
// Copyright 2001
// Joe Michael Kniss
// <<< [email protected] >>>
// "All Your Base are Belong to Us"
//
// sampleRenderer.cpp: implementation of the sampleRenderer class.
//
//////////////////////////////////////////////////////////////////////
#include "sampleRenderer.h"
#include "glUE.h"
#include "VectorMath.h"
#include <iostream.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
sampleRenderer::sampleRenderer()
{
}
sampleRenderer::~sampleRenderer()
{
}
void sampleRenderer::draw()
{
glPushMatrix();{
//build transfor from global transform state
glTranslatef(gluvv.rinfo.trans[0],
gluvv.rinfo.trans[1],
gluvv.rinfo.trans[2]);
glMultMatrixf(gluvv.rinfo.xform);
float scale[16];
identityMatrix(scale);
scale[0] = gluvv.rinfo.scale;
scale[5] = gluvv.rinfo.scale;
scale[10] = gluvv.rinfo.scale;
glMultMatrixf(scale);
//now draw some stuff, just to make sure it works
glColor4f(1,1,1,1);
glBegin(GL_QUADS);
{
glVertex3f(-.5, -.5, 0);
glVertex3f(-.5, .5 , 0);
glVertex3f(.5 , .5 , 0);
glVertex3f(.5 , -.5, 0);
}
glEnd();
glColor4f(1,0,0,1);
glBegin(GL_TRIANGLES);
{
glVertex3f(0,0,.5);
glVertex3f(1,0,.5);
glVertex3f(1,1,0);
}
glEnd();
}
glPopMatrix();
}