summaryrefslogtreecommitdiff
path: root/FL/gl2opengl.h
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1998-10-06 18:21:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1998-10-06 18:21:25 +0000
commitf9039b2ae21988783feae9b362818e7923e82d14 (patch)
tree6d6fe3679d73448758f9794e7d4d4f6b22a4adad /FL/gl2opengl.h
parent67e89232f9ba067825a158734a09e0fa21aacbe3 (diff)
Initial revision
git-svn-id: file:///fltk/svn/fltk/trunk@2 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/gl2opengl.h')
-rw-r--r--FL/gl2opengl.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/FL/gl2opengl.h b/FL/gl2opengl.h
new file mode 100644
index 000000000..b89614e0f
--- /dev/null
+++ b/FL/gl2opengl.h
@@ -0,0 +1,35 @@
+/* gl.h
+
+ GL to OpenGL translator.
+ If you include this, you might be able to port old GL programs.
+ There are also much better emulators available on the net.
+
+*/
+
+#include <FL/gl.h>
+#include "gl_draw.H"
+
+inline void clear() {glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);}
+#define RGBcolor(r,g,b) glColor3ub(r,g,b)
+#define bgnline() glBegin(GL_LINE_STRIP)
+#define bgnpolygon() glBegin(GL_POLYGON)
+#define bgnclosedline() glBegin(GL_LINE_LOOP)
+#define endline() glEnd()
+#define endpolygon() glEnd()
+#define endclosedline() glEnd()
+#define v2f(v) glVertex2fv(v)
+#define v2s(v) glVertex2sv(v)
+#define cmov(x,y,z) glRasterPos3f(x,y,z)
+#define charstr(s) gl_draw(s)
+#define fmprstr(s) gl_draw(s)
+typedef float Matrix[4][4];
+inline void pushmatrix() {glPushMatrix();}
+inline void popmatrix() {glPopMatrix();}
+inline void multmatrix(Matrix m) {glMultMatrixf((float *)m);}
+inline void color(int n) {glIndexi(n);}
+inline void rect(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
+inline void rectf(int x,int y,int r,int t) {glRectf(x,y,r+1,t+1);}
+inline void recti(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
+inline void rectfi(int x,int y,int r,int t) {glRecti(x,y,r+1,t+1);}
+inline void rects(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
+inline void rectfs(int x,int y,int r,int t) {glRects(x,y,r+1,t+1);}