-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgluvvPrimitive.cpp
164 lines (141 loc) · 3.84 KB
/
gluvvPrimitive.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
//------------------------------------------------------------------------
//
// Joe Kniss
// A glut implementation of the Volume Renderer
// gluvvPrimitive.cpp virual class for rendering and widgets
// 3-4-01
// ________ ____ ___
// | \ / | / /
// +---+ \/ |/ /
// +--+| |\ /| <
// | || | \ / | |\ \
// | | \/ | | \ \
// \_____| |__| \__\
// Copyright 2001
// Joe Michael Kniss
// "All Your Base are Belong to Us"
//-------------------------------------------------------------------------
#include <string.h>
#include "gluvvPrimitive.h"
#ifdef WIN32
#include <windows.h> // must be included before any OpenGL
#endif
#include <GL/glu.h>
#include <iostream.h>
//========================================== gluvvPrimitive
//=========================================================
gluvvPrimitive::gluvvPrimitive()
{
next = 0;
name = 0;
}
//========================================= ~gluvvPrimitive
//=========================================================
gluvvPrimitive::~gluvvPrimitive()
{
}
//========================================= init
//==============================================
void gluvvPrimitive::init()
{
}
//========================================= draw
//==============================================
void gluvvPrimitive::draw()
{
}
//========================================= key
//=============================================
int gluvvPrimitive::key(unsigned char k, int x, int y)
{
return 0;
}
int gluvvPrimitive::special(int k, int x, int y)
{
return 0;
}
//============================================ pick
//=================================================
int gluvvPrimitive::pick(int data1, int data2, int data3,
float x, float y, float z)
{
return 1;
}
int gluvvPrimitive::pick()
{
return 1;
}
//=========================================== mouse
//=================================================
int gluvvPrimitive::mouse(int button, int state,
int x, int y)
{
return 1;
}
//============================================ move
//=================================================
int gluvvPrimitive::move(int x, int y)
{
return 1;
}
//========================================= release
//=================================================
int gluvvPrimitive::release()
{
return 0;
}
//========================================= setNext
//=================================================
void gluvvPrimitive::setNext(gluvvPrimitive *p)
{
p->next = next;
next = p;
}
//========================================= getNext
//=================================================
gluvvPrimitive *gluvvPrimitive::getNext()
{
return next;
}
//========================================= remove
//================================================
void gluvvPrimitive::remove(gluvvPrimitive *p)
{
if(next == p)
next = p->next;
else
next->remove(p);
}
//========================================= setName
//=================================================
void gluvvPrimitive::setName(const char *PName)
{
name = strdup(PName);
}
//======================================== pushName
//=================================================
void gluvvPrimitive::gluvvPushName()
{
#if (_MIPS_SZPTR == 64) //64 Bit
unsigned long o;
o=(unsigned long)this;
unsigned int o1=(o>>32)&0xffffffff;
unsigned int o2=o&0xffffffff;
glPushName(o1);
glPushName(o2);
#else //32 bit
glPushName((GLuint)this);
#endif
}
//======================================== popNames
//=================================================
void gluvvPrimitive::gluvvPopNames()
{
#if (_MIPS_SZPTR == 64) //64 Bit
glPopName();
#endif
glPopName();
glPopName();
glPopName();
glPopName();
}