18
18
19
19
#include " supertux/globals.hpp"
20
20
#include " video/color.hpp"
21
+ #include " video/gl.hpp"
21
22
#include " video/gl/gl_program.hpp"
22
23
#include " video/gl/gl_texture.hpp"
23
24
#include " video/gl/gl_texture_renderer.hpp"
24
25
#include " video/gl/gl_vertex_arrays.hpp"
25
26
#include " video/gl/gl_video_system.hpp"
26
27
#include " video/glutil.hpp"
28
+ #include < iostream>
27
29
28
30
GL33CoreContext::GL33CoreContext (GLVideoSystem& video_system) :
29
31
m_video_system(video_system),
@@ -185,6 +187,7 @@ GL33CoreContext::bind_texture(const Texture& texture, const Texture* displacemen
185
187
{
186
188
glActiveTexture (GL_TEXTURE0);
187
189
glBindTexture (GL_TEXTURE_2D, m_transparent_texture->get_handle ());
190
+ glUniform1i (m_program->get_is_displacement_location (), true );
188
191
}
189
192
else
190
193
{
@@ -197,6 +200,7 @@ GL33CoreContext::bind_texture(const Texture& texture, const Texture* displacemen
197
200
animate.y /= static_cast <float >(texture.get_image_height ());
198
201
199
202
glUniform2f (m_program->get_animate_location (), animate.x , animate.y );
203
+ glUniform1i (m_program->get_is_displacement_location (), false );
200
204
}
201
205
202
206
if (displacement_texture)
@@ -210,11 +214,13 @@ GL33CoreContext::bind_texture(const Texture& texture, const Texture* displacemen
210
214
animate.y /= static_cast <float >(displacement_texture->get_image_height ());
211
215
212
216
glUniform2f (m_program->get_displacement_animate_location (), animate.x , animate.y );
217
+ glUniform1i (m_program->get_is_displacement_location (), true );
213
218
}
214
219
else
215
220
{
216
221
glActiveTexture (GL_TEXTURE1);
217
222
glBindTexture (GL_TEXTURE_2D, m_grey_texture->get_handle ());
223
+ glUniform1i (m_program->get_is_displacement_location (), false );
218
224
}
219
225
220
226
assert_gl ();
0 commit comments