FLTK 1.4.0
Loading...
Searching...
No Matches
gl2opengl.h
1/* gl.h
2
3 GL to OpenGL translator.
4 If you include this, you might be able to port old GL programs.
5 There are also much better emulators available on the net.
6
7*/
8
9#ifndef _FL_gl2opengl_h_
10#define _FL_gl2opengl_h_
11
12#include <FL/gl.h>
13#include "gl_draw.H"
14
15inline void clear() {glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);}
16#define RGBcolor(r,g,b) glColor3ub(r,g,b)
17#define bgnline() glBegin(GL_LINE_STRIP)
18#define bgnpolygon() glBegin(GL_POLYGON)
19#define bgnclosedline() glBegin(GL_LINE_LOOP)
20#define endline() glEnd()
21#define endpolygon() glEnd()
22#define endclosedline() glEnd()
23#define v2f(v) glVertex2fv(v)
24#define v2s(v) glVertex2sv(v)
25#define cmov(x,y,z) glRasterPos3f(x,y,z)
26#define charstr(s) gl_draw(s)
27#define fmprstr(s) gl_draw(s)
28typedef float Matrix[4][4];
29inline void pushmatrix() {glPushMatrix();}
30inline void popmatrix() {glPopMatrix();}
31inline void multmatrix(Matrix m) {glMultMatrixf((float *)m);}
32inline void color(int n) {glIndexi(n);}
33inline void rect(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
34inline void rectf(int x,int y,int r,int t) {glRectf(x,y,r+1,t+1);}
35inline void recti(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
36inline void rectfi(int x,int y,int r,int t) {glRecti(x,y,r+1,t+1);}
37inline void rects(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
38inline void rectfs(int x,int y,int r,int t) {glRects(x,y,r+1,t+1);}
39
40#endif /* _FL_gl2opengl_h_ */
This file defines wrapper functions for OpenGL in FLTK.
void gl_rect(int x, int y, int w, int h)
Outlines the given rectangle with the current color.
Definition gl_draw.cxx:216