Morph-SynRJ
view efx_rub.h @ 0:22de913c2d84
morph-synrj intro
| author | "Cedric Pinson <cedric.pinson@alcove.fr> <mornifle@plopbyte.net>" |
|---|---|
| date | Tue Nov 27 15:23:52 2007 +0100 (2007-11-27) |
| parents | |
| children |
line source
1 #ifndef EFX_RUB_H
2 #define EFX_RUB_H
5 #include "cmn_texture.h"
6 #include "mth_vector2.h"
7 #include "cmn_shape.h"
9 /*
10 * miniFMod
11 * include
12 * resource
13 */
14 #include "minifmod/minifmod.h"
15 extern FMUSIC_MODULE * intro_mod;
18 class efxRubShape_t : public cmnSquareShape_t
19 {
21 GLuint textureBase;
24 public:
26 efxRubShape_t():cmnSquareShape_t() { textureBase=0;}
27 mth::Vector3_t efxRubShape_t::GetNormalFace(int _i,int _j);
29 void Generate(int _nbElements,const char** _text,float _alpha,
30 GLuint _texture,int _xTex,int _yTex,
31 float _radius,float _length);
33 void SetTexture(GLuint _id) { textureBase=_id;}
35 void Init(int _xres,int _yres);
36 void Kill();
38 void Draw();
39 void DrawRow(int _row) const;
42 };
47 class efxRub_t
48 {
50 // rubbers
51 efxRubShape_t* rubbers;
52 int nbRubbers;
54 // morphed rubbers
55 efxRubShape_t morph;
57 // shared uvs
58 mth::Vector2_t* uvs;
60 public:
62 efxRub_t();
65 void Init(int _nbBuffers,int _xres,int _yres);
66 //void Update();
67 //void Draw();
68 void GenerateRandom(int _xTex,int _yTex,float _radius,float _length);
69 void Generate(int _xTex,int _yTex,float _radius,float _length,int _shape,const char** _elements,int _nbElements);
70 void MakeMorph(int _shape1,int _shape2,float _t);
71 void SetTexture(GLuint _id);
73 void PreDraw();
74 void PostDraw();
76 int NbShapes() { return nbRubbers;}
78 efxRubShape_t& Rubber(int _i) {return rubbers[_i];}
80 efxRubShape_t& MorphShape() { return morph;}
82 };
83 #endif
