
I'm taking a page from Dolphin's book, and including copies of each dependency's source code. This combines the ease of use of including pre-built libraries instead of needing to navigate a package manager - as is (or was) the case for MSVC - with the portability of using packages. Granted, this method's more of a jack of all trades, master of none, since it's *less* user-friendly than prebuilt packages (compilation times), and you don't get the per-distro compatibility fixes you'd get from a package manager. You can still use system libs if you want. In fact, it's still the default behaviour: compiling the libs manually is just a fallback. I'll add an option to force-enable this soon, however, since it's a nicer way to produce static MSYS2 builds than the hackish nightmare that I was using before. Not to mention, having my own copy of the sources means I can provide my own fixes and tweaks your package manager may not. For example, I can combine MSYS2's FreeType subpixel rendering with vcpkg's fix for SDL2 exporting its symbols in static builds.
35 lines
1.3 KiB
C
35 lines
1.3 KiB
C
/* 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);}
|