Render to multiple windows in DDraw

This is a discussion on Render to multiple windows in DDraw within the Windows Programming forums, part of the Platform Specific Boards category; I'm using several windows in a DirectDraw (7) program, and I want to render to both. Currently, I can only ...

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Render to multiple windows in DDraw

    I'm using several windows in a DirectDraw (7) program, and I want to render to both. Currently, I can only render to one. If I try to render to the other, the clipper will prevent that or the graphics is incrediblt flickery.

    What I do is simply getting the rect of the other window and render to it, but I guess the stuff is actually drawn on the first window.

    How do you render to several windows in the same program? Do you need two DirectDraw objects, one for each window?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    It depends. Are your multiple windows top-level windows or do you have one parent and then some child windows?

    EDIT:

    Just try this. Setup your DirectDraw object with your primary surface. Then create your clipper. Now use the method IDirectDrawClipper7::SetClipper to set it to the primary surface. Then just use IDirectDrawClipper7::SetHWnd method to change the window you are blitting to. I don't recommend creating two DirectDraw objects, that is bad news. Let me know if this doesn't work.
    Last edited by MrWizard; 02-08-2003 at 09:48 PM.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    It seems to work fine now. Thanks!

    Edit: I have one main window and one child.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. redrawing multiple glut windows
    By ichijoji in forum Game Programming
    Replies: 2
    Last Post: 11-27-2005, 05:04 PM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 06:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 03:55 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM
  5. multiple console windows
    By gordy in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-13-2002, 11:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21