Results 1 to 11 of 11

Thread: DCs and DirectX8?

  1. #1

    Thread Starter
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41

    Question DCs and DirectX8?

    Hello
    In directdraw 7 it was possible to get the DC from a surface using the GetDC method. This way you could blit to it using standard API functions. In directx8 however, this function seems to have disappeared. Is there any way to get the DC from a texture or surface in DX8? (or blit to them from another DC in some way?)

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'd say it would be inefficient to do GDI operations on the surface and i think there isn't a way, but i think there's specific blit to DC or from DC operations you can use. What kind of blitting are you doing?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41
    I'm trying to blit the entire desktop image to a texture to use in a D3D screensaver...

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    there should be a method for that, at least there's in Dx7::Ddraw
    In case there's not you could blit over using DMA.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41
    Do you have some sample code for doing that?

  6. #6
    Zaei
    Guest
    You cannot get a DC from a surface in DX8. Take a look at the Surface's "LockRect()" function, however. It should suit your purpose.

    Z.

  7. #7
    Addicted Member danielkw's Avatar
    Join Date
    Mar 2000
    Location
    Sweden
    Posts
    134
    why dont you just save the desktop image to a file and then load that file into the surface?

  8. #8
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    How do you people FIND this stuff?!

    Z.

  9. #9
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Was just thinking that myself
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Registered: Jan 70


    You could create a memory DC, then copy the data from the bitmap you selected over to the locked area...


    But I guess it's far to late now to help.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Registered: Dec 69
    The DB is screwed =).

    Z.

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