Thread: DX Windowed Mode Double Buffering

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    450

    DX Windowed Mode Double Buffering

    From the book Tricks of Windows Game Programming Gurus by Andre LaMothe refering to windows mode programming.
    The only difference is that you don't set the video mode or create a secondary back buffer. You are not allowed to page flip in windowed modes. You must either use blitter to double buffer or do it yourself, but you can't set up a complex surface chain and then call Flip().
    My question is if you do want to use windows mode and hence blitter to double buffer should you go ahead and create a back buffer or use an offscreen surface instead?

    Second would using the blitter and a surface to double buffer be faster then setting up your own buffer and using memcpy.

    Thirdly if you set up your own buffer can you use blitter to copy from it, if so how?

  2. #2
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    One piece of enlightenment for you:

    blit = memcpy

    buffer = surface

    A back buffer is a surface in memory. When you blit you are just memcpy'ing.
    My Website

    "Circular logic is good because it is."

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    And don't forget to lock the surface (buffer) before you do this or you won't see anything. Lamothe warns about this in that book as well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying 2-d arrays
    By Holtzy in forum C++ Programming
    Replies: 11
    Last Post: 03-14-2008, 03:44 PM
  2. Unknown Math Issues.
    By Sir Andus in forum C++ Programming
    Replies: 1
    Last Post: 03-06-2006, 06:54 PM
  3. Help with multi function progam
    By WackoWolf in forum C Programming
    Replies: 22
    Last Post: 10-13-2005, 02:56 AM
  4. getline problem
    By scottmanc in forum C++ Programming
    Replies: 9
    Last Post: 04-13-2003, 09:27 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM