Compounds | |
struct | _paramlist |
struct | _texlist |
class | coneseg |
struct | config |
class | cylinder |
class | cylindercaps |
class | empty |
class | fbo_switch |
class | flat |
class | house |
class | item |
class | itemlist |
class | model |
class | pseudocylinder |
class | scene |
class | texlist |
class | tshader |
Defines | |
#define | apptitle "Flame" |
#define | VERSION "0.1.0" |
#define | GLUT_MOUSE 10000 |
#define | DIM3D 32 |
#define | FBTYPE GL_TEXTURE_2D |
#define | check_ext(x) if (!x) fatalf(#x " required!"); |
Typedefs | |
typedef float | float3 [3] |
typedef unsigned int | uint |
typedef int | tex3d [DIM3D][DIM3D][DIM3D] |
typedef unsigned char | ub4 [4] |
typedef float | f3 [3] |
typedef float | f2 [2] |
typedef _paramlist | paramlist |
typedef tshader * | shader |
typedef _texlist | tex_list |
Functions | |
uint | gettickcount (void) |
void | generate3d (tex3d *tex3) |
void | normalize3 (float *vec) |
void | material_reset (texture *tex, shader vshader, shader fshader) |
void | material (texture *tex, shader vshader, shader fshader, ub4 color) |
float | size2 (float3 v) |
void | mouseCenter (void) |
void | mouseHandler (int x, int y) |
void | quit (void) |
void | kbd (int c, int is_down) |
void | mouseButtonHandler (int button, int is_down, int x, int y) |
void | skeyDownHandler (int c, int x, int y) |
void | skeyUpHandler (int c, int x, int y) |
void | keyDownHandler (unsigned char c, int x, int y) |
void | keyUpHandler (unsigned char c, int x, int y) |
GLuint | createScreenImage (int w, int h) |
void | initFBO (int w, int h) |
void | killFBO () |
void | resizeCallback (int x, int y) |
void | set2D (void) |
void | tick (void) |
void | set3D () |
void | fbo_use (int fbo, int clear_fbo) |
int | gl_ext (const char *what) |
int | init_fbo_func () |
void | loadWorld () |
void | fpsFrameEnd () |
void | cross (float *r, float *v1, float *v2) |
void | drawHud (void) |
void | setLight () |
void | drawWorld () |
void | displayCallback (void) |
void | idleHandler (void) |
void | setCallbacks (void) |
void | windowInit (void) |
void | createWindow (int w, int h, int *argc, char **argv) |
void | loadConfig (const char *filename) |
int | main (int argc, char **argv) |
Variables | |
int | mousex |
int | mousey |
int | omousex = -1 |
int | omousey = -1 |
int | maxx |
int | maxy |
int | ms_last |
float | ms_curr |
int | wireframe |
int | help |
double | angle1 |
double | angle2 = 0.5 |
float3 | eye |
float3 | eye_d |
float3 | eye_u |
float3 | fogcolor = {0.25,0.25,0.8} |
float | sensitivity = 0.015 |
float | kb_sensitivity = 20 |
float | fov = 90 |
float | radius = 40 |
float | clipfront = 0.001 |
float | clipback = 250 |
char * | font_texture_name = strdup("font.tga") |
char * | scene_filename = strdup("scene.txt") |
int | use_fbo = 1 |
uint | buffer2 |
tex3d | t3data [2] |
GLuint | t3 [2] |
ub4 | white = {255,255,255,255} |
ub4 | black = {0,0,0,255} |
GLuint | fbo_tex |
int | gwin |
float | radiusdelta = 0 |
GLuint | fbuf [2] |
GLuint | rbuf_depth [2] |
GLuint | fb_image [2] |
GLenum | fb_buf [2] = {GL_COLOR_ATTACHMENT0_EXT,GL_BACK_LEFT} |
GLenum | screen_buf = GL_BACK_LEFT |
int | last_tick = gettickcount() |
texlist * | tl = new texlist() |
char * | ext |
scene * | world |
int | last_ftick = gettickcount() |
int | last_frames = 0 |
int | width = 800 |
int | height = 600 |
int | fullscreen = 0 |
config | cfg [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parameter list for shaders |
|
pointer to shader class |
|
|
|
texture list. |
|
|
|
|
|
Create and return texture with same dimensions as screen |
|
initialize OpenGL, create window ...
|
|
cross product of 2 vectors (3 component vectors)
|
|
callback used when needed to update display |
|
draw HUD (including fps information) |
|
draw entire world (scene, lighting ... ) |
|
use framebuffer numbered 0 or 1. Set fbo_tex texture to the content of second framebuffer -1: copy FBO 0 to screen, show screen |
|
conpute fps information at end of frame |
|
generate 3d texture with noise
|
|
return number of miliseconds since start |
|
true - extension is supported. false - not supported
|
|
idle callback (called when application is idle) |
|
initialize functions needed for EXT_framebuffer_object. Return false if no FBO support in card/drivers |
|
create two offscreen buffers |
|
keyboard press handler |
|
key press handler |
|
key release handler |
|
destroy FB objects |
|
load configuration from a file |
|
load entire wirld, generate textures, etc ... |
|
main function |
|
set material for OpenGL - color, texture, pixel and framgent shaders |
|
reset material - remove textures from texturing units in shaders |
|
mouse button press/release handler |
|
center mouse - move mouse pointer in screen center |
|
mouse move handler |
|
normalize vector of 3 floats
|
|
Quit routine |
|
callback called when resizing window |
|
set 2d projection (0,0 - maxx,maxy), turn off Z-buffer and backface culling |
|
set 3d projection |
|
register all callbacks |
|
set up lighting |
|
return size of the vector squared |
|
special key press handler |
|
special key release handler |
|
timer function called each frame |
|
set up small details based on platform |
|
|
|
|
|
|
|
|
|
Initial value: { {"width",&width,'i',320,4096}, {"height",&height,'i',200,4096}, {"fullscreen",&fullscreen,'i',0,1}, {"font_x",&fontsizex,'f',8,64}, {"font_y",&fontsizey,'f',16,64}, {"sensitivity",&sensitivity,'f',0.001,1000}, {"kbsensitivity",&kb_sensitivity,'f',0.001,1000}, {"fov",&fov,'f',5,175}, {"font",&font_texture_name,'s',0,0}, {"scene",&scene_filename,'s',0,0}, {"usefbo",&use_fbo,'i',0,1}, } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 textures holding offscreen framebuffer image |
|
texture pointing to the second framebuffer (other one than rendering target) |
|
2 offscreen framebuffers |
|
|
|
name of texture containing font |
|
|
|
attempt fullscreen? |
|
GLUT window handle |
|
height of window |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 offscreen renderbuffers |
|
name of file containing scene definition |
|
|
|
|
|
|
|
|
|
One texture list for entire program |
|
if true, framebuffer extension will be used |
|
|
|
width of window |
|
|
|
|