Skip to main content
gamedev.net
🔒 Locked

Bitmap trouble still....

Started by Viri- 9 replies 550+ views
Original Post
Viri-
Viri-
Ok I've included all my files for my problem. I have changed every bit of my work in order to attempt to get this to work. I don't have any other choice but to see if anyone can figure this out for me. Thank you very much. A description of my problem: I am in DX7 using all the DX7 decls.. (LPDD7 stuff) and have created a primary, secondary surface with minor error checking in it. And I'm trying to load a bitmap file called aship.bmp. I have worked with everone's help to get a good loading function useing GDI and also a display routine. But maybe the entire problem is in the template I am using. But when I attempt to blt the image from the offscreen surface (yes its created correctly Does not initiate an error.) my monitor goes from fullscreen mode (I hear a click) and then imeadatly out of it (I hear a diff click that lets me know) so something is failing but I can seem to figure out what... my files are @: http://revolution.valveworld.com/izzy.cpp http://revolution.valveworld.com/izzy.h http://revolution.valveworld.com/template.cpp http://revolution.valveworld.com/aship.bmp aship is the file bitmap I'm trying to display on the screen. Please help Thanks, Viri- Edited by - Viri- on 10/23/00 9:54:50 PM
------------thanks,Phoenix
Viri-
Viri-
would it be easier if I just pasted the files seperatly on the board? They are quite long?

Thanks,
Viri-
------------thanks,Phoenix
DeltaVee
DeltaVee
Zip the WHOLE project up and post that on your site.

including make files etc.......

Edited by - DeltaVee on October 23, 2000 11:58:33 PM
D.V.Carpe Die<FONT C
MadButch
MadButch
Did you debug it?
If you don't have the possibility to remote debug it, add a log file class to it. Then write error messages to the log file when something in your program fails.

I'm gonna take a look at it now...

Edited by - MadButch on October 24, 2000 2:23:25 AM
Check my games out at:http://www.GamePlayHeaven.com
MadButch
MadButch
Ok, first, here''s what wrong:
void CreateBitmapSurface(LPDIRECTDRAWSURFACE7 lpSurface, char *fname, int xs, int ys)
Should be:
void CreateBitmapSurface(LPDIRECTDRAWSURFACE7 &lpSurface, char *fname, int xs, int ys)

It was a simple debug...
Your app crashed on the following line:
lpddsback->BltFast(0, 64, lpddsTest, &aRect, DDBLTFAST_NOCOLORKEY | DDBLTFAST_WAIT);
Checking the variables points to lpddsTest, which was NULL.
Stepping back thru the code reveals the CreateBitmapSurface function, which didn''t work as you thought it would

Also, I don''t know how you got started on this, do you understand everything that''s happening?

I would recommend you to add more comments to the code. You''re probably want to know what''s going on in a few months time to

And add decent error handling... there are no checks whether LoadImage of the bitmap succeeded... No checks if the surface pointer is filled, etc...
This is Serious...
Try to build an error check on everything that can go wrong, if it does go wrong: write messages to a log file. If you''re not gonna do this, you will be searching for errors endlessly...

oh yeah... I don''t think msgBox (I''m sure MessageBox() doesn''t work!) works after your application has created an EXCLUSIVE FULL_SCREEN primary surface... the box will appear behind your app and you wont see it... which will make it look like the app hangs...
Check my games out at:http://www.GamePlayHeaven.com
MadButch
MadButch
Oh yeah...

Good luck!
Check my games out at:http://www.GamePlayHeaven.com
Viri-
Viri-
Ok thanks a lot. I do have quite a bit of a clue to what is going on. And I also do comment my code as well as I can but I''ve deleted and re typed many lines through out my quest to fix this. I gave up on commenting it very well. I knew something in the line was failing but when I tried to use VC++5''s debug it wouln''t allow me to set break points. It''d always say that it wouldn''t work. So maybe you could anwser a few questions on how to debug it and what I''m doing wrong. I''ve also just written a error script like thing that everyone has told me to do. But thanks again!

Viri-
------------thanks,Phoenix
MadButch
MadButch
No problem...

What help do you need on debugging?

First of all, debugging an exclusive full screen application wont work... because your app has the focus, and wont give it away, If you encounter a breakpoint it will look like your game hangs.

If you have 2 pc''s, use remote debugging... that''s the best way to do it...

the last possibility is using 2 monitors (and 2 video cards), but if you have to buy a new monitor and videocard, you might as well try to get a cheap 2nd hand system somewhere, and use remote debugging.
Check my games out at:http://www.GamePlayHeaven.com
Viri-
Viri-
ok I''ve got a P-166 laptop, a P-90 Laptop. A home networking kit running. I''m running on a P-III 500mhz, 128mb Ram, TNT video card, etc. I''ve also got a 486-dx2-66mhz computer that is in parts along with another monitor. So if I took that old VGA card or what ever it has in there I could install that and connect my other monitor to it and it''d work?

How do I do this? Where can I get info about it?

Also when I run my program my pic comes out scrambled. What is causing that?

Thanks,
Viri-
------------thanks,Phoenix
MadButch
MadButch
I need your compleet project zipped up to get a good look at...

I need:
.cpp and .h files
.dsp and .dsw file
and if you''re using resources, the .rc file!

I had to add code to your sample to get it running at all..

So.. zip those up and put them at your site..
EMail me at MadButch@OneCoolDude.Com, or check my ICQ 91919626
Check my games out at:http://www.GamePlayHeaven.com
Viri-
Viri-
I got it working. Writing the error log stuff right now. Thanks for all your help. If you still would like to see what I''ve got right at this moment just let me know. Thanks again,


Thanks,
Viri-
------------thanks,Phoenix

Topic Locked

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

Sign in to reply to this topic.