Skip to main content
GameDev.net gamedev.net
🔒 Locked

Blitting to multiple windows

Started by soehrimnir Nov 7, 2000 at 3:11 AM 4 replies 150+ views
Original Post
soehrimnir
soehrimnir
This is not a question about how to blit to multiple windows, because that works fine. When I read through the DirectX docs though, they said it''s better to set the handle of the Clipper object to the window you want to blit to (this is what I do) instead of creating a primary surface for each window. Why is the first method recommended? Won''t it be faster if you have a primary buffer for each window to blit to?
furby100
furby100
You only create 1 primary buffer. This covers the _entire_ screen. Not just your window. You can force Blits to be inside the current window by using the IDirectDrawClipper::SetHWnd() method.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

soehrimnir
soehrimnir
Ok, that wasn''t really what I asked for. I know how to blit to multiple windows. It''s just that the docs recommend you to only set the clipper to the window handle you want to blit to instead of creating a primary surface for each window.

Now the only reason I can think of why you should use the clipper method is that the it''s a lot easier and keeps your code a bit cleaner. Otherwise if you have four windows, you''d have to create four primary surfaces.

Well, it''s not really an important question. I was just wondering why they (the DirectX docs) recommend the method with the clippers.
Sly
Sly
Because the first primary surface that you create IS the entire screen. That is why you should only create one primary surface. Using multiple primary surfaces on what is actually the same surface may cause locking, lost surfaces and other not-so-nice things.



Steve ''Sly'' Williams
Tools Developer
Krome Studios
soehrimnir
soehrimnir
Ok, thanks. That was what I needed to know.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.