|
-
Dec 20th, 2002, 03:23 PM
#1
Thread Starter
Ex-Super Mod'rater
D3DDevice.SetRenderTarget Error, Please help.
I've spent hours straight writting a pixel perfect collision detection procedure and when I've came to test it I got an Automation Error when I get to this line:
VB Code:
D3DDevice.SetRenderTarget Sur1
Sur1 is a DirectDrawSurface7 and D3DDevice is declared as Direct3DDevice7.
Is there something I must do to Sur1 before I can set it as the renderTarget? I'm simply trying to paint a D3DSprite to Sur1 which is a tempory dest for the image while I check for collisions.
Am I doing it right, I am ment to set Sur1 as RenderTarget? coz otherwise i'll paint to the Backbuffer.
Thanx for any help.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 20th, 2002, 09:23 PM
#2
Good Ol' Platypus
How are you creating Sur1? There are certain flags you can't have in ddscaps (I think; I haven't done DD in a long time).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Dec 21st, 2002, 04:57 AM
#3
Thread Starter
Ex-Super Mod'rater
VB Code:
Sur1Desc.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT
Sur1Desc.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
Sur1Desc.lWidth = D1.Right 'Because Left = 0
Sur1Desc.lHeight = D1.Bottom 'Because Top = 0
Set Sur1 = DDraw.CreateSurface(Sur1Desc)
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 21st, 2002, 05:17 AM
#4
Thread Starter
Ex-Super Mod'rater
Thanx, that was it, I used this instead and it works fine now:
VB Code:
Sur2Desc.ddsCaps.lCaps = DDSCAPS_3DDEVICE
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

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
|