OpenGL raster
Hi guys!
I'm again here looking for your precious help!
I'm working at a 2d engine using the openGL (with glDrawPixels) and I've met a peculiar problem during the development:
Positioning the raster (with glRasterPos2i) from the middle to the end of the screen lenght (e.g., if the screen resolution is 800x600, you call a value >= 400 as x coordinate) the position is increased of a pixel!
glRasterPos2i(200, 50) positions the raster at 200 on the axis
glRasterPos2i(399, 50) ppositions the raster at 399 on the axis
glrasterPos2i(400, 50) positions the raster at 401 on the axis
glRasterPos2i(504, 50) positions the raster at 505 on the axis and so on..
How is it possible?
Practically, I'm not able to position the raster exactly in the middle of the screen. Is there anything I'm not considering??
Thanks in advice
I'm again here looking for your precious help!
I'm working at a 2d engine using the openGL (with glDrawPixels) and I've met a peculiar problem during the development:
Positioning the raster (with glRasterPos2i) from the middle to the end of the screen lenght (e.g., if the screen resolution is 800x600, you call a value >= 400 as x coordinate) the position is increased of a pixel!
glRasterPos2i(200, 50) positions the raster at 200 on the axis
glRasterPos2i(399, 50) ppositions the raster at 399 on the axis
glrasterPos2i(400, 50) positions the raster at 401 on the axis
glRasterPos2i(504, 50) positions the raster at 505 on the axis and so on..
How is it possible?
Practically, I'm not able to position the raster exactly in the middle of the screen. Is there anything I'm not considering??
Thanks in advice
RasterPos goes through the normal coordinate transform, so it is possible error is introduced.
Use WindowPos instead.
Use WindowPos instead.
Yeah, but glDrawPixels is very slow, so why use it at all? I'd use textures instead.
arekkusu Wrote:RasterPos goes through the normal coordinate transform, so it is possible error is introduced.Thank you
Use WindowPos instead.
AnotherJake Wrote:Yeah, but glDrawPixels is very slow, so why use it at all? I'd use textures instead.
Yes, that would be much faster (and probably easier).
Thanks for your advice, i will try it
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Vector versus raster graphics in openGL | WhatMeWorry | 2 | 3,419 |
Dec 29, 2005 01:23 AM Last Post: WhatMeWorry |
|

