Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

texture.h File Reference


Compounds

struct  texture
struct  tgafile
struct  tgaheader

Defines

#define fs   '/'
#define fs2   '\\'
#define xdelta   (1.0/1024.0)
#define ydelta   (-1.0/256.0)

Functions

void glerr (char *x)
char * b_strncpy (char *dest, const char *source, size_t count)
char * b_strncat (char *dest, const char *source, size_t count)
int fsize (const char *f)
FILE * fopen2 (const char *s1, const char *s2, const char *m, uint *filesize)
int fs_loadfile (void **out, const char *name)
void gl_loadtex (int num, int bpp, int x, int y, void *tex)
void gl_loadtgatex (int num, tgafile *tex)
void fs_rgbfix (tgafile *t)
void fs_alphafix (tgafile *t)
tgafilefs_loadtgafile (const char *name)
void fs_failsafe_texture (texture *tex)
void * malloc0 (size_t t)
texturefs_loadtexture (const char *name)
texturefs_3dtexture (GLuint idtex)
void glchar (int c)
void gltext (const char *s)
void gltext_at (const char *s, float x, float y)

Variables

texturefailsafetex
texturetex_font
float fontsizex = 12
float fontsizey = 16

Define Documentation

#define fs   '/'
 

#define fs2   '\\'
 

#define xdelta   (1.0/1024.0)
 

#define ydelta   (-1.0/256.0)
 


Function Documentation

char* b_strncat char *    dest,
const char *    source,
size_t    count
 

jako strncat, ale pocet znaku je omezeni delky retezce celkem, vcetne NULL znaku, ne jen pridavaneho retezce

char* b_strncpy char *    dest,
const char *    source,
size_t    count
 

jako strncpy, ale posledni znak vzdy nastavi na NULL

FILE* fopen2 const char *    s1,
const char *    s2,
const char *    m,
uint   filesize
 

otevre soubor a vrati jeho velikost

texture* fs_3dtexture GLuint    idtex
 

Vytvori 3d texturu

void fs_alphafix tgafile   t
 

Spravi transparenci u textur. Pokud je vsude 0, tak ji nastavi vsude na 255

void fs_failsafe_texture texture   tex
 

vyrobi "defaultni" hnusnou texturu, ktera je pouzita kdyz textura chybi/nelze nahrat Je to tam aby to kvuli tomu nesletelo, ale textura je tak hnusna, ze toho ze tam chybi si asi kazdy hned vsimne

int fs_loadfile void **    out,
const char *    name
 

nahraje soubor do pameti, vrati velikost

texture* fs_loadtexture const char *    name
 

Nahraje texturu. Zvlada pouze TGA. Vrati jeji ID

tgafile* fs_loadtgafile const char *    name
 

nahraje tga texturu, vratin na ni pointer nebo NULL pri neuspechu

void fs_rgbfix tgafile   t
 

Targy jsou v BGR misto RGB ... tohle je zkonvertuje do spravneho formatu

int fsize const char *    f
 

vrati velikost souboru

void gl_loadtex int    num,
int    bpp,
int    x,
int    y,
void *    tex
 

nahraje texturu z pameti do pameti graficke karty, k texture navic vyrobi mipmapy

void gl_loadtgatex int    num,
tgafile   tex
 

nahraje texturu v pameti v .tga formatu do pameti graficke karty. Detaily viz loadtex

void glchar int    c
 

vyplivne na obrazovku jeden znak a posune matici

void glerr char *    x
 

debugging routine to write opengl errors

void gltext const char *    s
 

vyplivne na obrazovky retezec, rozeznama znak newline

void gltext_at const char *    s,
float    x,
float    y
 

vyplivne text na obrazovce posunuty o zadane souradnice

void* malloc0 size_t    t
 

naalokuje pamet a vyplni nulama. Vrati 0 pri selhani


Variable Documentation

texture* failsafetex
 

float fontsizex = 12
 

float fontsizey = 16
 

texture* tex_font