0ad/source/lib/res/graphics/ogl_tex.h
janwas 4aa740bff5 - split up lib/res into file, graphics and sound.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.

This was SVN commit r2604.
2005-08-12 17:06:53 +00:00

27 lines
851 B
C
Executable File

#ifndef OGL_TEX_H__
#define OGL_TEX_H__
#include "../handle.h"
// load and return a handle to the texture given in <fn>.
// supports RAW, BMP, JP2, PNG, TGA, DDS
extern Handle tex_load(const char* fn, int scope = 0);
extern int tex_bind(Handle ht);
extern int tex_id(Handle ht);
extern int tex_info(Handle ht, int* w, int* h, int *fmt, int *bpp, void** p);
extern int tex_filter; // GL values; default: GL_LINEAR
extern unsigned int 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 tex_upload(Handle ht, int filter_override = 0, int internal_fmt_override = 0, int format_override = 0);
extern int tex_free(Handle& ht);
#endif // #ifndef OGL_TEX_H__