how tp redraw just a part of the screen in OGL

Started by
3 comments, last by Spencer 22 years, 8 months ago
Hi! I am having a little problem with my game..... I am implementing a mouse cursor, but it is very slow and the cursor makes big jumps on the screen probably due to the fact that i redraw the whole screen everytime i update the mousepointer. How do i do tis for REAL? How to redraw just a part of the screen with OGL when the depth test is turned on and stuff? Any other ideas for making a mousecursor? thancks alot in advance --Spencer
--Spencer"All in accordance with the prophecy..."
Advertisement
Make your game faster:-))) In OpenGL, you cant be sure what will be in your front burrer after SwapBuffers, look at halp or some specifications or such. You can do a little test to determine whether it stays on computer you are running on and then take the advantage of it, but it isnt nice solution.

regards
Jindrich Kolman
regardsJindrich KolmanLibs
Make your game faster:-))) In OpenGL, you cant be sure what will be in your front burrer after SwapBuffers, look at halp or some specifications or such. You can do a little test to determine whether it stays on computer you are running on and then take the advantage of it, but it isnt nice solution.

regards
Jindrich Kolman
regardsJindrich KolmanLibs
Sounds like you''re using a textured quad as a mouse pointer? Go back to using the standard OS one. It''ll save you the headache

If you''ve played QuakeIII at really high resolutions, you''ll notice that its textured mouse pointer does the same - it gets all jumpy. You can redraw parts of the screen at a time, try reading up on glScissor, but I don''t think that''d be applicable here...

Paul Groves
pauls opengl page
Paul Grovespauls opengl page
Should have to keep updating anyway, it is a game isnt it? However, if you dont want to update anything but the cursor image, try this:

If you arent updating the screen, you can redraw it once into the back buffer (assuming double buffering here) so that the front and back buffers are identical. Now, blit the initial cursor to the front buffer. when you need to move the mouse but not redraw the scene, follow these steps which should be faster, unless its a small scene:

1) read the pixels from the back buffer where the cursor is on the front.
2) draw the new cursor to the back.
3) swap the buffers
4) draw the image you took from the back buffer in step 1 and draw it to the new back buffer to cover up the cursor.
(http://www.ironfroggy.com/)(http://www.ironfroggy.com/pinch)

This topic is closed to new replies.

Advertisement