Skip to main content
gamedev.net
🔒 Locked

Elastic box selection

Started by fram 2 replies 1.1k views
Original Post
fram
fram
Hi, how can I draw an elastic box selection (see example http://www.finn.no/kart ) without redraw all? thanks fram
Zakwayda
Zakwayda
Quote:
Original post by fram
Hi,
how can I draw an elastic box selection (see example http://www.finn.no/kart ) without redraw all?

thanks
fram
It looks like you're asking about zooming in on a rectangular region, which was recently under discussion here.

It also looks like this is a 2D problem, which means the solution will be much more straightforward than those presented in the other thread.

Not sure what you mean by 'without redraw all' though. Perhaps you could clarify your question a bit.
fram
fram
Quote:
Original post by jyk
It also looks like this is a 2D problem, which means the solution will be much more straightforward than those presented in the other thread.

Not sure what you mean by 'without redraw all' though. Perhaps you could clarify your question a bit.


Thanks
The problem in not how to zoom, but how to draw the elastic box without redraw all objects, while dragging the mouse that modify the elastic box.
Now I'm using the window canvas functions (moveto, lineto), but it don't work very well.
Regards
fram
bzroom
bzroom
To prevent redraw, you could save your frame buffer that you don't want to redraw. Use the saved image to display, and then draw your rectangle over it.


Draw Scene
Copy scene to texture

While redrawing rectangle
Clear buffer
draw saved scene
draw rectangle
loop


Something like that might work for you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.