|
-
Dec 8th, 2002, 10:53 PM
#1
Thread Starter
Addicted Member
Loading one DirectX surface to another
Ok, here is my dilemma. I have a loop entitled UpdateScreen that is called to comprise the backbuffer and flip it to the screen. I am using a surface titled ddsMainSurf to hold the background. What I am having problems with is that I have a ten frame animaton loaded into another surface and am trying to load one frame of that into the ddsMainSurf surface in order to load it to the bacbuffer in my UpdateScreen sub. I have tried 'ddrval = ddsMainsurf.BltFast (0 ,0, ddsAnimSurf, rAnim, DDBLTFAST_WAIT)' where rAnim is the RECT of the desired frame, but it just doesn't seem to work. I have found a way to run the animation by overriding the UpdateScreen routine, but it is sloppy and doesn't allow me much flexibility to skip the animation if so desired. Any suggestions on how to load a portion of one surface to another?
There aren't many problems that ten gallons of gas and a large nose can't cure. Only problem is, most of us don't have ten gallons of gas lying around.
-
Dec 8th, 2002, 10:57 PM
#2
Addicted Member
Your code should work, depending on what else you're doing. Can you post all of the relevant code? You must be doing something else that is causing the problem.
-
Dec 8th, 2002, 11:01 PM
#3
Thread Starter
Addicted Member
Yes, I thought it should work too. Might have something to do with the way I have it structured. I'll toil with restructuring my code, then if I still have a problem, I'll be back. Thanks, just wanted to make sure I was using the proper coding convention.
There aren't many problems that ten gallons of gas and a large nose can't cure. Only problem is, most of us don't have ten gallons of gas lying around.
-
Dec 8th, 2002, 11:40 PM
#4
Thread Starter
Addicted Member
Ok, still no luck. I went and started a whole new app with just the basic DirectX initialisation and tried to copy a portion of one surface to another using that code, but it drops out. I wonder if it has anything to do with BltFast? I'm at a loss here. Any ideas? It can't be in my coding, because if I just load a graphic directly into the main surface from disk, it works fine. Only when trying to load a portion of one surface into the main surface do I have a problem. the dimensions are correct, too.
There aren't many problems that ten gallons of gas and a large nose can't cure. Only problem is, most of us don't have ten gallons of gas lying around.
-
Dec 9th, 2002, 09:20 AM
#5
Addicted Member
Can you attach the project? Without seeing exactly what you're doing we can't really help.
It can't be in my coding...
You'd be surprised!
-
Dec 9th, 2002, 09:28 AM
#6
Thread Starter
Addicted Member
Well, thanks for the help Machaira, but I sort of got it figured out. I just loaded my animation into the main surface and then copied the portion that i needed to the back buffer directly from there. Still, I am perplexed as to why I couldn't load one surface into another unless it is the backbuffer, but Im rolling now, so I dont care. lol. Thanks again!!
There aren't many problems that ten gallons of gas and a large nose can't cure. Only problem is, most of us don't have ten gallons of gas lying around.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|