Sign in to follow this  

directdraw: resizing surfaces

This topic is 3319 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
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

This topic is 3319 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this