Results 1 to 4 of 4

Thread: D3DDevice.SetRenderTarget Error, Please help.

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    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:
    1. 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.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    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)

  3. #3

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    VB Code:
    1. Sur1Desc.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT
    2.             Sur1Desc.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
    3.             Sur1Desc.lWidth = D1.Right    'Because Left = 0
    4.             Sur1Desc.lHeight = D1.Bottom  'Because Top = 0
    5.            
    6.             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.

  4. #4

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Thanx, that was it, I used this instead and it works fine now:
    VB Code:
    1. 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
  •  



Click Here to Expand Forum to Full Width