1
0
forked from 0ad/0ad
0ad/source/lib/res/graphics/ogl_tex.h
janwas 9ec828f6fd - both tex.cpp and ogl_tex.cpp had functions named tex_* - confusing. renamed to ogl_tex* to disambiguate.
- ogl_tex_bind now supports multitexturing (avoids need to get id and
then bind manually)
- provide nicer API for querying texture properties (no longer one big
getter). improved GUI determination of texture alpha.
- renderer: another see-if-texture-has-alpha and fixed alpha map code
(wasn't checking if all are same size. only worked because the first map
was larger than the rest

This was SVN commit r2647.
2005-09-02 02:54:02 +00:00

29 lines
1010 B
C
Executable File

#ifndef OGL_TEX_H__
#define OGL_TEX_H__
#include "../handle.h"
#include "lib/ogl.h"
#include "lib/types.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 int ogl_tex_bind(Handle ht, GLenum unit = 0);
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_free(Handle& ht);
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__