Advertisement Jump to content
Sign in to follow this  
TheMightyDude

OpenGL Problem

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

Hello All I am in the middle of creating my own Controls for an Open project of mine, like for example: Combobox, Textbox, Listbox, Buttons, Sliders etc... But I seem to have a bit of a problem. It looks fine on my main PC using a nVidia gfx card, but on my Notebook using an ATI gfx card, it looks all miss alined. ATI Card PNG Image (51KB) nVidia Card PNG Image (57KB) Can you see what I mean? Anyone know why this is happening and know of a way to fix it? Thanks in advance Paul Kirby

Share this post


Link to post
Share on other sites
Advertisement
I assume you are drawing in ortho projection. Try adding a slight translation (<1pixel) before drawing anything. glTranslatef(0.3f,0.3f,0).

Share this post


Link to post
Share on other sites
Quote:
Original post by vNistelrooy
I assume you are drawing in ortho projection. Try adding a slight translation (<1pixel) before drawing anything. glTranslatef(0.3f,0.3f,0).


Nice one :)

I placed it like the following:

glOrtho(0.0,screen_width,0.0,screen_height,-1.0,screen_width);
glTranslatef(0.3f,0.3f,0);
glMatrixMode(GL_MODELVIEW);

Though I had to play with the glVertex2i() a bit to re-position the bits.

Still now its sorted Thanks :)

Paul Kirby

Share this post


Link to post
Share on other sites
Quote:
Original post by vNistelrooy
I assume you are drawing in ortho projection. Try adding a slight translation (<1pixel) before drawing anything. glTranslatef(0.3f,0.3f,0).


Mind if I ask why this happens and why the slight translation fixes it?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!