Skip to content

Commit 92ce639

Browse files
Fix native presets
1 parent e6f1464 commit 92ce639

File tree

10 files changed

+48
-42
lines changed

10 files changed

+48
-42
lines changed

src/NativePresets/Makefile.am

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,11 @@ libRovastarDarkSecret_la_LDFLAGS = -avoid-version
3434
libRovastarDriftingChaos_la_LDFLAGS = -avoid-version
3535
libRovastarFractalSpiral_la_LDFLAGS = -avoid-version
3636
libRovastarFractopiaFrantic_la_LDFLAGS = -avoid-version
37+
38+
39+
libMstressJuppyDancer_la_LIBADD = ../libprojectM/libprojectM.la
40+
libRLGFractalDrop7c_la_LIBADD = ../libprojectM/libprojectM.la
41+
libRovastarDarkSecret_la_LIBADD = ../libprojectM/libprojectM.la
42+
libRovastarDriftingChaos_la_LIBADD = ../libprojectM/libprojectM.la
43+
libRovastarFractalSpiral_la_LIBADD = ../libprojectM/libprojectM.la
44+
libRovastarFractopiaFrantic_la_LIBADD = ../libprojectM/libprojectM.la

src/libprojectM/Renderer/Filters.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void Brighten::Draw(RenderContext &context)
2828
{
2929
glUseProgram(context.programID_v2f_c4f);
3030

31-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
31+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
3232

3333
glBindVertexArray(m_vaoID);
3434

@@ -61,7 +61,7 @@ void Darken::Draw(RenderContext &context)
6161
{
6262
glUseProgram(context.programID_v2f_c4f);
6363

64-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
64+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
6565

6666
glVertexAttrib4f(1, 1.0, 1.0, 1.0, 1.0);
6767

@@ -92,7 +92,7 @@ void Invert::Draw(RenderContext &context)
9292

9393
glUseProgram(context.programID_v2f_c4f);
9494

95-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
95+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
9696

9797
glVertexAttrib4f(1, 1.0, 1.0, 1.0, 1.0);
9898

@@ -122,7 +122,7 @@ void Solarize::Draw(RenderContext &context)
122122
{
123123
glUseProgram(context.programID_v2f_c4f);
124124

125-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
125+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
126126

127127
glVertexAttrib4f(1, 1.0, 1.0, 1.0, 1.0);
128128

src/libprojectM/Renderer/MilkdropWaveform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void MilkdropWaveform::Draw(RenderContext &context)
7373
mat_vertex = mat_scale * mat_vertex;
7474
mat_vertex = mat_rotation * mat_vertex;
7575
mat_vertex = mat_second_translation * mat_vertex;
76-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(mat_vertex));
76+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(mat_vertex));
7777

7878
if(modulateAlphaByVolume) ModulateOpacityByVolume(context);
7979
else temp_a = a;

src/libprojectM/Renderer/Renderable.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void DarkenCenter::Draw(RenderContext &context)
7272

7373
glUseProgram(context.programID_v2f_c4f);
7474

75-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
75+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
7676

7777
glBindVertexArray(m_vaoID);
7878

@@ -224,8 +224,8 @@ void Shape::Draw(RenderContext &context)
224224

225225
glUseProgram(context.programID_v2f_c4f_t2f);
226226

227-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
228-
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
227+
glUniformMatrix4fv(context.uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
228+
glUniform1i(context.uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
229229

230230
glBindVertexArray(m_vaoID_texture);
231231
glDrawArrays(GL_TRIANGLE_FAN, 0, sides+2);
@@ -261,7 +261,7 @@ void Shape::Draw(RenderContext &context)
261261

262262
glUseProgram(context.programID_v2f_c4f);
263263

264-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
264+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
265265

266266
glBindVertexArray(m_vaoID_not_texture);
267267
glDrawArrays(GL_TRIANGLE_FAN,0,sides+2);
@@ -287,7 +287,7 @@ void Shape::Draw(RenderContext &context)
287287

288288
glUseProgram(context.programID_v2f_c4f);
289289

290-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
290+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
291291

292292
glVertexAttrib4f(1, border_r, border_g, border_b, border_a * masterAlpha);
293293

@@ -350,7 +350,7 @@ void MotionVectors::Draw(RenderContext &context)
350350

351351
glUseProgram(context.programID_v2f_c4f);
352352

353-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
353+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
354354

355355
#ifndef GL_TRANSITION
356356
if (length <= 0.0) {
@@ -360,7 +360,7 @@ void MotionVectors::Draw(RenderContext &context)
360360
}
361361
#endif
362362

363-
glUniform1f(ShaderEngine::Uniform_V2F_C4F_VertexPointSize(), length);
363+
glUniform1f(context.uniform_v2f_c4f_vertex_point_size, length);
364364
glVertexAttrib4f(1, r, g, b, a * masterAlpha);
365365

366366
glBindVertexArray(m_vaoID);
@@ -409,7 +409,7 @@ void Border::Draw(RenderContext &context)
409409

410410
glUseProgram(context.programID_v2f_c4f);
411411

412-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
412+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
413413

414414
glVertexAttrib4f(1, outer_r, outer_g, outer_b, outer_a * masterAlpha);
415415

src/libprojectM/Renderer/Renderable.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class RenderContext
2020
TextureManager *textureManager;
2121
GLuint programID_v2f_c4f;
2222
GLuint programID_v2f_c4f_t2f;
23+
GLint uniform_v2f_c4f_vertex_tranformation;
24+
GLint uniform_v2f_c4f_vertex_point_size;
25+
GLint uniform_v2f_c4f_t2f_vertex_tranformation;
26+
GLint uniform_v2f_c4f_t2f_frag_texture_sampler;
2327
glm::mat4 mat_ortho;
2428

2529
RenderContext();

src/libprojectM/Renderer/Renderer.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ Renderer::Renderer(int width, int height, int gx, int gy, BeatDetect *_beatDetec
109109
renderContext.programID_v2f_c4f = shaderEngine.programID_v2f_c4f;
110110
renderContext.programID_v2f_c4f_t2f = shaderEngine.programID_v2f_c4f_t2f;
111111

112+
renderContext.uniform_v2f_c4f_vertex_tranformation = shaderEngine.uniform_v2f_c4f_vertex_tranformation;
113+
renderContext.uniform_v2f_c4f_vertex_point_size = shaderEngine.uniform_v2f_c4f_vertex_point_size;
114+
renderContext.uniform_v2f_c4f_t2f_vertex_tranformation = shaderEngine.uniform_v2f_c4f_t2f_vertex_tranformation;
115+
renderContext.uniform_v2f_c4f_t2f_frag_texture_sampler = shaderEngine.uniform_v2f_c4f_t2f_frag_texture_sampler;
116+
112117
// Interpolation VAO/VBO's
113118
glGenBuffers(1, &m_vbo_Interpolation);
114119
glGenVertexArrays(1, &m_vao_Interpolation);
@@ -757,8 +762,8 @@ void Renderer::CompositeOutput(const Pipeline &pipeline, const PipelineContext &
757762

758763
shaderEngine.enableCompositeShader(currentPipe->compositeShader, pipeline, pipelineContext);
759764

760-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(renderContext.mat_ortho));
761-
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
765+
glUniformMatrix4fv(shaderEngine.uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(renderContext.mat_ortho));
766+
glUniform1i(shaderEngine.uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
762767

763768
//Overwrite anything on the screen
764769
glBlendFunc(GL_ONE, GL_ZERO);

src/libprojectM/Renderer/ShaderEngine.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,6 @@ std::string blur2_frag(
394394

395395

396396

397-
GLint ShaderEngine::UNIFORM_V2F_C4F_VERTEX_TRANFORMATION = 0;
398-
GLint ShaderEngine::UNIFORM_V2F_C4F_VERTEX_POINT_SIZE = 0;
399-
GLint ShaderEngine::UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION = 0;
400-
GLint ShaderEngine::UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER = 0;
401-
402-
403-
404397
ShaderEngine::ShaderEngine() : presetCompShaderLoaded(false), presetWarpShaderLoaded(false)
405398
{
406399
programID_v2f_c4f = CompileShaderProgram(v2f_c4f_vert, v2f_c4f_frag, "v2f_c4f");
@@ -409,10 +402,10 @@ ShaderEngine::ShaderEngine() : presetCompShaderLoaded(false), presetWarpShaderLo
409402
programID_blur1 = CompileShaderProgram(blur_vert, blur1_frag, "blur1");
410403
programID_blur2 = CompileShaderProgram(blur_vert, blur2_frag, "blur2");
411404

412-
UNIFORM_V2F_C4F_VERTEX_TRANFORMATION = glGetUniformLocation(programID_v2f_c4f, "vertex_transformation");
413-
UNIFORM_V2F_C4F_VERTEX_POINT_SIZE = glGetUniformLocation(programID_v2f_c4f, "vertex_point_size");
414-
UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION = glGetUniformLocation(programID_v2f_c4f_t2f, "vertex_transformation");
415-
UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER = glGetUniformLocation(programID_v2f_c4f_t2f, "texture_sampler");
405+
uniform_v2f_c4f_vertex_tranformation = glGetUniformLocation(programID_v2f_c4f, "vertex_transformation");
406+
uniform_v2f_c4f_vertex_point_size = glGetUniformLocation(programID_v2f_c4f, "vertex_point_size");
407+
uniform_v2f_c4f_t2f_vertex_tranformation = glGetUniformLocation(programID_v2f_c4f_t2f, "vertex_transformation");
408+
uniform_v2f_c4f_t2f_frag_texture_sampler = glGetUniformLocation(programID_v2f_c4f_t2f, "texture_sampler");
416409

417410
uniform_blur1_sampler = glGetUniformLocation(programID_blur1, "texture_sampler");
418411
uniform_blur1_c0 = glGetUniformLocation(programID_blur1, "_c0");
@@ -1302,8 +1295,8 @@ bool ShaderEngine::enableWarpShader(Shader &shader, const Pipeline &pipeline, co
13021295

13031296
glUseProgram(programID_v2f_c4f_t2f);
13041297

1305-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(mat_ortho));
1306-
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
1298+
glUniformMatrix4fv(uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(mat_ortho));
1299+
glUniform1i(uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
13071300

13081301
return false;
13091302
}

src/libprojectM/Renderer/ShaderEngine.hpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ class ShaderEngine
4949
static bool checkCompileStatus(GLuint shader, const std::string & shaderTitle);
5050
static bool linkProgram(GLuint programID);
5151

52-
static GLint Uniform_V2F_C4F_VertexTranformation() { return UNIFORM_V2F_C4F_VERTEX_TRANFORMATION; }
53-
static GLint Uniform_V2F_C4F_VertexPointSize() { return UNIFORM_V2F_C4F_VERTEX_POINT_SIZE; }
54-
static GLint Uniform_V2F_C4F_T2F_VertexTranformation() { return UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION; }
55-
static GLint Uniform_V2F_C4F_T2F_FragTextureSampler() { return UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER; }
5652

5753
GLuint programID_v2f_c4f;
5854
GLuint programID_v2f_c4f_t2f;
5955

56+
GLint uniform_v2f_c4f_vertex_tranformation;
57+
GLint uniform_v2f_c4f_vertex_point_size;
58+
GLint uniform_v2f_c4f_t2f_vertex_tranformation;
59+
GLint uniform_v2f_c4f_t2f_frag_texture_sampler;
60+
6061
const static std::string v2f_c4f_vert;
6162
const static std::string v2f_c4f_frag;
6263
const static std::string v2f_c4f_t2f_vert;
@@ -114,11 +115,6 @@ class ShaderEngine
114115
GLuint programID_presetComp, programID_presetWarp;
115116

116117
bool presetCompShaderLoaded, presetWarpShaderLoaded;
117-
118-
static GLint UNIFORM_V2F_C4F_VERTEX_TRANFORMATION;
119-
static GLint UNIFORM_V2F_C4F_VERTEX_POINT_SIZE;
120-
static GLint UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION;
121-
static GLint UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER;
122118
};
123119

124120
#endif /* SHADERENGINE_HPP_ */

src/libprojectM/Renderer/VideoEcho.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ void VideoEcho::Draw(RenderContext &context)
8686

8787
glUseProgram(context.programID_v2f_c4f_t2f);
8888

89-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
90-
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
89+
glUniformMatrix4fv(context.uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
90+
glUniform1i(context.uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
9191

9292

9393
//Now Blend the Video Echo

src/libprojectM/Renderer/Waveform.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void Waveform::Draw(RenderContext &context)
8080

8181
glUseProgram(context.programID_v2f_c4f);
8282

83-
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
83+
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
8484

8585
if (additive) glBlendFunc(GL_SRC_ALPHA, GL_ONE);
8686
else glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -92,14 +92,14 @@ void Waveform::Draw(RenderContext &context)
9292
#ifndef GL_TRANSITION
9393
glPointSize(context.texsize <= 512 ? 2 : 2*context.texsize/512);
9494
#endif
95-
glUniform1f(ShaderEngine::Uniform_V2F_C4F_VertexPointSize(), context.texsize <= 512 ? 2 : 2*context.texsize/512);
95+
glUniform1f(context.uniform_v2f_c4f_vertex_point_size, context.texsize <= 512 ? 2 : 2*context.texsize/512);
9696
}
9797
else
9898
{
9999
#ifndef GL_TRANSITION
100100
glPointSize(context.texsize <= 512 ? 1 : context.texsize/512);
101101
#endif
102-
glUniform1f(ShaderEngine::Uniform_V2F_C4F_VertexPointSize(), context.texsize <= 512 ? 1 : context.texsize/512);
102+
glUniform1f(context.uniform_v2f_c4f_vertex_point_size, context.texsize <= 512 ? 1 : context.texsize/512);
103103
}
104104

105105
glBindVertexArray(m_vaoID);

0 commit comments

Comments
 (0)