16 #define FBGL_TEXTURE 0x1
17 #define FBGL_BLEND 0x2
20 #define GL_BGRA 0x80E1
50 len = strlen(extension);
51 while ((
string = strstr(
string, extension)) !=
NULL) {
53 if ((*
string ==
' ') || (*
string ==
'\0'))
64 diffs = state ^ __fb_gl.
state;
68 if (state & FBGL_TEXTURE)
69 __fb_gl.
Enable(GL_TEXTURE_2D);
85 data = (
unsigned char *)calloc(1, w * h * 4);
89 __fb_gl.
TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0,
GL_BGRA, GL_UNSIGNED_BYTE, data);
102 int default_color_bits[4] = { 0, 5, 8, 8 };
103 int default_alpha_bits[4] = { 0, 0, 0, 8 };
115 if (bpp > 3) bpp = 3;
132 if (bpp > 3) bpp = 3;
160 const char *gl_funcs[] = {
"glEnable",
"glDisable",
"glGetString",
"glViewport",
"glMatrixMode",
161 "glLoadIdentity",
"glOrtho",
"glShadeModel",
"glDepthMask",
"glClearColor",
162 "glClear",
"glGenTextures",
"glDeleteTextures",
"glBindTexture",
165 void **funcs_ptr = (
void **)funcs;
170 if (
fb_hDynLoadAlso(lib, gl_funcs, funcs_ptr,
sizeof(gl_funcs) /
sizeof(
const char *)))
176 strncat(__fb_gl.
extensions, os_extensions, size);
193 __fb_gl.
Disable(GL_DEPTH_TEST);
196 __fb_gl.
Clear(GL_COLOR_BUFFER_BIT);