Fixed linux compilation, and some more coding style issues.
This commit is contained in:
parent
827b9adce2
commit
26d63ce844
@ -94,7 +94,7 @@ class ColoredTextureRectShader : public Shader<ColoredTextureRectShader,
|
|||||||
public TextureReadNew<ST_BILINEAR_FILTERED>
|
public TextureReadNew<ST_BILINEAR_FILTERED>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
GLuint m_quad_buffer = -1;
|
GLuint m_quad_buffer;
|
||||||
|
|
||||||
void initQuadBuffer()
|
void initQuadBuffer()
|
||||||
{
|
{
|
||||||
@ -168,16 +168,22 @@ static void drawTexColoredQuad(const video::ITexture *texture,
|
|||||||
col[3].getRed(), col[3].getGreen(), col[3].getBlue(), col[3].getAlpha(),
|
col[3].getRed(), col[3].getGreen(), col[3].getBlue(), col[3].getAlpha(),
|
||||||
};
|
};
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, ColoredTextureRectShader::getInstance()->m_color_vbo);
|
glBindBuffer(GL_ARRAY_BUFFER,
|
||||||
|
ColoredTextureRectShader::getInstance()->m_color_vbo);
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, 16 * sizeof(unsigned), colors);
|
glBufferSubData(GL_ARRAY_BUFFER, 0, 16 * sizeof(unsigned), colors);
|
||||||
|
|
||||||
ColoredTextureRectShader::getInstance()->use();
|
ColoredTextureRectShader::getInstance()->use();
|
||||||
glBindVertexArray(ColoredTextureRectShader::getInstance()->m_vao);
|
glBindVertexArray(ColoredTextureRectShader::getInstance()->m_vao);
|
||||||
|
|
||||||
ColoredTextureRectShader::getInstance()->setTextureUnits(static_cast<const irr::video::COpenGLTexture*>(texture)->getOpenGLTextureName());
|
const irr::video::COpenGLTexture *t =
|
||||||
ColoredTextureRectShader::getInstance()->setUniforms(
|
static_cast<const irr::video::COpenGLTexture*>(texture);
|
||||||
core::vector2df(center_pos_x, center_pos_y), core::vector2df(width, height),
|
ColoredTextureRectShader::getInstance()
|
||||||
core::vector2df(tex_center_pos_x, tex_center_pos_y), core::vector2df(tex_width, tex_height));
|
->setTextureUnits(t->getOpenGLTextureName());
|
||||||
|
ColoredTextureRectShader::getInstance()
|
||||||
|
->setUniforms(core::vector2df(center_pos_x, center_pos_y),
|
||||||
|
core::vector2df(width, height),
|
||||||
|
core::vector2df(tex_center_pos_x, tex_center_pos_y),
|
||||||
|
core::vector2df(tex_width, tex_height));
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user