Jump to content
  • Advertisement
Sign in to follow this  
FGFS

draw texture

This topic is 1207 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

Hi

why does my Texture (500x625) get drawn multiple times. I get around 4 to the side and 4-5 up/down images drawn, when I only want to

display it once ( but scaled ).

Thanks

 

 

    float offx = XPLMGetDataf(panel_total_pnl_l);//left
    float offy = XPLMGetDataf(panel_total_pnl_b);//bottom


    XPLMSetGraphicsState(0, 1, 0, 0, 1, 0, 0); // 1 texture and alpha blending
    XPLMBindTexture2d(textures[CHECKL_TEXTURE].texIMGID, 0);
    glColor3f(1, 1, 1);
    glBegin(GL_QUADS);
    glTexCoord2f(0, 0);
    glVertex2f(offx + 100, offy + 200);
    glTexCoord2f(0, 1);
    glVertex2f(offx + 100, offy + 825);
    glTexCoord2f(1, 1);
    glVertex2f(offx + 600, offy + 825);
    glTexCoord2f(1, 0);
    glVertex2f(offx + 600, offy + 200);
    glEnd();

 

Share this post


Link to post
Share on other sites
Advertisement

Too little info to tell. What kind of texture wrap parameters are you using for the texture? Have you changed the glTextureMatrix at all? That will scale your textures, e,g

 

glMatrixMode(GL_TEXTURE)
glLoadIdentity()
glScalef(4f, 4f, 1f)

Share this post


Link to post
Share on other sites

Thanks, found out that it works fine with another texture. So after copying my texture into that it works. Hence it must either have been image size or tga format related, weird anyway.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!