-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSharedFunctions.h
51 lines (40 loc) · 1.32 KB
/
SharedFunctions.h
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
#ifndef _SHARED_FUNCTIONS_H
#define _SHARED_FUNCTIONS_H
#include <GL/gl.h>
#include "Shared.h"
/**********************************************************************/
//void rotate(int angle, int axis){return;}
void getmatrix(float* mat){glGetFloatv(GL_MODELVIEW_MATRIX, mat);}
/**********************************************************************/
//int getbutton(unsigned char key){ /* returns that keybit was set */
// if(CLAW & (1<<key)){ CLAW &= (-1 ^ (1 << key)); return 1;}
// else return 0; /* and if it was, unsets it */ /* gkf 23jul2K */
//}
void rectcopy(int x1, int y1, int x2, int y2, int newx, int newy){
glCopyPixels( x1, y1, x2-x1, y2-y1, GL_COLOR);
}
void cpack(long hexad){
float red, green, blue;
red = (hexad & 255)/255.;
green = ((hexad >> 8) & 255)/255.;
blue = ((hexad >> 16)& 255)/255.;
glColor3f(red,green,blue);
}
//Pelsmajer changed int to float Jan13-05
void rot(float degrees, char axis)
{
if(axis == 'x')
glRotatef(degrees, 1.,0.,0.);
else if(axis == 'y')
glRotatef(degrees, 0.,1.,0.);
else if(axis == 'z')
glRotatef(degrees, 0.,0.,1.);
}
void lrectwrite(int x1, int y1, int x2, int y2, unsigned long* offbase){
int pair[2];
pair[0]=x1;
pair[1]=y1;
glRasterPos2iv(pair) ;
glDrawPixels(x2-x1, y2-y1, GL_RGB, GL_UNSIGNED_INT, offbase);
}
#endif