Maintenant je comprend les singes au début de 2001 A Space Odyssey

This commit is contained in:
MarcEricMartel
2023-11-15 08:27:51 -05:00
parent e011e2f1fc
commit 86536fbb99
5 changed files with 48 additions and 13 deletions

View File

@@ -87,15 +87,20 @@ void RemotePlayer::Feed(const netprot::Output out) {
void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, float elapsedTime)
{
shader.Use();
//m_texture_front.Bind();
m_texture_front.Bind();
float u, v, w, h;
atlas.Bind();
atlas.TextureIndexToCoord(0, u, v, w, h);
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex2f(0, 500);
glTexCoord2f(1, 0); glVertex2f(500, 500);
glTexCoord2f(1, 1); glVertex2f(500, 0);
glTexCoord2f(0, 1); glVertex2f(0, 0);
glTexCoord2f(u, v); glVertex3f(0, 50., 0);
glTexCoord2f(u+w, v); glVertex3f(50., 50., 0);
glTexCoord2f(u+w, v+h); glVertex3f(50., 0, 0);
glTexCoord2f(u, v+h); glVertex3f(0, 0, 0);
glEnd();
shader.Disable();
}
bool RemotePlayer::LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps, bool stopOnError)