26 static int *Tex_used_this_frame = NULL;
59 int opengl_create_texture_sub(
int bitmap_handle,
int bitmap_type,
int bmap_w,
int bmap_h,
int tex_w,
int tex_h,
ubyte *
data = NULL,
tcache_slot_opengl *
t = NULL,
int base_level = 0,
int resize = 0,
int reload = 0);
130 if (Textures == NULL) {
134 if (Tex_used_this_frame == NULL) {
138 if ( !Textures || !Tex_used_this_frame )
139 Error(
LOCATION,
"Unable to allocate memory for OpenGL texture slots!");
142 memset( Tex_used_this_frame, 0,
MAX_BITMAPS *
sizeof(
int) );
192 for (i = 1; i < 15; i++) {
211 Tex_used_this_frame[
n] = 0;
219 if ( Textures == NULL )
242 if (Textures != NULL) {
247 if (Tex_used_this_frame != NULL) {
249 Tex_used_this_frame = NULL;
258 memset( Tex_used_this_frame, 0,
MAX_BITMAPS *
sizeof(
int) );
269 Tex_used_this_frame[
n] = 0;
323 if ( (w_out == NULL) || (h_out == NULL) ) {
339 for (i = 0; i < 16; i++) {
340 if ( (tex_w > (1<<i)) && (tex_w <= (1<<(i+1))) ) {
346 for (i = 0; i < 16; i++) {
347 if ( (tex_h > (1<<i)) && (tex_h <= (1<<(i+1))) ) {
366 int opengl_create_texture_sub(
int bitmap_handle,
int bitmap_type,
int bmap_w,
int bmap_h,
int tex_w,
int tex_h,
ubyte *
data,
tcache_slot_opengl *
t,
int base_level,
int resize,
int reload)
374 int mipmap_w = 0, mipmap_h = 0;
375 int dsize = 0, doffset = 0, block_size = 0;
378 ubyte *texmem = NULL, *texmemp = NULL;
379 int skip_size = 0, mipmap_levels = 0;
384 if ( (t == NULL) || (bmp_data == NULL) ) {
390 if ( Tex_used_this_frame[idx] ) {
391 mprintf((
"ARGHH!!! Texture already used this frame! Cannot free it!\n" ));
422 mprintf((
"!!OpenGL DEBUG!! t->texture_id == 0\n"));
432 byte_mult = (t->
bpp >> 3);
435 if (byte_mult == 4) {
439 }
else if (byte_mult == 3) {
443 }
else if (byte_mult == 2) {
447 }
else if (byte_mult == 1) {
448 Assertion( bitmap_type ==
TCACHE_TYPE_AABITMAP,
"Invalid type for bitmap: %s BMPMAN handle: %d. Type expected was 0, we got %d instead.\nThis can be caused by using texture compression on a non-power-of-2 texture.\n",
bm_get_filename(bitmap_handle), bitmap_handle, bitmap_type );
508 switch (bitmap_type) {
510 if (block_size > 0) {
512 dsize = ((mipmap_h + 3) / 4) * ((mipmap_w + 3) / 4) * block_size;
515 for (i = 0; i < base_level; i++) {
529 dsize = ((mipmap_h + 3) / 4) * ((mipmap_w + 3) / 4) * block_size;
541 for (i = 1; i < (mipmap_levels - base_level); i++) {
558 dsize = ((mipmap_h + 3) / 4) * ((mipmap_w + 3) / 4) * block_size;
581 for (i = 0; i < tex_h; i++) {
582 for (j = 0; j < tex_w; j++) {
583 if ( (i < bmap_h) && (j < bmap_w) ) {
584 if ( byte_mult > 1 ) {
587 if ( byte_mult > 3 ) {
588 for (k = 0; k < 3; k++) {
589 luminance += bmp_data[(i*bmap_w+j)*byte_mult+k];
592 *texmemp++ = (
ubyte)((luminance / 3) * (bmp_data[(i*bmap_w+j)*byte_mult+3]/255.0
f));
594 for (k = 0; k < byte_mult; k++) {
595 luminance += bmp_data[(i*bmap_w+j)*byte_mult+k];
598 *texmemp++ = (
ubyte)(luminance / byte_mult);
601 *texmemp++ =
GL_xlat[bmp_data[i*bmap_w+j]];
615 if (texmem != NULL) {
630 for (i = 0; i < tex_h; i++) {
631 for (j = 0;j < tex_w; j++) {
632 if ( (i < bmap_h) && (j < bmap_w) ) {
633 for (k = 0; k < byte_mult; k++) {
634 *texmemp++ = bmp_data[(i*bmap_w+j)*byte_mult+k];
637 for (k = 0; k < byte_mult; k++) {
651 if (texmem != NULL) {
664 for (i = 0; i < 6; i++) {
668 if (block_size > 0) {
670 dsize = ((mipmap_h + 3) / 4) * ((mipmap_w + 3) / 4) * block_size;
679 for (j = 1; j < mipmap_levels; j++) {
696 dsize = ((mipmap_h + 3) / 4) * ((mipmap_w + 3) / 4) * block_size;
707 dsize = mipmap_h * mipmap_w * byte_mult;
716 for (j = 1; j < mipmap_levels; j++) {
729 dsize = mipmap_h * mipmap_w * byte_mult;
755 fix u, utmp,
v, du, dv;
759 du = ( (bmap_w-1)*
F1_0 ) / tex_w;
760 dv = ( (bmap_h-1)*
F1_0 ) / tex_h;
762 for (j=0;j<tex_h;j++)
765 for (i=0;i<tex_w;i++)
767 for (k = 0; k < byte_mult; k++) {
768 *texmemp++ = bmp_data[(
f2i(v)*bmap_w+
f2i(utmp))*byte_mult+k];
777 if ( (mipmap_levels > 1) && resize ) {
781 dsize = mipmap_h * mipmap_w * byte_mult;
784 for (i = 0; i < base_level; i++) {
798 dsize = mipmap_h * mipmap_w * byte_mult;
804 glTexImage2D (
GL_TEXTURE_2D, 0, intFormat, mipmap_w, mipmap_h, 0, glFormat, texFormat, (texmem != NULL) ? texmem : bmp_data + doffset);
811 for (i = 1; i < (mipmap_levels - base_level); i++) {
824 dsize = mipmap_h * mipmap_w * byte_mult;
833 if (texmem != NULL) {
843 t->
size = (dsize) ? ((doffset + dsize) - skip_size) : (tex_w * tex_h * byte_mult);
853 Tex_used_this_frame[
idx] = 0;
864 int final_w, final_h;
866 int reload = 0, resize = 0, base_level = 0;
877 switch (bitmap_type) {
930 bmp =
bm_lock(bitmap_handle, bpp, flags);
955 if (max_levels == 1) {
970 if (base_level >= max_levels) {
971 base_level = max_levels - 1;
974 Assert( (max_levels - base_level) >= 1 );
982 if ( (max_w != final_w) || (max_h != final_h) ) {
988 if ( (final_h < 1) || (final_w < 1) ) {
999 if ( (final_w == tslot->
w) && (final_h == tslot->
h) ) {
1013 int ret_val =
opengl_create_texture_sub(bitmap_handle, bitmap_type, bmp->
w, bmp->
h, final_w, final_h, (
ubyte*)bmp->
data, tslot, base_level, resize, reload);
1031 #define RENDER_TARGET_DYNAMIC 17
1073 Tex_used_this_frame[
n]++;
1077 mprintf((
"Texturing disabled for bitmap %d (%s) due to internal error.\n", bitmap_handle,
bm_get_filename(bitmap_handle)));
1092 if (bitmap_handle <= 0) {
1124 float u_scale, v_scale;
1138 mprintf((
"Texture upload failed!\n"));
1144 static int GL_texture_panning_enabled = 0;
1150 GLint current_matrix;
1159 GL_texture_panning_enabled = 1;
1160 }
else if (GL_texture_panning_enabled) {
1166 GL_texture_panning_enabled = 0;
1212 int bytes_per_pixel = 3 *
sizeof(
ubyte);
1216 bytes_per_pixel = 4 *
sizeof(
ubyte);
1225 int m_width =
width;
1228 for (
int i = 0;
i < num_mipmaps;
i++ ) {
1231 m_offset += (m_width * m_height * bytes_per_pixel);
1263 mprintf((
"OpenGL ERROR: Tried to export a texture without a valid export location!\n"));
1268 mprintf((
"OpenGL ERROR: Tried to export a texture for which I don't know the texture target!\n"));
1273 mprintf((
"OpenGL ERROR: Number of mipmap levels requested is different from number available!\n"));
1278 mprintf((
"OpenGL ERROR: Only 2D textures and cube maps can be exported!\n"));
1282 if ( (ts->
w != width) && (ts->
h != height) ) {
1283 mprintf((
"OpenGL ERROR: Passed width and height do not match values for texture!\n"));
1288 int m_width =
width;
1290 int m_bpp = (
alpha) ? 4 : 3;
1301 for (
int i = 0;
i < faces;
i++) {
1319 return (
size_t)m_offset;
1324 GLenum texFormat, glFormat;
1329 int byte_mult = (bpp >> 3);
1330 int true_byte_mult = (t->
bpp >> 3);
1331 ubyte* texmem = NULL;
1333 if (true_byte_mult == 4) {
1336 }
else if (true_byte_mult == 3) {
1343 if (byte_mult == 1) {
1347 ubyte* texmemp = texmem;
1349 Assert( texmem != NULL );
1353 for (
int j = 0; j <
width; j++) {
1354 if ( (
i < height) && (j < width) ) {
1355 if ( true_byte_mult > 1 ) {
1358 if ( true_byte_mult > 3 ) {
1359 for (
int k = 0; k < 3; k++) {
1360 luminance += data[(
i*width+j)*true_byte_mult+k];
1363 *texmemp++ = (
ubyte)((luminance / 3) * (data[(
i*width+j)*true_byte_mult+3]/255.0
f));
1365 for (
int k = 0; k < true_byte_mult; k++) {
1366 luminance += data[(
i*width+j)*true_byte_mult+k];
1369 *texmemp++ = (
ubyte)(luminance / true_byte_mult);
1372 *texmemp++ =
GL_xlat[data[
i*width+j]];
1402 renderbuffer_id(0), framebuffer_id(0), width(0), height(0),
1403 ref_count(0), working_slot(-1), is_static(0)
1409 static fbo_t *render_target = NULL;
1419 char err_txt[100] = { 0 };
1423 strcpy_s(err_txt,
"Incomplete attachments!");
1427 strcpy_s(err_txt,
"Missing one or more image attachments!");
1431 strcpy_s(err_txt,
"Attached images do not have the same width and height!");
1435 strcpy_s(err_txt,
"Attached images do not have the same internal format!");
1439 strcpy_s(err_txt,
"Draw buffer attachment point is NONE!");
1443 strcpy_s(err_txt,
"Read buffer attachment point is NONE!");
1447 strcpy_s(err_txt,
"Attached images violate current FBO restrictions!");
1451 strcpy_s(err_txt,
"Unknown error!\n");
1455 mprintf((
"Framebuffer ERROR: %s\n", err_txt));
1465 size_t rt_size = RenderTarget.size();
1467 for (
size_t i = 0;
i < rt_size;
i++) {
1468 if ( (RenderTarget[
i].width == width) && (RenderTarget[
i].height == height) ) {
1469 return &RenderTarget[
i];
1484 if ( RenderTarget.empty() ) {
1491 for (idx = 0; idx < RenderTarget.size(); idx++) {
1492 if ( (RenderTarget[idx].width == ts->
w) && (RenderTarget[
idx].height == ts->
h) ) {
1498 if ( idx >= RenderTarget.size() ) {
1502 RenderTarget[
idx].ref_count--;
1504 if (RenderTarget[idx].ref_count <= 0) {
1505 mprintf((
"OpenGL: Killing off unused %ix%i render target...\n", ts->
w, ts->
h));
1507 if (RenderTarget[idx].framebuffer_id) {
1509 RenderTarget[
idx].framebuffer_id = 0;
1512 if (RenderTarget[idx].renderbuffer_id) {
1514 RenderTarget[
idx].renderbuffer_id = 0;
1517 RenderTarget.erase( RenderTarget.begin() +
idx );
1519 mprintf((
"OpenGL: Keeping %ix%i render target with ref_count of %i.\n", ts->
w, ts->
h, RenderTarget[idx].ref_count));
1525 for (
size_t i = 0;
i < RenderTarget.size();
i++) {
1526 fbo_t *fbo = &RenderTarget[
i];
1539 RenderTarget.clear();
1550 if ( (render_target != NULL) && (render_target->
working_slot >= 0) ) {
1562 if (render_target != NULL) {
1568 render_target = NULL;
1577 ts = &Textures[slot];
1585 fbo = opengl_get_fbo(ts->
w, ts->
h);
1588 mprintf((
"Tried to get an OpenGL FBO that didn't exist!\n"));
1601 Assert( (face >= 0) && (face < 6) );
1619 render_target = fbo;
1653 fbo_t *fbo = opengl_get_fbo(*w, *h);
1658 if ( (fbo != NULL) && (fbo->
width == *w) && (fbo->
height == *h) ) {
1680 if (flags & BMP_FLAG_CUBEMAP) {
1682 for (
int i = 0;
i < 6;
i++) {
1724 mprintf((
"OpenGL: Reusing %ix%i FBO!\n", *w, *h));
1753 if (flags & BMP_FLAG_CUBEMAP) {
1755 for (
int i = 0;
i < 6;
i++) {
1785 if (flags & BMP_FLAG_CUBEMAP) {
1795 mprintf((
"OpenGL: Unable to create FBO!\n"));
1841 RenderTarget.push_back(new_fbo);
1846 mprintf((
"OpenGL: Created %ix%i FBO!\n", ts->
w, ts->
h));
1871 if (render_target == NULL || render_target->
working_slot < 0)
void bm_unlock(int handle)
Unlocks a bitmap.
#define vm_malloc_q(size)
ubyte bpp
Requested bitdepth of each pixel. ( 7, 8, 15, 16, 24, 32)
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
WINGDIAPI void APIENTRY glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
uint os_config_read_uint(const char *section, const char *name, uint default_value)
#define OGL_EXT_FRAMEBUFFER_OBJECT
#define TCACHE_TYPE_COMPRESSED
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
#define BMP_TEX_DXT3
dxt3 compressed 8r8g8b4a (32bit)
GLfloat GLfloat GLfloat GLfloat h
GLfloat GL_max_anisotropy
#define vglIsFramebufferEXT
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT
void gr_opengl_set_texture_panning(float u, float v, bool enable)
GLfloat opengl_get_max_anisotropy()
#define vglBindFramebufferEXT
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X
WINGDIAPI void APIENTRY glMatrixMode(GLenum mode)
WINGDIAPI GLboolean APIENTRY glIsTexture(GLuint texture)
WINGDIAPI void APIENTRY glClear(GLbitfield mask)
#define vglCompressedTexSubImage2D
void opengl_tcache_get_adjusted_texture_size(int w_in, int h_in, int *w_out, int *h_out)
WINGDIAPI void APIENTRY glTexEnvf(GLenum target, GLenum pname, GLfloat param)
WINGDIAPI void APIENTRY glDeleteTextures(GLsizei n, const GLuint *textures)
int opengl_create_texture_sub(int bitmap_handle, int bitmap_type, int bmap_w, int bmap_h, int tex_w, int tex_h, ubyte *data=NULL, tcache_slot_opengl *t=NULL, int base_level=0, int resize=0, int reload=0)
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT
GLuint opengl_get_rtt_framebuffer()
Gets the current RTT framebuffer.
#define OGL_ARB_TEXTURE_MIRRORED_REPEAT
#define Assertion(expr, msg,...)
bool opengl_texture_slot_valid(int n, int handle)
int bm_get_tcache_type(int num)
Gets the correct TCACHE_TYPE for compressed graphics (uncompressed are assumed TCACHE_TYPE_NORMAL) ...
#define GL_TEXTURE_MAX_LEVEL
void opengl_free_texture_with_handle(int handle)
#define GL_UNSIGNED_SHORT_1_5_5_5_REV
const char * os_config_read_string(const char *section, const char *name, const char *default_value)
opengl_texture_state Texture
GLenum GL_texture_addressing
#define BMP_TEX_DXT5
dxt5 compressed 8r8g8b8a (32bit)
#define TMAP_ADDRESS_MIRROR
void gr_opengl_update_texture(int bitmap_handle, int bpp, const ubyte *data, int width, int height)
bool bm_has_alpha_channel(int handle)
Checks to see if the indexed bitmap has an alpha channel.
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
int opengl_free_texture(tcache_slot_opengl *t)
#define GL_MAX_TEXTURE_SIZE
short h
Height, in number of pixels.
#define GL_TEXTURE_WRAP_S
int bm_unload_fast(int handle, int clear_render_targets)
Quickly unloads a bitmap's data, ignoring the load_count.
void opengl_tcache_shutdown()
WINGDIAPI void APIENTRY glPopMatrix(void)
#define BMP_AABITMAP
antialiased bitmap
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT
int opengl_set_render_target(int slot, int face, int is_static)
#define CLAMP(x, min, max)
void SetEnvMode(GLenum mode)
#define vglFramebufferTexture2DEXT
GLenum GLuint GLint GLenum face
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
GLint GL_max_texture_height
int GL_min_texture_height
int Interp_multitex_cloakmap
int GLOWMAP
References a map that is a fully lit version of its index -Bobboau.
#define BMP_TEX_DXT1
dxt1 compressed 8r8g8b1a (24bit)
int bm_is_compressed(int num)
Returns the compression type of the bitmap indexed by handle.
#define vglBindRenderbufferEXT
#define vglDeleteRenderbuffersEXT
#define BMP_FLAG_CUBEMAP
Texture is a cubemap.
void opengl_tcache_flush()
bool GL_rendering_to_texture
#define OGL_EXT_TEXTURE_LOD_BIAS
WINGDIAPI void APIENTRY glTexParameterf(GLenum target, GLenum pname, GLfloat param)
#define GL_FRAMEBUFFER_EXT
size_t opengl_export_render_target(int slot, int width, int height, int alpha, int num_mipmaps, ubyte *image_data)
#define TCACHE_TYPE_INTERFACE
WINGDIAPI void APIENTRY glGenTextures(GLsizei n, GLuint *textures)
#define TCACHE_TYPE_CUBEMAP
ogl_extension GL_Extensions[NUM_OGL_EXTENSIONS]
GLint GL_supported_texture_units
const char * bm_get_filename(int handle)
Gets the filename of the bitmap indexed by handle, which must exist.
#define GL_TEXTURE_MAX_ANISOTROPY_EXT
short w
Width, in number of pixels.
#define GL_FRAMEBUFFER_COMPLETE_EXT
#define OGL_ARB_TEXTURE_CUBE_MAP
WINGDIAPI void APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
int gr_opengl_tcache_set_internal(int bitmap_handle, int bitmap_type, float *u_scale, float *v_scale, int tex_unit=0)
bitmap * bm_lock(int handle, ubyte bpp, ubyte flags, bool nodebug)
Locks down the bitmap indexed by bitmapnum.
#define vglCheckFramebufferStatusEXT
void opengl_kill_render_target(int slot)
#define GL_TEXTURE_LOD_BIAS
#define GL_TEXTURE_WRAP_R
#define GL_CHECK_FOR_ERRORS(s)
#define BMP_TEX_OTHER
so we can identify all "normal" textures
int bm_is_render_target(int bitmap_id)
Checks to see if the given bitmap indexed by handle is a render target.
#define GL_TEXTURE_MAG_FILTER
#define GL_LINEAR_MIPMAP_LINEAR
#define Is_Extension_Enabled(x)
void opengl_set_modulate_tex_env()
void SetTarget(GLenum tex_target)
WINGDIAPI void APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
void Enable(GLuint tex_id=0)
int opengl_create_texture(int bitmap_handle, int bitmap_type, tcache_slot_opengl *tslot=NULL)
WINGDIAPI void APIENTRY glGetIntegerv(GLenum pname, GLint *params)
#define TCACHE_TYPE_XPARENT
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
#define TMAP_ADDRESS_WRAP
GLint GL_max_texture_width
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT
void opengl_tcache_init()
#define GL_UNSIGNED_INT_8_8_8_8_REV
void opengl_free_texture_slot(int n)
int bm_get_cache_slot(int bitmap_id, int separate_ani_frames)
#define BMP_TEX_CUBEMAP
a texture made for cubic environment map
void opengl_set_additive_tex_env()
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
#define GL_TEXTURE_WRAP_T
WINGDIAPI void APIENTRY glGetFloatv(GLenum pname, GLfloat *params)
#define GL_RENDERBUFFER_EXT
GLint GLsizei GLsizei height
GLubyte GLubyte GLubyte GLubyte w
#define vglGenFramebuffersEXT
WINGDIAPI void APIENTRY glPushMatrix(void)
#define GL_TEXTURE_CUBE_MAP
int gr_opengl_preload(int bitmap_num, int is_aabitmap)
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
#define GL_MAX_TEXTURE_UNITS_ARB
#define vglDeleteFramebuffersEXT
#define GL_TEXTURE_MIN_FILTER
void gr_opengl_get_bitmap_from_texture(void *data_out, int bitmap_num)
#define TCACHE_TYPE_NORMAL
void opengl_set_texture_target(GLenum target)
void gr_opengl_set_texture_addressing(int mode)
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT
int SPECMAP
References a map that is for specular mapping -Bobboau.
#define OGL_ARB_TEXTURE_NON_POWER_OF_TWO
#define OGL_EXT_TEXTURE_FILTER_ANISOTROPIC
GLenum GLsizei GLenum GLenum const GLvoid * data
GLint GL_max_renderbuffer_size
ptr_u data
Pointer to data, or maybe offset into VRAM.
WINGDIAPI void APIENTRY glBindTexture(GLenum target, GLuint texture)
void SetRGBScale(GLfloat scale)
void Delete(GLuint tex_id)
void opengl_preload_init()
#define MAX_BITMAPS
How many bitmaps the game can handle.
int opengl_make_render_target(int handle, int slot, int *w, int *h, ubyte *bpp, int *mm_lvl, int flags)
int gr_opengl_tcache_set(int bitmap_handle, int bitmap_type, float *u_scale, float *v_scale, int stage)
WINGDIAPI void APIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
WINGDIAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
void opengl_tcache_frame()
int opengl_get_texture(GLenum target, GLenum pixel_format, GLenum data_format, int num_mipmaps, int width, int height, int bytes_per_pixel, void *image_data, int offset)
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
#define TMAP_ADDRESS_CLAMP
int opengl_check_framebuffer()
WINGDIAPI void APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z)
GLclampf GLclampf GLclampf alpha
#define BMP_TEX_XPARENT
transparent texture
void opengl_kill_all_render_targets()
#define GL_COLOR_BUFFER_BIT
#define GL_TEXTURE_FILTER_CONTROL
int bm_get_num_mipmaps(int num)
Gets the number of mipmaps of the indexed texture.
void gr_opengl_bm_save_render_target(int n)
#define GL_MAX_RENDERBUFFER_SIZE_EXT
#define GL_MIRRORED_REPEAT_ARB
#define vglCompressedTexImage2D
void SetActiveUnit(GLuint id=0)
#define GL_COLOR_ATTACHMENT0_EXT
#define OGL_ARB_TEXTURE_ENV_COMBINE
#define GL_LINEAR_MIPMAP_NEAREST
int ENVMAP
References a map that is for environment mapping -Bobboau.
#define TCACHE_TYPE_AABITMAP
void SetEnvCombineMode(GLenum cmode, GLenum cfunc)