1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
#ifndef Renderer_HPP
#define Renderer_HPP
#include "FBO.hpp"
#include "PresetFrameIO.hpp"
#include "BeatDetect.hpp"
#include <string>
#include <pthread.h>
#ifdef USE_GLES1
#include <GLES/gl.h>
#else
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#endif
#ifdef USE_FTGL
#ifdef WIN32
#include <FTGL.h>
#include <FTGLPixmapFont.h>
#include <FTGLExtrdFont.h>
#else
#include <FTGL/FTGL.h>
#include <FTGL/FTGLPixmapFont.h>
#include <FTGL/FTGLExtrdFont.h>
#endif
#endif /** USE_FTGL */
class BeatDetect;
class TextureManager;
class Renderer
{
public:
bool showfps;
bool showtitle;
bool showpreset;
bool showhelp;
bool showstats;
bool studio;
bool correction;
bool noSwitch;
int totalframes;
float realfps;
std::string title;
int drawtitle;
int texsize;
Renderer( int width, int height, int gx, int gy, int texsize, BeatDetect *beatDetect, std::string presetURL, std::string title_fontURL, std::string menu_fontURL, int xpos, int ypos, bool usefbo );
~Renderer();
void RenderFrame(PresetOutputs *presetOutputs, PresetInputs *presetInputs);
void ResetTextures();
void reset(int w, int h);
GLuint initRenderToTexture();
void PerPixelMath(PresetOutputs *presetOutputs, PresetInputs *presetInputs);
void WaveformMath(PresetOutputs *presetOutputs, PresetInputs *presetInputs, bool isSmoothing);
void setPresetName(const std::string& theValue)
{
m_presetName = theValue;
}
std::string presetName() const
{
return m_presetName;
}
private:
RenderTarget *renderTarget;
BeatDetect *beatDetect;
TextureManager *textureManager;
//per pixel equation variables
float **gridx; //grid containing interpolated mesh
float **gridy;
float **origx2; //original mesh
float **origy2;
int gx;
int gy;
std::string m_presetName;
int vx;
int vy;
int vw;
int vh;
bool useFBO;
float aspect;
pthread_mutex_t _renderer_lock;
#ifdef USE_FTGL
FTGLPixmapFont *title_font;
FTGLPixmapFont *other_font;
FTGLExtrdFont *poly_font;
#endif /** USE_FTGL */
std::string title_fontURL;
std::string menu_fontURL;
std::string presetURL;
void draw_waveform(PresetOutputs * presetOutputs);
void Interpolation(PresetOutputs *presetOutputs, PresetInputs *presetInputs);
void rescale_per_pixel_matrices();
void maximize_colors(PresetOutputs *presetOutputs);
void render_texture_to_screen(PresetOutputs *presetOutputs);
void render_texture_to_studio(PresetOutputs *presetOutputs, PresetInputs *presetInputs);
void draw_fps( float realfps );
void draw_stats(PresetInputs *presetInputs);
void draw_help( );
void draw_preset();
void draw_title();
void draw_title_to_screen(bool flip);
void maximize_colors();
void draw_title_to_texture();
void draw_motion_vectors(PresetOutputs *presetOutputs);
void draw_borders(PresetOutputs *presetOutputs);
void draw_shapes(PresetOutputs *presetOutputs);
void draw_custom_waves(PresetOutputs *presetOutputs);
void modulate_opacity_by_volume(PresetOutputs *presetOutputs) ;
void darken_center();
};
#endif
|