Merge branch 'gles'
[neverball] / share / geom.h
1 #ifndef GEOM_H
2 #define GEOM_H
3
4 #include "solid_draw.h"
5
6 /*---------------------------------------------------------------------------*/
7
8 #define IMG_SHAD "png/shadow.png"
9
10 #define BACK_DIST   256.0f
11 #define FAR_DIST    512.0f
12 #define JUMP_HEIGHT   2.00f
13 #define SWCH_HEIGHT   2.00f
14 #define GOAL_HEIGHT   3.00f
15 #define GOAL_SPARKS  64
16
17 /*---------------------------------------------------------------------------*/
18
19 void geom_init(void);
20 void geom_free(void);
21
22 void goal_draw(struct s_rend *, float);
23 void jump_draw(struct s_rend *, float, int);
24 void swch_draw(struct s_rend *, int, int);
25 void flag_draw(struct s_rend *);
26 void mark_draw(struct s_rend *);
27 void vect_draw(struct s_rend *);
28 void back_draw(struct s_rend *, float);
29
30 /*---------------------------------------------------------------------------*/
31
32 void back_init(const char *s);
33 void back_free(void);
34 void back_draw_easy(void);
35
36 /*---------------------------------------------------------------------------*/
37
38 void shad_init(void);
39 void shad_free(void);
40 void shad_draw_set(void);
41 void shad_draw_clr(void);
42
43 /*---------------------------------------------------------------------------*/
44
45 enum
46 {
47     TEX_STAGE_TEXTURE,
48     TEX_STAGE_SHADOW,
49     TEX_STAGE_CLIP
50 };
51
52 struct tex_stage
53 {
54     GLenum unit;
55     int stage;
56 };
57
58 struct tex_env
59 {
60     void (*conf)(int, int);
61     size_t count;
62     struct tex_stage stages[4];
63 };
64
65 extern const struct tex_env tex_env_default;
66 extern const struct tex_env tex_env_shadow;
67 extern const struct tex_env tex_env_shadow_clip;
68
69 void tex_env_active(const struct tex_env *);
70 int  tex_env_stage(int);
71
72 /*---------------------------------------------------------------------------*/
73
74 void fade_draw(float);
75
76 #endif