You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.3KB

  1. /* gl.h
  2. GL to OpenGL translator.
  3. If you include this, you might be able to port old GL programs.
  4. There are also much better emulators available on the net.
  5. */
  6. #include <FL/gl.h>
  7. #include "gl_draw.H"
  8. inline void clear() {glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);}
  9. #define RGBcolor(r,g,b) glColor3ub(r,g,b)
  10. #define bgnline() glBegin(GL_LINE_STRIP)
  11. #define bgnpolygon() glBegin(GL_POLYGON)
  12. #define bgnclosedline() glBegin(GL_LINE_LOOP)
  13. #define endline() glEnd()
  14. #define endpolygon() glEnd()
  15. #define endclosedline() glEnd()
  16. #define v2f(v) glVertex2fv(v)
  17. #define v2s(v) glVertex2sv(v)
  18. #define cmov(x,y,z) glRasterPos3f(x,y,z)
  19. #define charstr(s) gl_draw(s)
  20. #define fmprstr(s) gl_draw(s)
  21. typedef float Matrix[4][4];
  22. inline void pushmatrix() {glPushMatrix();}
  23. inline void popmatrix() {glPopMatrix();}
  24. inline void multmatrix(Matrix m) {glMultMatrixf((float *)m);}
  25. inline void color(int n) {glIndexi(n);}
  26. inline void rect(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
  27. inline void rectf(int x,int y,int r,int t) {glRectf(x,y,r+1,t+1);}
  28. inline void recti(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
  29. inline void rectfi(int x,int y,int r,int t) {glRecti(x,y,r+1,t+1);}
  30. inline void rects(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
  31. inline void rectfs(int x,int y,int r,int t) {glRects(x,y,r+1,t+1);}