Adrian Nordin
Adrian Nordin

Reputation: 19

OpenGL, Doing skybox and want outside of cube to be backface-culled, noticed something strange

I was trying to make a cube to backface cull the side outwards, I succesfully completed my indicies so it worked. But I stumbled upon a wierd thing, were when I for example wanted to change // bot indicies it didn't update in program until, I resized my GLuint indicies[36] to GLuint indicies[30] and out commented the // bot and runned the program and the put it back to GLuint indicies[36].

Are the EBO or indicies stored in the GPU between program runs? I delete vao, vbo and ebo when I destroy my class?

Here is my cube verticies and indicies:

    GLfloat skyboxVertices[24] = {        
            // front
            1.0, -1.0,  1.0,
            1.0, -1.0,  1.0,
            1.0,  1.0,  1.0,
            -1.0,  1.0,  1.0,
            // back
            -1.0, -1.0, -1.0,
            1.0, -1.0, -1.0,
            1.0,  1.0, -1.0,
            -1.0,  1.0, -1.0,
        };

GLuint indicies[36] = {

        // front
        0, 2, 1,
        2, 0, 3,
        // back
        4, 5, 6,
        6, 7, 4,
        // right
        1, 6, 5,
        1, 2, 6,
        // left
        0, 4, 7,
        7, 3, 0,
        // top
        2, 3, 7,
        2, 7, 6,
        // bot
        0, 1, 4,
        5, 4, 1,
    };

Thanks for reply beforehand!

Upvotes: 1

Views: 208

Answers (0)

Related Questions