Skip to content

Rewrite stamp #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 31, 2024
Merged
Prev Previous commit
Next Next commit
TargetPainter: Use GL_TRIANGLES instead of GL_TRIANGLE_STEP
  • Loading branch information
adazem009 committed Oct 31, 2024
commit a103b966acf37be1ee27f3207272c40eaeeed601
6 changes: 2 additions & 4 deletions src/targetpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ void TargetPainter::paint(QNanoPainter *painter)
Q_ASSERT(shaderProgram->isLinked());

// Set up vertex data and buffers for a quad
float vertices[] = {
-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
};
float vertices[] = { -1.0f, -1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f };

GLuint VBO, VAO;
glF.glGenVertexArrays(1, &VAO);
Expand All @@ -95,7 +93,7 @@ void TargetPainter::paint(QNanoPainter *painter)
glF.glActiveTexture(GL_TEXTURE0);
glF.glBindTexture(GL_TEXTURE_2D, texture.handle());
shaderManager->setUniforms(shaderProgram, 0, QSize(m_target->costumeWidth(), m_target->costumeHeight()), effects); // set texture and effect uniforms
glF.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glF.glDrawArrays(GL_TRIANGLES, 0, 6);

// Process the resulting texture
// NOTE: This must happen now, not later, because the alpha channel can be used here
Expand Down