Jump to content
  • Advertisement
Sign in to follow this  
schragnasher

vertex array anomolies

This topic is 3556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!