Skip to content
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

My texture is not loading #5

Open
D1dii opened this issue Oct 30, 2024 · 1 comment
Open

My texture is not loading #5

D1dii opened this issue Oct 30, 2024 · 1 comment

Comments

@D1dii
Copy link

D1dii commented Oct 30, 2024

Hi @pepcots ,

I was trying to implement my Component Pattern and during this I don't know why the textures are not loading anymore. Even if I try to use the same functions before implementing the Component Pattern it doesnt print my texture. I don't know why is this happening, when I debug my code it says that the texture exists and is entering the texture.bind() but the texture does not appear. Why is this happening?

Thanks

void GameObject::draw() const {
glPushMatrix();
glMultMatrixd(_transform->GetData());
glColor3ubv(&_color.r);
if (hasTexture() && drawTexture) {
glEnable(GL_TEXTURE_2D);
_texture.bind();
}
else if (!hasTexture() || !drawTexture)
{
_mesh_ptr->CheckerTexture();
}
if (hasMesh()) _mesh_ptr->draw();
if (hasTexture()) glDisable(GL_TEXTURE_2D);
for (const auto& child : children()) child.draw();
glPopMatrix();

@pepcots
Copy link
Member

pepcots commented Oct 31, 2024

Hello! I've seen it is working now?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants