Sign in to follow this  
snake_oil

glRasterPos re-size strangeness

Recommended Posts

snake_oil    122
I'm plotting a bit of text in the top right of the screen (the frame rate as it happens) using glRasterpos2i to position the text. I calculate the position relative to the current screen size, so that if I resize the window, it will all work out properly. But when I do re-size (changing the viewport properly) I lose the text. In fact even if I initialise the window larger than 640x480 I lose the text (due to non-valid raster position). Investigation seems to suggest that glRasterpos2i always assumes the viewport is 640x480 no matter what the actual size of the window. Anyone got any clues to solve this conundrum or am I just going mad? BTW I'm using a PC with windows 98.

Share this post


Link to post
Share on other sites
zedzeek    529
>>Investigation seems to suggest that glRasterpos2i always assumes the viewport is 640x480 no matter what the actual size of the window<<

not true, r u using textures? cause if u resize the window often u will lose the textures (+ have to reload them again),
use rasterpos (10,10) + then resize if its ok then buildup to 800,600 (hopeflly u'll find out where youre going wrong)

Share this post


Link to post
Share on other sites
schue    176
You are going mad...

Well, from the information given all we can now do is start guessing. Ususally you are about 100% better off if you give us some sourcecode. (you know, we are still no mind readers and in general have no clue what you are doing in your code)

So here is my guess: Make sure that if you use glOrtho it is setup with the proper width and height. If your window is 1024x768 and you set glOrtho to 640x480, than yes, glRasterPos will work as if the screen only is 640x480, no matter of its actual resolution.

Share this post


Link to post
Share on other sites
snake_oil    122
Thanks Schue, you were right about the glOrtho, I had miseed changing that on the screen re-size. And next time I'll try and remember some source code, but you did pretty well without it!!

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