|
0 A.D. | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
| Field Summary | |
static glyphmap_id* |
BoundGlyphs
See unifont.cpp |
static const TexCodecVTbl* |
codecs
========================================================================= File : tex_codec. |
static GLint |
default_filter
See ogl_tex.cpp |
static uint |
default_q_flags
See ogl_tex.cpp |
static int |
global_orientation
See tex.cpp |
static int |
have_auto_mipmap_gen
See ogl_tex.cpp |
static int |
have_s3tc
See ogl_tex.cpp |
const int |
TEX_BASE_LEVEL_ONLY
special value for levels_to_skip: the callback will only be called for the base mipmap level (i.e. 100%) |
| Method Summary | |
static inline uint |
access_bit_tbl( u32 tbl, uint idx, uint bit_width )
See tex_dds.cpp |
static inline uint |
access_bit_tbl64( u64 tbl, uint idx, uint bit_width )
See tex_dds.cpp |
static void |
add_level_size( uint UNUSED( level ), uint UNUSED( level_w ), uint UNUSED( level_h ), const u8* RESTRICT UNUSED( level_data ), size_t level_data_size, void* RESTRICT ctx )
See tex.cpp |
static LibError |
add_mipmaps( Tex* t, uint w, uint h, uint bpp, void* new_data, size_t data_size )
See tex.cpp |
static LibError |
bmp_decode( DynArray* RESTRICT da, Tex* RESTRICT t )
See tex_bmp.cpp |
static LibError |
bmp_encode( Tex* RESTRICT t, DynArray* RESTRICT da )
See tex_bmp.cpp |
static size_t |
bmp_hdr_size( const u8* file )
See tex_bmp.cpp |
static bool |
bmp_is_ext( const char* ext )
See tex_bmp.cpp |
static bool |
bmp_is_hdr( const u8* file )
See tex_bmp.cpp |
static LibError |
bmp_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) )
See tex_bmp.cpp |
|
cassert( sizeof( JOCTET )== 1&& CHAR_BIT == 8 )
========================================================================= File : tex_jpg. |
static GLint |
choose_fmt( uint bpp, uint flags )
See ogl_tex.cpp |
static GLint |
choose_int_fmt( GLenum fmt, uint q_flags )
See ogl_tex.cpp |
static void |
create_level( uint level, uint level_w, uint level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT ctx )
See tex.cpp |
LibError |
cursor_draw( const char* name, int x, int y )
See cursor.cpp |
static void |
Cursor_dtor( Cursor* c )
See cursor.cpp |
static LibError |
cursor_free( Handle& h )
See cursor.cpp |
static void |
Cursor_init( Cursor* UNUSED( c ), va_list UNUSED( args ) )
See cursor.cpp |
static Handle |
cursor_load( const char* name )
See cursor.cpp |
static LibError |
Cursor_reload( Cursor* c, const char* name, Handle )
See cursor.cpp |
static LibError |
Cursor_to_string( const Cursor* c, char* buf )
See cursor.cpp |
static LibError |
Cursor_validate( const Cursor* c )
See cursor.cpp |
static LibError |
dds_decode( DynArray* RESTRICT da, Tex* RESTRICT t )
See tex_dds.cpp |
static LibError |
dds_encode( Tex* RESTRICT UNUSED( t ), DynArray* RESTRICT UNUSED( da ) )
See tex_dds.cpp |
static size_t |
dds_hdr_size( const u8* UNUSED( file ) )
See tex_dds.cpp |
static bool |
dds_is_ext( const char* ext )
See tex_dds.cpp |
static bool |
dds_is_hdr( const u8* file )
See tex_dds.cpp |
static LibError |
dds_transform( Tex* t, uint transforms )
See tex_dds.cpp |
static LibError |
decode_pf( const DDPIXELFORMAT* pf, uint* bpp_, uint* flags_ )
See tex_dds.cpp |
static LibError |
decode_sd( const DDSURFACEDESC2* sd, uint* w_, uint* h_, uint* bpp_, uint* flags_ )
See tex_dds.cpp |
static void |
detect_gl_upload_caps()
See ogl_tex.cpp |
static LibError |
do_load_shader( Ogl_Program* p, const char* filename, Handle UNUSED( h ), const CXeromyces& XeroFile, const XMBElement& Shader )
See ogl_shader.cpp |
METHODDEF( boolean ) |
dst_empty_output_buffer( j_compress_ptr cinfo )
See tex_jpg.cpp |
METHODDEF( void ) |
dst_init( j_compress_ptr cinfo )
See tex_jpg.cpp |
GLOBAL( void ) |
dst_prepare( j_compress_ptr cinfo, DynArray* da )
See tex_jpg.cpp |
METHODDEF( void ) |
dst_term( j_compress_ptr cinfo )
See tex_jpg.cpp |
METHODDEF( void ) |
err_error_exit( j_common_ptr cinfo )
See tex_jpg.cpp |
METHODDEF( void ) |
err_output_message( j_common_ptr cinfo )
See tex_jpg.cpp |
|
ERROR_ASSOCIATE( ERR::SHDR_NO_SHADER,"Invalid shader reference",-1 )
See ogl_shader.cpp |
|
ERROR_ASSOCIATE( ERR::SHDR_COMPILE,"Shader compile failed",-1 )
See ogl_shader.cpp |
|
ERROR_ASSOCIATE( ERR::SHDR_LINK,"Shader linking failed",-1 )
See ogl_shader.cpp |
|
ERROR_ASSOCIATE( ERR::SHDR_CREATE,"Shader creation failed",-1 )
========================================================================= File : ogl_shader. |
|
ERROR_ASSOCIATE( ERR::SHDR_NO_PROGRAM,"Invalid shader program reference",-1 )
See ogl_shader.cpp |
|
ERROR_ASSOCIATE( INFO::TEX_CODEC_CANNOT_HANDLE,"Texture codec cannot handle the given format",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( ERR::TEX_INVALID_SIZE,"Texture size is incorrect",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( WARN::TEX_INVALID_DATA,"Warning: invalid texel data encountered",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( ERR::TEX_COMPRESSED,"Unsupported texture compression",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( ERR::TEX_INVALID_LAYOUT,"Unsupported texel layout, e.g. right-to-left",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( ERR::TEX_NOT_8BIT_PRECISION,"Not 8-bit channel precision",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( ERR::TEX_INVALID_COLOR_TYPE,"Invalid color type",-1 )
See tex.cpp |
|
ERROR_ASSOCIATE( ERR::TEX_FMT_INVALID,"Invalid/unsupported texture format",-1 )
========================================================================= File : tex. |
static void |
file_buf_dtor( void* p, size_t UNUSED( size ), uintptr_t UNUSED( ctx ) )
See tex.cpp |
static bool |
filter_uses_mipmaps( GLint filter )
See ogl_tex.cpp |
static bool |
filter_valid( GLint filter )
========================================================================= File : ogl_tex. |
static void |
flip_to_global_orientation( Tex* t )
See tex.cpp |
static bool |
fmt_is_s3tc( GLenum fmt )
See ogl_tex.cpp |
static LibError |
get_mipmaps( Tex* t, GLint filter, uint q_flags, int* plevels_to_skip )
See ogl_tex.cpp |
void |
glvwprintf( const wchar_t* fmt, va_list args )
See unifont.cpp |
void |
glwprintf( const wchar_t* fmt,... )
See unifont.cpp |
|
H_TYPE_DEFINE( Cursor )
See cursor.cpp |
|
H_TYPE_DEFINE( UniFont )
See unifont.cpp |
|
H_TYPE_DEFINE( Ogl_Program )
See ogl_shader.cpp |
|
H_TYPE_DEFINE( Ogl_Shader )
See ogl_shader.cpp |
|
H_TYPE_DEFINE( OglTex )
See ogl_tex.cpp |
static void |
io_flush( png_structp UNUSED( png_ptr ) )
See tex_png.cpp |
static void |
io_read( png_struct* png_ptr, u8* data, png_size_t length )
========================================================================= File : tex_png. |
static void |
io_write( png_struct* png_ptr, u8* data, png_size_t length )
See tex_png.cpp |
static bool |
is_valid_dxt( uint dxt )
See tex_dds.cpp |
static LibError |
jpg_decode( DynArray* RESTRICT da, Tex* RESTRICT t )
See tex_jpg.cpp |
static LibError |
jpg_decode_impl( DynArray* da, jpeg_decompress_struct* cinfo, Handle& img_hm, RowArray& rows, Tex* t )
See tex_jpg.cpp |
static LibError |
jpg_encode( Tex* RESTRICT t, DynArray* RESTRICT da )
See tex_jpg.cpp |
static LibError |
jpg_encode_impl( Tex* t, jpeg_compress_struct* cinfo, RowArray& rows, DynArray* da )
See tex_jpg.cpp |
static size_t |
jpg_hdr_size( const u8* UNUSED( file ) )
See tex_jpg.cpp |
static bool |
jpg_is_ext( const char* ext )
See tex_jpg.cpp |
static bool |
jpg_is_hdr( const u8* file )
See tex_jpg.cpp |
static LibError |
jpg_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) )
See tex_jpg.cpp |
static void* |
load_empty_sys_cursor()
========================================================================= File : cursor. |
static void* |
load_sys_cursor( const char* filename, int hx, int hy )
See cursor.cpp |
static void |
make_room_in_buffer( j_compress_ptr cinfo )
See tex_jpg.cpp |
static inline void |
mix_2_3( uint dst[ 4], uint c0[ 4], uint c1[ 4] )
See tex_dds.cpp |
static inline void |
mix_avg( uint dst[ 4], uint c0[ 4], uint c1[ 4] )
See tex_dds.cpp |
static void |
Ogl_Program_dtor( Ogl_Program* p )
See ogl_shader.cpp |
void |
ogl_program_free( Handle& h )
See ogl_shader.cpp |
GLint |
ogl_program_get_attrib_location( Handle h, const char* name )
See ogl_shader.cpp |
GLint |
ogl_program_get_uniform_location( Handle h, const char* name )
See ogl_shader.cpp |
static void |
Ogl_Program_init( Ogl_Program* UNUSED( p ), va_list UNUSED( args ) )
See ogl_shader.cpp |
Handle |
ogl_program_load( const char* fn )
See ogl_shader.cpp |
static LibError |
Ogl_Program_reload( Ogl_Program* p, const char* filename, Handle h )
See ogl_shader.cpp |
static LibError |
Ogl_Program_to_string( const Ogl_Program* UNUSED( p ), char* buf )
See ogl_shader.cpp |
LibError |
ogl_program_use( Handle h )
See ogl_shader.cpp |
static LibError |
Ogl_Program_validate( const Ogl_Program* UNUSED( p ) )
See ogl_shader.cpp |
LibError |
ogl_shader_attach( GLhandleARB program, Handle& h )
See ogl_shader.cpp |
static void |
Ogl_Shader_dtor( Ogl_Shader* shdr )
See ogl_shader.cpp |
void |
ogl_shader_free( Handle& h )
See ogl_shader.cpp |
static void |
Ogl_Shader_init( Ogl_Shader* shdr, va_list args )
See ogl_shader.cpp |
Handle |
ogl_shader_load( const char* fn, GLenum type )
See ogl_shader.cpp |
static LibError |
Ogl_Shader_reload( Ogl_Shader* shdr, const char* filename, Handle UNUSED( h ) )
See ogl_shader.cpp |
static LibError |
Ogl_Shader_to_string( const Ogl_Shader* UNUSED( shdr ), char* buf )
See ogl_shader.cpp |
static LibError |
Ogl_Shader_validate( const Ogl_Shader* UNUSED( shdr ) )
See ogl_shader.cpp |
LibError |
ogl_tex_bind( Handle ht, uint unit )
See ogl_tex.cpp |
Handle |
ogl_tex_find( const char* fn )
See ogl_tex.cpp |
LibError |
ogl_tex_free( Handle& ht )
See ogl_tex.cpp |
LibError |
ogl_tex_get_data( Handle ht, void** p )
See ogl_tex.cpp |
LibError |
ogl_tex_get_format( Handle ht, uint* flags, GLenum* fmt )
See ogl_tex.cpp |
LibError |
ogl_tex_get_size( Handle ht, uint* w, uint* h, uint* bpp )
See ogl_tex.cpp |
Handle |
ogl_tex_load( const char* fn, uint flags )
See ogl_tex.cpp |
void |
ogl_tex_override( OglTexOverrides what, OglTexAllow allow )
See ogl_tex.cpp |
void |
ogl_tex_set_defaults( uint q_flags, GLint filter )
See ogl_tex.cpp |
LibError |
ogl_tex_set_filter( Handle ht, GLint filter )
See ogl_tex.cpp |
LibError |
ogl_tex_set_wrap( Handle ht, GLint wrap )
See ogl_tex.cpp |
LibError |
ogl_tex_transform( Handle ht, uint transforms )
See ogl_tex.cpp |
LibError |
ogl_tex_transform_to( Handle ht, uint new_flags )
See ogl_tex.cpp |
LibError |
ogl_tex_upload( const Handle ht, GLenum fmt_ovr, uint q_flags_ovr, GLint int_fmt_ovr )
See ogl_tex.cpp |
Handle |
ogl_tex_wrap( Tex* t, const char* fn, uint flags )
See ogl_tex.cpp |
static void |
OglTex_dtor( OglTex* ot )
See ogl_tex.cpp |
static void |
OglTex_init( OglTex* ot, va_list args )
See ogl_tex.cpp |
static LibError |
OglTex_reload( OglTex* ot, const char* fn, Handle h )
See ogl_tex.cpp |
static LibError |
OglTex_to_string( const OglTex* ot, char* buf )
See ogl_tex.cpp |
static LibError |
OglTex_validate( const OglTex* ot )
See ogl_tex.cpp |
static LibError |
plain_transform( Tex* t, uint transforms )
See tex.cpp |
static LibError |
png_decode( DynArray* RESTRICT da, Tex* RESTRICT t )
See tex_png.cpp |
static LibError |
png_decode_impl( DynArray* da, png_structp png_ptr, png_infop info_ptr, Handle& img_hm, RowArray& rows, Tex* t )
See tex_png.cpp |
static LibError |
png_encode( Tex* RESTRICT t, DynArray* RESTRICT da )
See tex_png.cpp |
static LibError |
png_encode_impl( Tex* t, png_structp png_ptr, png_infop info_ptr, RowArray& rows, DynArray* da )
See tex_png.cpp |
static size_t |
png_hdr_size( const u8* UNUSED( file ) )
See tex_png.cpp |
static bool |
png_is_ext( const char* ext )
See tex_png.cpp |
static bool |
png_is_hdr( const u8* file )
See tex_png.cpp |
static LibError |
png_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) )
See tex_png.cpp |
static bool |
q_flags_valid( uint q_flags )
See ogl_tex.cpp |
static LibError |
s3tc_decompress( Tex* t )
See tex_dds.cpp |
static void |
s3tc_decompress_level( uint UNUSED( level ), uint level_w, uint level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT ctx )
See tex_dds.cpp |
static void |
s3tc_precalc_alpha( uint dxt, const u8* RESTRICT a_block, S3tcBlock* RESTRICT b )
See tex_dds.cpp |
static void |
s3tc_precalc_block( uint dxt, const u8* RESTRICT block, S3tcBlock* RESTRICT b )
See tex_dds.cpp |
static void |
s3tc_precalc_color( uint dxt, const u8* RESTRICT c_block, S3tcBlock* RESTRICT b )
See tex_dds.cpp |
static void |
s3tc_write_pixel( const S3tcBlock* RESTRICT b, uint pixel_idx, u8* RESTRICT out )
See tex_dds.cpp |
static const char* |
shader_type_to_string( GLenum type, char* buf, size_t buflen )
See ogl_shader.cpp |
METHODDEF( boolean ) |
src_fill_buffer( j_decompress_ptr cinfo )
See tex_jpg.cpp |
METHODDEF( void ) |
src_init( j_decompress_ptr UNUSED( cinfo ) )
See tex_jpg.cpp |
GLOBAL( void ) |
src_prepare( j_decompress_ptr cinfo, DynArray* da )
See tex_jpg.cpp |
METHODDEF( void ) |
src_skip_data( j_decompress_ptr cinfo, long num_bytes )
See tex_jpg.cpp |
METHODDEF( void ) |
src_term( j_decompress_ptr UNUSED( cinfo ) )
See tex_jpg.cpp |
static void |
state_latch( OglTexState* ots )
See ogl_tex.cpp |
static void |
state_set_to_defaults( OglTexState* ots )
See ogl_tex.cpp |
static GLenum |
string_to_shader_type( const char* name )
See ogl_shader.cpp |
LibError |
tex_codec_alloc_rows( const u8* data, size_t h, size_t pitch, uint src_flags, uint dst_orientation, RowArray& rows )
See tex_codec.cpp |
LibError |
tex_codec_for_filename( const char* fn, const TexCodecVTbl** c )
See tex_codec.cpp |
LibError |
tex_codec_for_header( const u8* file, size_t file_size, const TexCodecVTbl** c )
See tex_codec.cpp |
const TexCodecVTbl* |
tex_codec_next( const TexCodecVTbl* prev_codec )
See tex_codec.cpp |
int |
tex_codec_register( TexCodecVTbl* c )
See tex_codec.cpp |
|
TEX_CODEC_REGISTER( dds )
See tex_dds.cpp |
|
TEX_CODEC_REGISTER( bmp )
See tex_bmp.cpp |
|
TEX_CODEC_REGISTER( tga )
See tex_tga.cpp |
|
TEX_CODEC_REGISTER( png )
See tex_png.cpp |
|
TEX_CODEC_REGISTER( jpg )
See tex_jpg.cpp |
void |
tex_codec_register_all()
See tex_codec.cpp |
LibError |
tex_codec_transform( Tex* t, uint transforms )
See tex_codec.cpp |
LibError |
tex_codec_write( Tex* t, uint transforms, const void* hdr, size_t hdr_size, DynArray* da )
See tex_codec.cpp |
LibError |
tex_decode( const u8* data, size_t data_size, MEM_DTOR dtor, Tex* t )
See tex.cpp |
LibError |
tex_encode( Tex* t, const char* fn, DynArray* da )
See tex.cpp |
LibError |
tex_free( Tex* t )
See tex.cpp |
u8* |
tex_get_data( const Tex* t )
See tex.cpp |
size_t |
tex_hdr_size( const char* fn )
See tex.cpp |
size_t |
tex_img_size( const Tex* t )
See tex.cpp |
bool |
tex_is_known_extension( const char* filename )
See tex.cpp |
LibError |
tex_load( const char* fn, Tex* t, uint file_flags )
See tex.cpp |
bool |
tex_orientations_match( uint src_flags, uint dst_orientation )
See tex.cpp |
void |
tex_set_global_orientation( int o )
See tex.cpp |
LibError |
tex_transform( Tex* t, uint transforms )
See tex.cpp |
LibError |
tex_transform_to( Tex* t, uint new_flags )
See tex.cpp |
void |
tex_util_foreach_mipmap( uint w, uint h, uint bpp, const u8* RESTRICT data, int levels_to_skip, uint data_padding, MipmapCB cb, void* RESTRICT ctx )
See tex.cpp |
LibError |
tex_validate( const Tex* t )
See tex.cpp |
LibError |
tex_validate_plain_format( uint bpp, uint flags )
See tex.cpp |
LibError |
tex_wrap( uint w, uint h, uint bpp, uint flags, void* img, Tex* t )
See tex.cpp |
LibError |
tex_write( Tex* t, const char* fn )
See tex.cpp |
static LibError |
tga_decode( DynArray* RESTRICT da, Tex* RESTRICT t )
See tex_tga.cpp |
static LibError |
tga_encode( Tex* RESTRICT t, DynArray* RESTRICT da )
See tex_tga.cpp |
static size_t |
tga_hdr_size( const u8* file )
See tex_tga.cpp |
static bool |
tga_is_ext( const char* ext )
See tex_tga.cpp |
static bool |
tga_is_hdr( const u8* file )
See tex_tga.cpp |
static LibError |
tga_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) )
See tex_tga.cpp |
|
TIMER_ADD_CLIENT( tc_transform )
See tex.cpp |
|
TIMER_ADD_CLIENT( tc_png_decode )
See tex_png.cpp |
|
TIMER_ADD_CLIENT( tc_plain_transform )
See tex.cpp |
LibError |
unifont_bind( const Handle h )
See unifont.cpp |
int |
unifont_character_width( const Handle h, wchar_t c )
See unifont.cpp |
static void |
UniFont_dtor( UniFont* f )
See unifont.cpp |
int |
unifont_height( const Handle h )
See unifont.cpp |
static void |
UniFont_init( UniFont* UNUSED( f ), va_list UNUSED( args ) )
See unifont.cpp |
int |
unifont_linespacing( const Handle h )
See unifont.cpp |
Handle |
unifont_load( const char* fn, uint flags )
See unifont.cpp |
static LibError |
UniFont_reload( UniFont* f, const char* fn, Handle UNUSED( h ) )
See unifont.cpp |
LibError |
unifont_stringsize( const Handle h, const wchar_t* text, int& width, int& height )
See unifont.cpp |
static LibError |
UniFont_to_string( const UniFont* f, char* buf )
See unifont.cpp |
LibError |
unifont_unload( Handle& h )
See unifont.cpp |
static LibError |
UniFont_validate( const UniFont* f )
See unifont.cpp |
static inline uint |
unpack_to_8( u16 c, uint bits_below, uint num_bits )
See tex_dds.cpp |
static void |
upload_compressed_level( uint level, uint level_w, uint level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT ctx )
See ogl_tex.cpp |
static void |
upload_impl( Tex* t, GLenum fmt, GLint int_fmt, int levels_to_skip )
See ogl_tex.cpp |
static void |
upload_level( uint level, uint level_w, uint level_h, const u8* RESTRICT level_data, size_t UNUSED( level_data_size ), void* RESTRICT ctx )
See ogl_tex.cpp |
static void |
warn_if_uploaded( Handle ht, const OglTex* ot )
See ogl_tex.cpp |
static bool |
wrap_valid( GLint wrap )
See ogl_tex.cpp |
| Macro Summary | |
#define |
CHECK_TEX(t) RETURN_ERR(tex_validate(t))
See tex.cpp |
#define |
REGISTER_CODEC(name) extern void name##_register() name##_register()
See tex_codec.cpp |
#define |
TEX_CODEC_REGISTER(namestatic) TexCodecVTbl vtbl = {name##_decode, name##_encode, name##_transform,name##_is_hdr, name##_is_ext, name##_hdr_size,#name}void name##_register() { tex_codec_register(&vtbl) }
build codec vtbl and register it. |
| Field Detail |
static glyphmap_id* BoundGlyphs;
static const TexCodecVTbl* codecs;
static GLint default_filter;
static uint default_q_flags;
static int global_orientation;
static int have_auto_mipmap_gen;
static int have_s3tc;
const int TEX_BASE_LEVEL_ONLY;
| Method Detail |
static inline uint access_bit_tbl( u32 tbl, uint idx, uint bit_width );
static inline uint access_bit_tbl64( u64 tbl, uint idx, uint bit_width );
static void add_level_size( uint UNUSED( level ), uint UNUSED( level_w ), uint UNUSED( level_h ), const u8* RESTRICT UNUSED( level_data ), size_t level_data_size, void* RESTRICT ctx );
static LibError add_mipmaps( Tex* t, uint w, uint h, uint bpp, void* new_data, size_t data_size );
static LibError bmp_decode( DynArray* RESTRICT da, Tex* RESTRICT t );
static LibError bmp_encode( Tex* RESTRICT t, DynArray* RESTRICT da );
static size_t bmp_hdr_size( const u8* file );
static bool bmp_is_ext( const char* ext );
static bool bmp_is_hdr( const u8* file );
static LibError bmp_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) );
cassert( sizeof( JOCTET )== 1&& CHAR_BIT == 8 );
static GLint choose_fmt( uint bpp, uint flags );
static GLint choose_int_fmt( GLenum fmt, uint q_flags );
static void create_level( uint level, uint level_w, uint level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT ctx );
LibError cursor_draw( const char* name, int x, int y );
static void Cursor_dtor( Cursor* c );
static LibError cursor_free( Handle& h );
static void Cursor_init( Cursor* UNUSED( c ), va_list UNUSED( args ) );
static Handle cursor_load( const char* name );
static LibError Cursor_reload( Cursor* c, const char* name, Handle );
static LibError Cursor_to_string( const Cursor* c, char* buf );
static LibError Cursor_validate( const Cursor* c );
static LibError dds_decode( DynArray* RESTRICT da, Tex* RESTRICT t );
static LibError dds_encode( Tex* RESTRICT UNUSED( t ), DynArray* RESTRICT UNUSED( da ) );
static size_t dds_hdr_size( const u8* UNUSED( file ) );
static bool dds_is_ext( const char* ext );
static bool dds_is_hdr( const u8* file );
static LibError dds_transform( Tex* t, uint transforms );
static LibError decode_pf( const DDPIXELFORMAT* pf, uint* bpp_, uint* flags_ );
static LibError decode_sd( const DDSURFACEDESC2* sd, uint* w_, uint* h_, uint* bpp_, uint* flags_ );
static void detect_gl_upload_caps();
static LibError do_load_shader( Ogl_Program* p, const char* filename, Handle UNUSED( h ), const CXeromyces& XeroFile, const XMBElement& Shader );
METHODDEF( boolean ) dst_empty_output_buffer( j_compress_ptr cinfo );
METHODDEF( void ) dst_init( j_compress_ptr cinfo );
GLOBAL( void ) dst_prepare( j_compress_ptr cinfo, DynArray* da );
METHODDEF( void ) dst_term( j_compress_ptr cinfo );
METHODDEF( void ) err_error_exit( j_common_ptr cinfo );
METHODDEF( void ) err_output_message( j_common_ptr cinfo );
ERROR_ASSOCIATE( ERR::SHDR_NO_SHADER,"Invalid shader reference",-1 );
ERROR_ASSOCIATE( ERR::SHDR_COMPILE,"Shader compile failed",-1 );
ERROR_ASSOCIATE( ERR::SHDR_LINK,"Shader linking failed",-1 );
ERROR_ASSOCIATE( ERR::SHDR_CREATE,"Shader creation failed",-1 );
ERROR_ASSOCIATE( ERR::SHDR_NO_PROGRAM,"Invalid shader program reference",-1 );
ERROR_ASSOCIATE( INFO::TEX_CODEC_CANNOT_HANDLE,"Texture codec cannot handle the given format",-1 );
ERROR_ASSOCIATE( ERR::TEX_INVALID_SIZE,"Texture size is incorrect",-1 );
ERROR_ASSOCIATE( WARN::TEX_INVALID_DATA,"Warning: invalid texel data encountered",-1 );
ERROR_ASSOCIATE( ERR::TEX_COMPRESSED,"Unsupported texture compression",-1 );
ERROR_ASSOCIATE( ERR::TEX_INVALID_LAYOUT,"Unsupported texel layout, e.g. right-to-left",-1 );
ERROR_ASSOCIATE( ERR::TEX_NOT_8BIT_PRECISION,"Not 8-bit channel precision",-1 );
ERROR_ASSOCIATE( ERR::TEX_INVALID_COLOR_TYPE,"Invalid color type",-1 );
ERROR_ASSOCIATE( ERR::TEX_FMT_INVALID,"Invalid/unsupported texture format",-1 );
static void file_buf_dtor( void* p, size_t UNUSED( size ), uintptr_t UNUSED( ctx ) );
static bool filter_uses_mipmaps( GLint filter );
static bool filter_valid( GLint filter );
static void flip_to_global_orientation( Tex* t );
static bool fmt_is_s3tc( GLenum fmt );
static LibError get_mipmaps( Tex* t, GLint filter, uint q_flags, int* plevels_to_skip );
void glvwprintf( const wchar_t* fmt, va_list args );
void glwprintf( const wchar_t* fmt,... );
H_TYPE_DEFINE( Cursor );
H_TYPE_DEFINE( UniFont );
H_TYPE_DEFINE( Ogl_Program );
H_TYPE_DEFINE( Ogl_Shader );
H_TYPE_DEFINE( OglTex );
static void io_flush( png_structp UNUSED( png_ptr ) );
static void io_read( png_struct* png_ptr, u8* data, png_size_t length );
static void io_write( png_struct* png_ptr, u8* data, png_size_t length );
static bool is_valid_dxt( uint dxt );
static LibError jpg_decode( DynArray* RESTRICT da, Tex* RESTRICT t );
static LibError jpg_decode_impl( DynArray* da, jpeg_decompress_struct* cinfo, Handle& img_hm, RowArray& rows, Tex* t );
static LibError jpg_encode( Tex* RESTRICT t, DynArray* RESTRICT da );
static LibError jpg_encode_impl( Tex* t, jpeg_compress_struct* cinfo, RowArray& rows, DynArray* da );
static size_t jpg_hdr_size( const u8* UNUSED( file ) );
static bool jpg_is_ext( const char* ext );
static bool jpg_is_hdr( const u8* file );
static LibError jpg_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) );
static void* load_empty_sys_cursor();
static void* load_sys_cursor( const char* filename, int hx, int hy );
static void make_room_in_buffer( j_compress_ptr cinfo );
static inline void mix_2_3( uint dst[ 4], uint c0[ 4], uint c1[ 4] );
static inline void mix_avg( uint dst[ 4], uint c0[ 4], uint c1[ 4] );
static void Ogl_Program_dtor( Ogl_Program* p );
void ogl_program_free( Handle& h );
GLint ogl_program_get_attrib_location( Handle h, const char* name );
GLint ogl_program_get_uniform_location( Handle h, const char* name );
static void Ogl_Program_init( Ogl_Program* UNUSED( p ), va_list UNUSED( args ) );
Handle ogl_program_load( const char* fn );
static LibError Ogl_Program_reload( Ogl_Program* p, const char* filename, Handle h );
static LibError Ogl_Program_to_string( const Ogl_Program* UNUSED( p ), char* buf );
LibError ogl_program_use( Handle h );
static LibError Ogl_Program_validate( const Ogl_Program* UNUSED( p ) );
LibError ogl_shader_attach( GLhandleARB program, Handle& h );
static void Ogl_Shader_dtor( Ogl_Shader* shdr );
void ogl_shader_free( Handle& h );
static void Ogl_Shader_init( Ogl_Shader* shdr, va_list args );
Handle ogl_shader_load( const char* fn, GLenum type );
static LibError Ogl_Shader_reload( Ogl_Shader* shdr, const char* filename, Handle UNUSED( h ) );
static LibError Ogl_Shader_to_string( const Ogl_Shader* UNUSED( shdr ), char* buf );
static LibError Ogl_Shader_validate( const Ogl_Shader* UNUSED( shdr ) );
LibError ogl_tex_bind( Handle ht, uint unit );
Handle ogl_tex_find( const char* fn );
LibError ogl_tex_free( Handle& ht );
LibError ogl_tex_get_data( Handle ht, void** p );
LibError ogl_tex_get_format( Handle ht, uint* flags, GLenum* fmt );
LibError ogl_tex_get_size( Handle ht, uint* w, uint* h, uint* bpp );
Handle ogl_tex_load( const char* fn, uint flags );
void ogl_tex_override( OglTexOverrides what, OglTexAllow allow );
void ogl_tex_set_defaults( uint q_flags, GLint filter );
LibError ogl_tex_set_filter( Handle ht, GLint filter );
LibError ogl_tex_set_wrap( Handle ht, GLint wrap );
LibError ogl_tex_transform( Handle ht, uint transforms );
LibError ogl_tex_transform_to( Handle ht, uint new_flags );
LibError ogl_tex_upload( const Handle ht, GLenum fmt_ovr, uint q_flags_ovr, GLint int_fmt_ovr );
Handle ogl_tex_wrap( Tex* t, const char* fn, uint flags );
static void OglTex_dtor( OglTex* ot );
static void OglTex_init( OglTex* ot, va_list args );
static LibError OglTex_reload( OglTex* ot, const char* fn, Handle h );
static LibError OglTex_to_string( const OglTex* ot, char* buf );
static LibError OglTex_validate( const OglTex* ot );
static LibError plain_transform( Tex* t, uint transforms );
static LibError png_decode( DynArray* RESTRICT da, Tex* RESTRICT t );
static LibError png_decode_impl( DynArray* da, png_structp png_ptr, png_infop info_ptr, Handle& img_hm, RowArray& rows, Tex* t );
static LibError png_encode( Tex* RESTRICT t, DynArray* RESTRICT da );
static LibError png_encode_impl( Tex* t, png_structp png_ptr, png_infop info_ptr, RowArray& rows, DynArray* da );
static size_t png_hdr_size( const u8* UNUSED( file ) );
static bool png_is_ext( const char* ext );
static bool png_is_hdr( const u8* file );
static LibError png_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) );
static bool q_flags_valid( uint q_flags );
static LibError s3tc_decompress( Tex* t );
static void s3tc_decompress_level( uint UNUSED( level ), uint level_w, uint level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT ctx );
static void s3tc_precalc_alpha( uint dxt, const u8* RESTRICT a_block, S3tcBlock* RESTRICT b );
static void s3tc_precalc_block( uint dxt, const u8* RESTRICT block, S3tcBlock* RESTRICT b );
static void s3tc_precalc_color( uint dxt, const u8* RESTRICT c_block, S3tcBlock* RESTRICT b );
static void s3tc_write_pixel( const S3tcBlock* RESTRICT b, uint pixel_idx, u8* RESTRICT out );
static const char* shader_type_to_string( GLenum type, char* buf, size_t buflen );
METHODDEF( boolean ) src_fill_buffer( j_decompress_ptr cinfo );
METHODDEF( void ) src_init( j_decompress_ptr UNUSED( cinfo ) );
GLOBAL( void ) src_prepare( j_decompress_ptr cinfo, DynArray* da );
METHODDEF( void ) src_skip_data( j_decompress_ptr cinfo, long num_bytes );
METHODDEF( void ) src_term( j_decompress_ptr UNUSED( cinfo ) );
static void state_latch( OglTexState* ots );
static void state_set_to_defaults( OglTexState* ots );
static GLenum string_to_shader_type( const char* name );
LibError tex_codec_alloc_rows( const u8* data, size_t h, size_t pitch, uint src_flags, uint dst_orientation, RowArray& rows );
LibError tex_codec_for_filename( const char* fn, const TexCodecVTbl** c );
LibError tex_codec_for_header( const u8* file, size_t file_size, const TexCodecVTbl** c );
const TexCodecVTbl* tex_codec_next( const TexCodecVTbl* prev_codec );
int tex_codec_register( TexCodecVTbl* c );
TEX_CODEC_REGISTER( dds );
TEX_CODEC_REGISTER( bmp );
TEX_CODEC_REGISTER( tga );
TEX_CODEC_REGISTER( png );
TEX_CODEC_REGISTER( jpg );
void tex_codec_register_all();
LibError tex_codec_transform( Tex* t, uint transforms );
LibError tex_codec_write( Tex* t, uint transforms, const void* hdr, size_t hdr_size, DynArray* da );
LibError tex_decode( const u8* data, size_t data_size, MEM_DTOR dtor, Tex* t );
LibError tex_encode( Tex* t, const char* fn, DynArray* da );
LibError tex_free( Tex* t );
u8* tex_get_data( const Tex* t );
size_t tex_hdr_size( const char* fn );
size_t tex_img_size( const Tex* t );
bool tex_is_known_extension( const char* filename );
LibError tex_load( const char* fn, Tex* t, uint file_flags );
bool tex_orientations_match( uint src_flags, uint dst_orientation );
void tex_set_global_orientation( int o );
LibError tex_transform( Tex* t, uint transforms );
LibError tex_transform_to( Tex* t, uint new_flags );
void tex_util_foreach_mipmap( uint w, uint h, uint bpp, const u8* RESTRICT data, int levels_to_skip, uint data_padding, MipmapCB cb, void* RESTRICT ctx );
LibError tex_validate( const Tex* t );
LibError tex_validate_plain_format( uint bpp, uint flags );
LibError tex_wrap( uint w, uint h, uint bpp, uint flags, void* img, Tex* t );
LibError tex_write( Tex* t, const char* fn );
static LibError tga_decode( DynArray* RESTRICT da, Tex* RESTRICT t );
static LibError tga_encode( Tex* RESTRICT t, DynArray* RESTRICT da );
static size_t tga_hdr_size( const u8* file );
static bool tga_is_ext( const char* ext );
static bool tga_is_hdr( const u8* file );
static LibError tga_transform( Tex* UNUSED( t ), uint UNUSED( transforms ) );
TIMER_ADD_CLIENT( tc_transform );
TIMER_ADD_CLIENT( tc_png_decode );
TIMER_ADD_CLIENT( tc_plain_transform );
LibError unifont_bind( const Handle h );
int unifont_character_width( const Handle h, wchar_t c );
static void UniFont_dtor( UniFont* f );
int unifont_height( const Handle h );
static void UniFont_init( UniFont* UNUSED( f ), va_list UNUSED( args ) );
int unifont_linespacing( const Handle h );
Handle unifont_load( const char* fn, uint flags );
static LibError UniFont_reload( UniFont* f, const char* fn, Handle UNUSED( h ) );
LibError unifont_stringsize( const Handle h, const wchar_t* text, int& width, int& height );
static LibError UniFont_to_string( const UniFont* f, char* buf );
LibError unifont_unload( Handle& h );
static LibError UniFont_validate( const UniFont* f );
static inline uint unpack_to_8( u16 c, uint bits_below, uint num_bits );
static void upload_compressed_level( uint level, uint level_w, uint level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT ctx );
static void upload_impl( Tex* t, GLenum fmt, GLint int_fmt, int levels_to_skip );
static void upload_level( uint level, uint level_w, uint level_h, const u8* RESTRICT level_data, size_t UNUSED( level_data_size ), void* RESTRICT ctx );
static void warn_if_uploaded( Handle ht, const OglTex* ot );
static bool wrap_valid( GLint wrap );
| Symbol Detail |
#define ALLOW_SYS_CURSOR 0
#define BI_RGB 0
#define DDPF_ALPHAPIXELS 0x00000001
#define DDPF_FOURCC 0x00000004
#define DDPF_RGB 0x00000040
#define DDSCAPS2_CUBEMAP 0x00000200
#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
#define DDSCAPS2_VOLUME 0x00200000
#define DDSCAPS_COMPLEX 0x00000008
#define DDSCAPS_MIPMAP 0x00400000
#define DDSCAPS_TEXTURE 0x00001000
#define DDSD_CAPS 0x00000001
#define DDSD_DEPTH 0x00800000
#define DDSD_HEIGHT 0x00000002
#define DDSD_LINEARSIZE 0x00080000
#define DDSD_MIPMAPCOUNT 0x00020000
#define DDSD_PITCH 0x00000008
#define DDSD_PIXELFORMAT 0x00001000
#define DDSD_WIDTH 0x00000004
#define INCLUDED_GRAPHICS_CURSOR
#define INCLUDED_OGL_SHADER
#define INCLUDED_OGL_TEX
#define INCLUDED_TEX
#define INCLUDED_TEX_CODEC
#define INCLUDED_TEX_INTERNAL
#define INCLUDED_UNIFONT
#define OUTPUT_BUF_SIZE 64*KiB
| Macro Detail |
#define CHECK_TEX(t) RETURN_ERR(tex_validate(t))
#define REGISTER_CODEC(name) extern void name##_register(); name##_register()
#define TEX_CODEC_REGISTER(namestatic) TexCodecVTbl vtbl = {name##_decode, name##_encode, name##_transform,name##_is_hdr, name##_is_ext, name##_hdr_size,#name};void name##_register() { tex_codec_register(&vtbl); }
|
0 A.D.
Generated on September 04, 2007 at 18:13 CppDoc v2.4.0 |
|||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||