-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShared.h
77 lines (52 loc) · 1.69 KB
/
Shared.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Greg Kaiser
//
// CS290 with Prof. Francis
// 4D Tetris
//
// Shared.h
// Last modified: May 8th, 2001 - Benjamin Bernard
//
// (C) 1996 Board of Trustees University of Illinois
#ifndef _SHARED_H_
#define _SHARED_H_
constexpr int VX = 0;
constexpr int VY = 1;
constexpr int VZ = 2;
constexpr int VW = 3;
//attempt to convert to OpenGL
#define BF_SA GL_SRC_ALPHA
#define BF_MSA GL_ONE_MINUS_SRC_ALPHA
#define pushmatrix() {glMatrixMode(GL_MODELVIEW); glPushMatrix();}
#define loadmatrix glLoadMatrixf
#define multmatrix glMultMatrixf
#define popmatrix glPopMatrix
#define bgntmesh() glBegin(GL_TRIANGLE_STRIP)
#define endtmesh glEnd
#define bgnpolygon() glBegin(GL_POLYGON)
#define endpolygon() glEnd
#define bgnline() glBegin(GL_LINE_STRIP);
#define endline glEnd
#define linewidth
#define depthcue
#define v3f glVertex3fv
#define v2f glVertex2fv
#define translate glTranslatef
#define viewport glViewport
#define window glFrustum
#define ortho glOrtho
#define ortho2(a,b,c,d) glOrtho(a,b,c,d,10.0,-10) /* ogl has no ortho2 ?? */
#define swapbuffers glutSwapBuffers
#define rectzoom glPixelZoom
#define blendfunction glBlendFunc
#define zbuffer(a) glEnable(GL_DEPTH_TEST)
#define doublebuffer ChoosePixelFormat
//#define clear() glClear(GL_COLOR_BUFFER_BIT) // has problems with clear in the iostream library
#define zclear() glCear(GL_DEPTH_BUFFER_BIT)
#include <glut.h>
// #include <GL/gl.h>
void getmatrix(float* mat);
void rectcopy(int x1, int y1, int x2, int y2, int newx, int newy);
void cpack(long hexad);
void rot(float degrees, char axis);
void lrectwrite(int x1, int y1, int x2, int y2, unsigned long* offbase);
#endif