Positively Dumb DirectDraw Issue...
OOH, my first post ever. T''is so exciting...
Alright, I''m relatively new to DirectX, so take it easy on me:
I''ve got everything set up, as far as I know, but all that seems to be displayed on the screen is 4 vertical bands of white and black, with lots of randomly placed (and colored) pixels atop the bands. This problem disappears when I remove the
"while(lpddsPrimary->Flip(NULL,DDFLIP_WAIT)) line.
Any suggestions pertaining to what could potentially be wrong would be appreciated, thanks.
chances last a finite time.in the warm july nighttime.every care that keeps you from the beat.is a care that carries on defeat - Ozma-Domino Effect
chances last a finite time.in the warm july nighttime.every care that keeps you from the beat.is a care that carries on defeat - Ozma-Domino Effect
Absolutely nothing is wrong, as far as I can tell. DirectDraw doesn''t clear the surfaces, so you''re probably just blitting some random bits of memory to the screen, heh.. try drawing something on the surfaces or clearing them or something, it might make your problem go away.
Of course, if you''re already doing that then there *is* a problem, heh...
Of course, if you''re already doing that then there *is* a problem, heh...
Been a while since I used ddraw... I think the code to clear the backbuffer goes like this:
DDBLTFX fx = {sizeof(fx)};
fx.dwFillColor = 0; // or any other color
back_buffer->Blt(NULL, NULL, NULL, DDBLT_COLORFILL, &fx);
DDBLTFX fx = {sizeof(fx)};
fx.dwFillColor = 0; // or any other color
back_buffer->Blt(NULL, NULL, NULL, DDBLT_COLORFILL, &fx);
I had the exact same problem not too long ago.... After reviewing my code, and advice from people here, I looked at my code, changed some stuff around, and it worked. Try adding a clipper, pallette, and check what you''re blitting and where you''re blitting it to. If it''s a square (which I just finished a movable square program :D) check the RECT structure and be sure that the second point''s coordinates are down and right of the first point''s.
HibikiWheres the any key?www.geocities.com/dragongames123/home.html
find your elementat mutedfaith.com.<º>
find your elementat mutedfaith.com.<º>
quote: Original post by Beer Hunter
DDBLTFX fx = {sizeof(fx)};
fx.dwFillColor = 0; // or any other color
back_buffer->Blt(NULL, NULL, NULL, DDBLT_COLORFILL, &fx);
Always remember to fill your DDraw structs with 0s before using them. The tricky point is that if you don''t do this, it may work on some computers (or sometimes) but not always, and this can be a pain to debug.
DDBLTFX fx;
ZeroMemory( &fx, sizeof(fx));
fx.dwSize = sizeof(fx);
fx.dwFillColor = 0; // yeah, this is kinda useless now...
back_buffer->Blt(NULL, NULL, NULL, DDBLT_COLORFILL, &fx);
About that line you removed:
while(lpddsPrimary->Flip(NULL,DDFLIP_WAIT))
Shouldn''t it be
while(FAILED(lpddsPrimary->Flip(NULL,DDFLIP_WAIT)))
Maybe you simply posted it in this form,
Just checking...
while(lpddsPrimary->Flip(NULL,DDFLIP_WAIT))
Shouldn''t it be
while(FAILED(lpddsPrimary->Flip(NULL,DDFLIP_WAIT)))
Maybe you simply posted it in this form,
Just checking...
The Department of Next Life - Get your Next-Life Insurance here!
Thanks guys and gals! All is well now ^_^
Origil: Yeah, I just left that out when I when posted the code here, because it''s part of a longer Error-Handling algorithm.
chances last a finite time.in the warm july nighttime.every care that keeps you from the beat.is a care that carries on defeat - Ozma-Domino Effect
Origil: Yeah, I just left that out when I when posted the code here, because it''s part of a longer Error-Handling algorithm.
chances last a finite time.in the warm july nighttime.every care that keeps you from the beat.is a care that carries on defeat - Ozma-Domino Effect
chances last a finite time.in the warm july nighttime.every care that keeps you from the beat.is a care that carries on defeat - Ozma-Domino Effect
quote: Original post by Prosper/LOADED
Always remember to fill your DDraw structs with 0s before using them.
Which is exactly what I did by using a partial initializer list
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement