[OGL|solved] SEGV



  • Ich stoße gerade auf ein seltsames Problem bei glDrawElements():

    void Block::draw()
    {
        glColor3f(data->color_r, data->color_g, data->color_b);
    
        glVertexPointer(3, GL_FLOAT, 0, vertices);
    
        for (unsigned a = 0; a < data->num_indices; a++)
        {
            std::cout << a << "\t" << static_cast<int>(indices[a]) << ":\t" << vertices[indices[a]*3] << "|\t" << vertices[indices[a]*3 + 1] << "|\t" << vertices[indices[a]*3 + 2] << std::endl;;
        }
    
        glDrawElements(GL_QUADS, data->num_indices, GL_UNSIGNED_BYTE, indices);
    }
    
    #0 0xb7b4c34c   memcpy() (/lib/tls/i686/cmov/libc.so.6:??)
    #1 0xb71dec3f   __glNativeCopy4() (/usr/lib/dri/fglrx_dri.so:??)
    #2 0xb72fee9c   __R300TCLProcessArrayPrimitiveWithIndices() (/usr/lib/dri/fglrx_dri.so:??)
    #3 0xb73053ec   __glim_R300TCLDrawElements() (/usr/lib/dri/fglrx_dri.so:??)
    #4 0xb7305a5c   __glim_R300TCLDrawElements() (/usr/lib/dri/fglrx_dri.so:??)
    #5 0x8049128    Block::draw(this=0x804e0b8) (/home/darthdespotism/dev/GlTris/Block.cpp:30)
    #6 0x8049186    Game::draw(this=0xbfcb3f08) (/home/darthdespotism/dev/GlTris/Game.cpp:30)
    #7 0x804b602    main() (/home/darthdespotism/dev/GlTris/main.cpp:109)
    

    Die Schleife hab ich noch eingebaut u zu überprüfen, ob die Arrays irgendwo ein verfrühtes Ende haben. Diese läuft jedoch geradeaus durch.

    Jemand eine Idee?

    EDIT://

    indices ist const unsigned char[]
    vertices ist const float[]

    EDIT://

    Wer
    glEnableClientState(GL_COLOR_ARRAY);
    aufruft, sollte auch ein Farbarray angeben -.-


Anmelden zum Antworten