Advertisement

OpenGL Problem

Started by August 04, 2005 02:57 PM
2 comments, last by PaulAtreus 19 years, 3 months ago
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
I assume you are drawing in ortho projection. Try adding a slight translation (<1pixel) before drawing anything. glTranslatef(0.3f,0.3f,0).
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
Advertisement
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
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?

This topic is closed to new replies.

Advertisement