1
0
forked from 0ad/0ad
0ad/source/lib/res/graphics/ogl_tex.h
janwas 13501cf58b hook up emulate_glCompressedTexImage2D to new tex transform code (which takes care of DDS unpack)
to that end, provide support for "wrapping" existing textures so that
tex_* and ogl_tex* calls may be used.

also have renderer use ogl_tex for its created-on-the-fly composite
alpha texture
also named atlas's thread (for fun+profit during debugging)

This was SVN commit r2754.
2005-09-19 22:48:20 +00:00

32 lines
1.1 KiB
C
Executable File

#ifndef OGL_TEX_H__
#define OGL_TEX_H__
#include "../handle.h"
#include "lib/types.h"
#include "lib/ogl.h"
#include "tex.h"
// load and return a handle to the texture given in <fn>.
// supports RAW, BMP, JP2, PNG, TGA, DDS
extern Handle ogl_tex_load(const char* fn, int scope = 0);
extern Handle ogl_tex_wrap(const char* fn, Tex* wrapped_tex);
extern int ogl_tex_free(Handle& ht);
extern GLint ogl_tex_filter; // GL values; default: GL_LINEAR
extern uint ogl_tex_bpp; // 16 or 32; default: 32
// upload the specified texture to OpenGL. Texture filter and internal format
// may be specified to override the global defaults.
// side effect: binds the texture to the currently active unit.
extern int ogl_tex_upload(Handle ht, GLint filter_override = 0, GLint internal_fmt_override = 0, GLenum format_override = 0);
extern int ogl_tex_bind(Handle ht, GLenum unit = 0);
extern int ogl_tex_get_size(Handle ht, int* w, int* h, int* bpp);
extern int ogl_tex_get_format(Handle ht, int* flags, GLenum* fmt);
extern int ogl_tex_get_data(Handle ht, void** p);
#endif // #ifndef OGL_TEX_H__