#ifndef NEBULUS_H #include #include #include #include "SDL_opengl.h" #ifdef HAVE_LIBSDL_TTF #include "SDL_ttf.h" #endif #ifndef PI #define PI 3.14159265358979323846 #endif #define PI2 6.28318530717958647692 #define NUM_BANDS 16 #define BEAT_MAX 100 #define T_AVERAGE_SPECTRAL 100 #define FRAME_AVG 30 #define FRAME_BASE 50 #define EFFECT_NUMBER 9 #define SIZE_GLTHREADS 256 #define SIZE_PARTICULE 64 #define PARTICULE_COUNT 768 #define _(String) gettext (String) typedef struct nebulus { GLint WIDTH; GLint HEIGHT; GLuint effect; GLuint old_effect; GLint beat; GLint old_beat; GLint max_fps; GLint old_max_fps; GLint infos; GLfloat energy; gboolean paused; gboolean fullscreen; gboolean mouse; gboolean finished; gboolean in_thread; gboolean init; gboolean changement; gboolean freeze; gboolean config_load; gboolean active_mutex; } nebulus; typedef struct { char *name; int value; } effect; typedef struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ unsigned char pixel_data[64 * 64 * 3 + 1]; } image_s64; typedef struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ unsigned char pixel_data[128 * 128 * 3 + 1]; } image_s128; typedef struct { GLfloat x, y, z; } glcoord; typedef struct { long double currentAge; int maximumAge; int ageRangeMinimum; int ageRangeMaximum; glcoord position; glcoord velocity; glcoord impulse; glcoord color; glcoord *target_position; glcoord *target_velocity; glcoord *target_impulse; } particle; #ifdef HAVE_LIBSDL_TTF typedef struct { char *title; int pos, size; gboolean title_refresh; TTF_Font *font; TTF_Font *fps; } ttf_font; #endif extern nebulus general; extern nebulus *point_general; extern effect my_effect[EFFECT_NUMBER]; extern effect my_effect_old[EFFECT_NUMBER]; extern image_s64 background_image; extern image_s128 tunnel_image; extern image_s64 tentacle_image; extern image_s128 twist_image; extern image_s128 child_image; extern image_s128 energy_image; extern GLfloat scale, heights[16][16]; extern gint16 pcm_data[512]; extern float framerate; extern gboolean face_first, tentacles_first, child_first, tunnel_first; extern gboolean glthreads_first; extern gboolean create_knot, create_quadratic; extern GLuint blurtexture, knotbg, tunnel, tentacle, twist, twistbg; extern GLuint texchild, childbg, energy, glthreads, particule; extern GLuint facedl, cubedl, childdl; extern GLint *blur_data[128*128*4]; extern GLUquadricObj *myquadratic; extern unsigned char buffer_glthreads[SIZE_GLTHREADS * SIZE_GLTHREADS * 3]; extern unsigned char buffer_particule[SIZE_PARTICULE * SIZE_PARTICULE * 3]; extern GLfloat y_angle, y_speed, y_old_speed; extern GLfloat x_angle, x_speed; extern GLfloat z_angle, z_speed; extern GLfloat yk_angle, yk_speed, yk_old_speed; extern GLfloat xk_angle, xk_speed; extern GLfloat zk_angle, zk_speed; extern GLfloat speed_bg, old_speed_bg; extern GLfloat elapsed_time, last_time; extern char section_name[]; extern void nebulus_config(void); extern void init_gl(void); extern void draw_scene(void); extern void drawblur(GLfloat times, GLfloat inc, GLfloat spost); extern void draw_knot(void); extern void draw_spectrum(void); extern void draw_face(void); extern void draw_glthreads(void); extern void draw_tunnel(void); extern void draw_tentacles(void); extern void draw_twist(void); extern void draw_child(void); extern void draw_energy(void); extern GLfloat reduce_vsync(GLfloat rotate); extern GLfloat reduce_vsync_inv(GLfloat rotate); extern void draw_background(gint mode); extern void precalculate_tunnel(void); extern void precalculate_glthreads(void); extern void recalc_perspective(void); extern void viewortho(void); extern void viewperspective(void); extern gboolean gen_gl_texture(GLuint texture); extern void use_gl_texture(GLuint texture); extern void delete_gl_texture(GLuint texture); extern void use_glthreads_texture(void); extern void use_particule_texture(void); extern void use_twist_texture(void); extern void use_child_texture(void); extern void use_energy_texture(void); extern void use_tunnel_texture(void); extern void use_background_texture(void); extern void draw_background(gboolean mode); extern void config_load(void); #endif