blitter don't work

Started by
2 comments, last by GameDev.net 24 years, 6 months ago
Hi,
it doesn't work because you want to blit from the backbuffer to the primary surface, that's the problem. Try it this way :

  • Create primary surface
  • Attach backbuffer
  • Create offscreen-surface
  • Load bitmap to offscreen-surface
  • Blit the bitmap from the offscreen-surface to the backbuffer
  • Flip

    CU

    ------------------
    Skullpture Entertainment
    #40842461

  • Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de
    Advertisement
    I think you're getting a bit confused.

    You don't need to Blt the back buffer to the front buffer if you flip. Flip does that for you (well, it actually does something else), but it brings the back surface to the front.

    The process you will want to use is this:

    init front buffer, attach back

    m_pBackBuffer->Blt(OffscreenSurface, rect, etc);
    ..
    ..
    as many blts as neede
    m_pPrimary->Flip();

    The flip will show what was on the back buffer.

    Hello, I am new to direct x and was learning through Andre LaMoth's "dumbies" book. My problem is that the blitter wont work.

    I set up my primary surface, attach the backbuffer, etc, and load in a picture into the back surface. This works fine because I can flip, and I see the image.

    however, when I call

    lpddsprimary->Blt(sourceRect, backbuffer), destRect, etc)

    it doesn't work. There is nothing. I know I may have mixed up the rectangles on this message, but it should work, shouldn't it?

    The other thing is the DDS_WAIT (or
    similar), which I have enabled.

    If anyone knows why this doesn't work, please let me know.

    p.s. i am using 16 bit colour at 640 x 480.

    see ya

    Ahhh, thank you for your help, but I realised what I've been doing! Because I was unfamiliar with the API, i was just using the function straight from the book, and using the flag that allowed transparency colour keying, but I hadn't set this up!

    Sorry I couldn't be more clear in my function, its because I use the internet at school, but code at home, so I can't just copy and paste...

    see ya

    This topic is closed to new replies.

    Advertisement