| View previous topic :: View next topic |
| Author |
Message |
elevationsnow
Joined: 10 Sep 2005 Posts: 22
|
Posted: Thu Sep 29, 2005 12:39 pm Post subject: Cursor Without Refreshing the screen |
|
|
im developing a programing called crazypaint and i need a cursor so you can see where you are when your not drawing. right now i tryed making a cursor with the blit code from shines pg.h and you have to refresh the screen so the cursor doesnt duplicate its self. which causes my picture to be erased before it can even draw 2 pixels. so... is there any way arround this drawing a cursor with out refreshing maybe some form of layers etc. this would be very helpful
thanks in advance |
|
| Back to top |
|
 |
CyberBill
Joined: 26 Jul 2005 Posts: 86 Location: Redmond, WA
|
Posted: Thu Sep 29, 2005 12:53 pm Post subject: |
|
|
| Dont draw directly to the back buffer. Draw to a texture that is blit to the screen, and then the cursor is blit on top of this. |
|
| Back to top |
|
 |
elevationsnow
Joined: 10 Sep 2005 Posts: 22
|
Posted: Thu Sep 29, 2005 1:10 pm Post subject: |
|
|
im kinda a newbie how would you do that?
cause right now im ploting pixels directly to the vram and then trying to blit a cursor over it
could you perhaps paste some sample code or atleast how to plot pixels to a texture |
|
| Back to top |
|
 |
CyberBill
Joined: 26 Jul 2005 Posts: 86 Location: Redmond, WA
|
Posted: Thu Sep 29, 2005 1:54 pm Post subject: |
|
|
Create a temporary buffer that is 512*4*272 (the absolute biggest back buffer you can have).
Draw directly to it. (access it just like VRAM)
Every frame, copy (memcpy) this buffer to VRAM, and then blit your cursor to VRAM.
Note: This is slow and horrible, but you'll understand it all instead of using magic. :) |
|
| Back to top |
|
 |
|