Jump to content
  • Advertisement
Sign in to follow this  
Vincent Torri

directdraw: resizing surfaces

This topic is 3678 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I have to use directdraw for a Windows CE port of a linux canvas library. Each object of a canvas is then a directdraw surface. AFAICS, in the msdn documentation, i don't see any method that resize a surface. Is it correct and should I: 0) Get the argb data of my surface of size (w1, h1) 1) from my argb data of size (w1,h1), create another argb data, resized to (w2, h2) 2) delete my surface 3) create a new one of size (w2,h2) 4) put the argb data into that new surface ? So another possibility is to use overlay surfaces, but that canvas library can deal with hundred and even thousand of ddraw surfaces. Is it reasonnable to use overlay surfaces in that case ? thank you

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Vincent Torri
Hey,

I have to use directdraw for a Windows CE port of a linux canvas library. Each object of a canvas is then a directdraw surface.

AFAICS, in the msdn documentation, i don't see any method that resize a surface. Is it correct and should I:

0) Get the argb data of my surface of size (w1, h1)
1) from my argb data of size (w1,h1), create another argb data, resized to (w2, h2)
2) delete my surface
3) create a new one of size (w2,h2)
4) put the argb data into that new surface
Correct. Although you really shouldn't be trying to resize surfaces for this exact reason, it'll be extremely slow.

Quote:
Original post by Vincent Torri
So another possibility is to use overlay surfaces, but that canvas library can deal with hundred and even thousand of ddraw surfaces. Is it reasonnable to use overlay surfaces in that case ?
As I understand it, you can only have one overlay surface, but I've not used overlays much at all. And how would overlays let you resize a surface?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by Vincent Torri
Hey,

I have to use directdraw for a Windows CE port of a linux canvas library. Each object of a canvas is then a directdraw surface.

AFAICS, in the msdn documentation, i don't see any method that resize a surface. Is it correct and should I:

0) Get the argb data of my surface of size (w1, h1)
1) from my argb data of size (w1,h1), create another argb data, resized to (w2, h2)
2) delete my surface
3) create a new one of size (w2,h2)
4) put the argb data into that new surface
Correct. Although you really shouldn't be trying to resize surfaces for this exact reason, it'll be extremely slow.


ok, that's what i thought. Well, our resize implementations (we have several) are quite fast, written in asm. What annoys me is the fact that i have to create a surface. Iirc, i have read that creating directx objects is slow. Are there any other reasons that will make a resize slow ?

Quote:

Quote:
Original post by Vincent Torri
So another possibility is to use overlay surfaces, but that canvas library can deal with hundred and even thousand of ddraw surfaces. Is it reasonnable to use overlay surfaces in that case ?
As I understand it, you can only have one overlay surface, but I've not used overlays much at all. And how would overlays let you resize a surface?


i thought that UpdateOverlay() could do that. Maybe I'm wrong. Anyway if there can be only 1 overlay surface (i can understand that), it's not an option.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!