Sign in to follow this  
schragnasher

vertex array anomolies

Recommended Posts

Im getting weird anomalies when using simple vertex arrays for rendering 2d images. Iv gotten this to work perfect on the same machine in the past but sadly lost the code in a usb accident. This flickers and shows various parts of my images. The text shown actually uses immediate mode and works fine. switching my rendering code to immediate mode makes it work perfect. Im not sure where the problem might be, this code works just fine on my older laptop video card. The one i have in this machine checks out using extension viewer, its a Geforce 8800
    glEnable(GL_VERTEX_ARRAY);
    glEnable(GL_TEXTURE_COORD_ARRAY);
    glBindTexture(GL_TEXTURE_RECTANGLE_ARB,texid);

    GLfloat texcoords[]={
        0,m_texturemap[texid]->height,
        m_texturemap[texid]->width,m_texturemap[texid]->height,
        m_texturemap[texid]->width,0,
        0,0};

    GLfloat vertices[]={
        x,y+m_texturemap[texid]->height,
        x+m_texturemap[texid]->width,y+m_texturemap[texid]->height,
        x+m_texturemap[texid]->width,y,
        x,y};

    glVertexPointer(2,GL_FLOAT,0,vertices);
    glTexCoordPointer(2,GL_FLOAT,0,texcoords);
    glDrawArrays(GL_QUADS,0,4);
    glDisable(GL_VERTEX_ARRAY);
    glDisable(GL_TEXTURE_COORD_ARRAY);

This is the code im using, it simply draws one image at a time. Any help?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this