Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Bitmap blit using DirectX

Bitmap blit using DirectX

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdatabasegame-devperformancehelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christopher Lloyd
    wrote on last edited by
    #1

    I need to blit a bitmap to the screen as fast as possible (it's showing video) and I'm assuming DirectDraw would be the best way to do this. Having never done any coding with DirectDraw I'm a bit lost where to start. I'm also confused about the relationship between Direct3D and DirectDraw - some of the samples I've found for DirectDraw use functions which don't seem to appear in Direct3D - but I understand DirectDraw has been merged with Direct3D, so I guess I'm missing something here! To make life a little more complex my bitmap is a DIB which uses an 8 bit format (i.e. the bits index entries in bmiColors). I have found some references to creating a DirectDraw surface in client memory but they don't seem to support this type of format (or do they?) Any help gratefully received. Thanks guys.

    J 1 Reply Last reply
    0
    • C Christopher Lloyd

      I need to blit a bitmap to the screen as fast as possible (it's showing video) and I'm assuming DirectDraw would be the best way to do this. Having never done any coding with DirectDraw I'm a bit lost where to start. I'm also confused about the relationship between Direct3D and DirectDraw - some of the samples I've found for DirectDraw use functions which don't seem to appear in Direct3D - but I understand DirectDraw has been merged with Direct3D, so I guess I'm missing something here! To make life a little more complex my bitmap is a DIB which uses an 8 bit format (i.e. the bits index entries in bmiColors). I have found some references to creating a DirectDraw surface in client memory but they don't seem to support this type of format (or do they?) Any help gratefully received. Thanks guys.

      J Offline
      J Offline
      JWood
      wrote on last edited by
      #2

      If you are showing a video you should use AVI format not a series of bitmaps. All the hard work has been done for you there. If you are still interested in your present course you should use DirectDraw. DirectDraw is mainly built for game design - layered / transparent / alpha blending / movement of images. I believe they use 24-bit color. DirectX is not a quick read, and if you have any control you should probly just use MFC SelectObject. In that case you must render into the draw context of the video capbilities in a buffer then blit it to the area of the screen.


      My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds

      C 1 Reply Last reply
      0
      • J JWood

        If you are showing a video you should use AVI format not a series of bitmaps. All the hard work has been done for you there. If you are still interested in your present course you should use DirectDraw. DirectDraw is mainly built for game design - layered / transparent / alpha blending / movement of images. I believe they use 24-bit color. DirectX is not a quick read, and if you have any control you should probly just use MFC SelectObject. In that case you must render into the draw context of the video capbilities in a buffer then blit it to the area of the screen.


        My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds

        C Offline
        C Offline
        Christopher Lloyd
        wrote on last edited by
        #3

        I'm actually generating the video images myself so AVI isn't relevant to me. At present I'm using a solution based on SetDIBitsToDevice which works well it's just not really fast enough - for example on a PIII 1GHz a 464 x 464 bitmap takes about 12ms to get blitted when the screen is in 32 bit colour mode - that's too slow for me, hence I'm thinking of using DirectX. I'm aware that DirectDraw is the solution I need, it's just that in DirectX 8.1 DirectDraw was merged with Direct3D, or so I've read, and I can't find the DirectDraw functions in the SDK documentation anymore. My real hope was that someone out there would have a ready made DirectDraw blitter, or at least could point me at some references. Thanks for your comments.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups