Hello,
I am trying to render 2D and 3D using GLUT, but my square stays green with the textures. I tried using renderdoc but it only works with modern opengl. glGetError() returns 0 after loading the texture, so I don't know what I am doing wrong...
This is the square:
float vertices[] = {
-0.5, 0.5, 0,
-0.5, -0.5, 0,
0.5, -0.5, 0,
0.5, 0.5, 0
};
int indices[] = {
0, 1, 3,
3, 1, 2
};
float texture_coords[] = {
0, 0,
0, 1,
1, 1,
1, 0
};
GFXModel square = {vertices, indices, texture_coords, 0, 1, 1, 2};
...
int main(int argc, char **argv) {
square.texture = gfx_load_texture("test.png");
gfx_run(&argc, argv, draw_2d, draw_3d);
gfx_free(square);
return EXIT_SUCCESS;
}