Please... God... Anyone.. Help me..

Started by
3 comments, last by scubabbl 22 years, 5 months ago
I'm at a complete loss. I can not get my program to do what I think it should be doing. It's nothing complicated, just a modification to a breakout program from the Programming Isometric games with DirectX 7 book. What I wanted to do was just add a simple intro screen. Thats it. I did it just like I think it should work, but, for some god dang reason, it just.. won't. When I run the program, there is a black screen where the intro screen should be, and then I can click to run the game. Now, I tired to remote debug it, with both computer's having the DX8 SDK and both have MSVS 6.0. But, when I run the remote debugger, I get an access violation. But, If I run the program on either computer, just stand alone, no access violation. I'm stumped. I've spent two days trying to figure out the problem, and, no luck. So, my plea goes out. You can download the entire MSVC++ 6.0 project here. http://www.geocities.com/scubabbl/chapter9.zip God please if someone could help me to tell me what I am doing wrong with this code. The bit to load the menu is at the very bottom of the IsoHex_9.cpp file. God please someone help me. -Jason Edited by - scubabbl on October 31, 2001 1:29:09 AM
Advertisement
I got the same book. Its great isn''t it?
Im in 3rd hour right now so i dont have access to a compiler. But i think i found the problem.
void ShowMenu()
{
DDBLTFX ddbltfx;
DDBLTFX_ColorFill(&ddbltfx,0);
lpddsback->Blt(NULL,NULL,NULL,DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx);

//declare rects
RECT rcSrc;
RECT rcDst;

//set up source rect
SetRect(&rcSrc,0,0,SCREENWIDTH,SCREENHEIGHT);

//set up dest rect
CopyRect(&rcDst,&rcSrc);
//OffsetRect(&rcDst,ptBall.x,ptBall.y);

//blit
////////////////Not NULL////////Not NULL///////////
lpddsback->Blt(&rcDst,lpddsmenu,&rcSrc,DDBLT_WAIT | DDBLT_KEYSRC,NULL);

}


It seems to me u made your rects NULL there for you blt nothing.
Cool program. I extended the ball one too to create a secret of mana type game and a map maker. Thank god for rects in collision detection.

~Dryslime
Well, I finally did fix the problem, but it turned out in this line,
lpddsback->Blt(&rcDst,lpddsmenu,&rcSrc,DDBLT_WAIT | DDBLT_KEYSRC,NULL);

I should not have set to to DDBLT_KEYSRC, but I don''t know why. Oh well, I guess I''ll have to remember that cause I finally got it to work.

I still wish I knew why that worked. The Keysrc is black, so it should have just ignored all black on the bmp, but instead, it ignored everything. Hm...

-Jason
Im still a newbie too but im pretty sure if you set the Blt function to use NULL for the rcSrc and rcDst, the lpddsmenu and the lpddsback must be exactly the same size for it to work properly. Im pretty sure it had nothing to do with the DDBLT_KEYSRC, but i could be wrong. I didnt have time to inspect your code thoroughly, so i have no idea if i am of any help.

-Jon

I just looked back on it and found that it just streches it if they do not fit properly.
Maybe your graphics card doesnt support streching or something.

Edited by - Dryslime on October 31, 2001 4:00:30 PM
I have a Gforce 2 GTS. The display was set to 800x600 and so was the bmp that I wanted to display. DDBLT_KEYSRC tells the program to put down all the colors in the bmp except your source color (In my case, black), the problem was, it was not putting down any colors. The NULLs tell it to blt to the whole back buffer instead of in a rectangle, but for some reason, DDBLT_KEYSRC was making it blt nothing, instead of everything but the black. I dont get it, but, hey, it worked. Chalk it up as knowledge gained I guess.


-Jason

PS. I tried with rectangles in there also, but, it still does not work unless I take out the DDBLT_KEYSRC.

This topic is closed to new replies.

Advertisement