🔒 Locked
Stupid Question
Advertisement
Original Post
Ok... I''m trying to go through the DirectDraw tutorials in the DX7 SDK. I''m only on the first one.
I have created my window, created my DD object, changed the video mode, and created my primary surface and back buffer. I have essentially cut and pasted the code from the tutorial.
AT WHAT POINT IS MY FREAKIN UGLY WINDOW SUPPOSED TO DISAPPEAR AND LEAVE ME WITH A SCREEN TO DRAW ON?!
It changes video modes and the window stays. It creates the primary surface and the window stays. How do I make that god-awful piece of bad UI design go away?
thanks
It won''t disappear. Not until you put something on the primary surface. Try clearing the backbuffer, and flipping the primary surface.
In a lot of cases (on nVidia graphics cards, anyway), the primary surface is what Windows draws on. It''s not some mystical construct, or anything.
TheTwistedOne
http://www.angrycake.com
In a lot of cases (on nVidia graphics cards, anyway), the primary surface is what Windows draws on. It''s not some mystical construct, or anything.
TheTwistedOne
http://www.angrycake.com
Come on, give M$ a break. The design is not that bad. I actually like it, because it''s the best I''ve seen so far.
The window isn''t supposed to disappear by itself. If you just create the primary surface and the backbuffer, and change the video mode, the window will stay. It dissappears when you start flipping the prim surface and the backbuffer. Another words, clear the back buffer, flip, and the window will disappear.
P.S. Not everything M$ does it bad. Don''t let prejudice screw up your ability to look at things objectively.
The window isn''t supposed to disappear by itself. If you just create the primary surface and the backbuffer, and change the video mode, the window will stay. It dissappears when you start flipping the prim surface and the backbuffer. Another words, clear the back buffer, flip, and the window will disappear.
P.S. Not everything M$ does it bad. Don''t let prejudice screw up your ability to look at things objectively.
Thanks for the help guys. I knew it was a stupid question!
After I posted I thought about it and decided that was probably it.
As for M$, I''m not really that prejudiced against them. In fact, I''m not a Linux nut or anything... I like Windows... I just like the elegance of the BeOS UI better.
However, there aren''t many opportunities to get into the gaming industry on the BeOS at the moment, so...
anyhow, thanks again for all the help!
After I posted I thought about it and decided that was probably it.
As for M$, I''m not really that prejudiced against them. In fact, I''m not a Linux nut or anything... I like Windows... I just like the elegance of the BeOS UI better.
However, there aren''t many opportunities to get into the gaming industry on the BeOS at the moment, so...
anyhow, thanks again for all the help!
Dudez, are u ppl crazy? Ignorant?
Yez the primary surface is the GDI surface
so therefore when your directx program starts
u will see the window, probably covering the whole screen.
Windows will still draw on this for ur program.
If u dont want the window to be seen, DRAW SOME CRAP OVER IT!
My Direct Draw engine always clears the screen when it starts
after the window has been created.
-John
Yez the primary surface is the GDI surface
so therefore when your directx program starts
u will see the window, probably covering the whole screen.
Windows will still draw on this for ur program.
If u dont want the window to be seen, DRAW SOME CRAP OVER IT!
My Direct Draw engine always clears the screen when it starts
after the window has been created.
-John
What a quaint little language you people have here...
- IO Fission
Tearing 'em apart for no particular reason...
- IO Fission
Tearing 'em apart for no particular reason...
x3r0 - what was the point of that? Why do people insist on repeating what''s already been said, but doing it in l33t hAx0r sp34k, mixing in insults too?
Of course, there is no point.
TheTwistedOne
http://www.angrycake.com
Of course, there is no point.
TheTwistedOne
http://www.angrycake.com
You will want to create your window, then create your dd7 object and your front/back buffer. After doing so, clear the back buffer then "show" your window... You might have to clear the front buffer as well (do the same thing on your front buffer surface... My example is on the back buffer.
// Clear buffer
DDBLTFX caps;
memset(∩︀, 0, sizeof(caps));
caps.dwSize = sizeof(caps);
caps.dwFillColor = D3DRGB(0,0,0);
global.ddsb->Blt(NULL, NULL, NULL, DDBLT_WAIT / DDBLT_COLORFILL , ∩︀);
// Update the "real window" with our display.
ShowWindow(mainhwnd, cmdshow);
UpdateWindow(mainhwnd);
// Clear buffer
DDBLTFX caps;
memset(∩︀, 0, sizeof(caps));
caps.dwSize = sizeof(caps);
caps.dwFillColor = D3DRGB(0,0,0);
global.ddsb->Blt(NULL, NULL, NULL, DDBLT_WAIT / DDBLT_COLORFILL , ∩︀);
// Update the "real window" with our display.
ShowWindow(mainhwnd, cmdshow);
UpdateWindow(mainhwnd);
Yes, the first thing I do is make a black pop-up window that covers the entire screen. It''s in C++ w/ MFC, but here''s the code I wrote to do it. Note the WS_VISIBLE / WS_POPUP window style, and the BLACK brush.
// CHRIS
|
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement