FLTK 1.3.8: gl2opengl.h Source File

FLTK 1.3.8

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#include <FL/gl.h>
10#include "gl_draw.H"
11
12inline void clear() {glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);}
13#define RGBcolor(r,g,b) glColor3ub(r,g,b)
14#define bgnline() glBegin(GL_LINE_STRIP)
15#define bgnpolygon() glBegin(GL_POLYGON)
16#define bgnclosedline() glBegin(GL_LINE_LOOP)
17#define endline() glEnd()
18#define endpolygon() glEnd()
19#define endclosedline() glEnd()
20#define v2f(v) glVertex2fv(v)
21#define v2s(v) glVertex2sv(v)
22#define cmov(x,y,z) glRasterPos3f(x,y,z)
23#define charstr(s) gl_draw(s)
24#define fmprstr(s) gl_draw(s)
25typedef float Matrix[4][4];
26inline void pushmatrix() {glPushMatrix();}
27inline void popmatrix() {glPopMatrix();}
28inline void multmatrix(Matrix m) {glMultMatrixf((float *)m);}
29inline void color(int n) {glIndexi(n);}
30inline void rect(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
31inline void rectf(int x,int y,int r,int t) {glRectf(x,y,r+1,t+1);}
32inline void recti(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
33inline void rectfi(int x,int y,int r,int t) {glRecti(x,y,r+1,t+1);}
34inline void rects(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);}
35inline void rectfs(int x,int y,int r,int t) {glRects(x,y,r+1,t+1);}
gl.h
This file defines wrapper functions for OpenGL in FLTK.
gl_rect
FL_EXPORT void gl_rect(int x, int y, int w, int h)
Outlines the given rectangle with the current color.
Definition: gl_draw.cxx:286
- Copyright © 1998-2021 by Bill Spitzak and others.