• Advertisement

Archived

This topic is now archived and is closed to further replies.

Am I simply dense?

This topic is 5823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I got Pazera''s Isometric Programming book, and I''ve been going through it and running his .exes to see what they do etc. etc. And I''ve reached the point where I want to make some changes to them, and see what happens, just to better understand things. I figure the best way to go about this is to compile them from his source code, make sure they work like that, and then go back and alter them. So, specifically, I start with IsoHex25_2, put in all the necessary files, link all the necessary libs and compile that puppy. No errors. Whoo-hoo I think, I can do the most basic Microsoft C++ function - compiling. So I run the program, the screen goes black for a second, and I''m back staring at the compiler. Hmmm, I thinks, that doesn''t look like the included exe, so I fire that up to check it again. Nope, indeed, it makes a nice little field of brownish tiles. So I try everything I can think of. I add the texture.bmp file to the program, I put it in the same folder as the exe etc. etc. WHAT am I doing wrong?? Cheers, Dr. Charm

Share this post


Link to post
Share on other sites
Advertisement
I am not exactly familiar with this book or the examples but compiling the code is usually the toughest part. Here are a few things that I would check to resolve this issue.

1. Often when I am dumped back to desktop, some part of the DirectDraw or Direct3D initialization has failed. You could use message boxes to test if the program is falling out of init somewhere.

2. It could be that some resources are missing. Are all the tile bitmaps in the correct directory where the program can access them?

I hope this helps.

--Chris

Share this post


Link to post
Share on other sites
Thanks for the response,

I thought about doing this, unfortunately, I really am a newbie at this thing, and I''m not sure how to do this. Any help would be very much appreciated. Would this be in the ''TheWindProc'' function?

Cheers,

Dr. Charm

Share this post


Link to post
Share on other sites
and this is why you should learn ho to program BEFORE trying to create a game. seriously, you should take a break form the sio book and learn some basic programming as well as learn how directx works (since you seem to be using directdraw). this will greatly help you, instead of having ppl trying to solve why the code you THINK you copied correctly is not working. once you understand what you are coping then you will have a better understanding of why something may not be working and will better understand how to ask the questions that will be able ot help you. the only ppl that can really help you are the ppl that have used that book or are using that book. have you even botherd trying to compile the code WITHOUT changes? you may be making changes that are not good at all. also you may consider writing error messages out to a file. if you dont know how to write to a file, check gamedev''s getting started area and learn some c/c++. trust me, it will help you in the long run.

Share this post


Link to post
Share on other sites
If you run a program by clicking the red exclamation point in Visual C++, the working directory is NOT "ProjectName\Release\" or "ProjectName\Debug," but the main "Projectname" folder. This may be your problem.

Share this post


Link to post
Share on other sites
TerranFury, I realised that and tried to run the exe from outside the compiler as well. Still no dice.

''no person'', I appreciate your advice, however, if you had actually read my original message, you would see that in fact, I did bother to compile the code without changes, it doesn''t work.

Thanks,

Dr. Charm

Share this post


Link to post
Share on other sites
Make sure you have the debug version of DX installed and watch the debug messages when running the program from within the Visual C++ IDE, that way you can see if something fails in the initialisation of DirectDraw/etc.

(If you get very little or no debug information, check to see that the debug-sliders in the DirectX control panel applet are turned to their maximum setting)

Share this post


Link to post
Share on other sites
Okay, I seem to be getting some sort of hang-up in this bit of code:


//draw triangle strip
void LPD3DDEV_DrawTriangleStrip(LPDIRECT3DDEVICE7 lpd3ddev,D3DTLVERTEX* pvertices,DWORD dwvertexcount)
{
//draw the triangle strip
lpd3ddev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_TLVERTEX,pvertices,dwvertexcount,0);
}

With accompanying errors for ''lpd3ddev'', ''pvertices'' and ''dwvertexcount'' CXX0030: expression cannot be evaluated.

Any guesses/thoughts?

Cheers,

Dr. Charm

Share this post


Link to post
Share on other sites
now you say you compiled the code, with no changes and it still dont work. you did not mention this in your original post, you merely say that you compile, make sure they work and then alter them, which to me sounds like you altered them and are having problems with that. also by puttin ANY files into a project your are ALTERING the project. you should (if the book was worth the paper its printed and the disc the polycarbonate) have already created project worksapces which you dont have to add libs nor files. just open and compile. they should also run like that as well. if they dont, then your author made some HUGE mistakes which unfrotunatly cant be helped unless someone with the book knows why they are not working.

as to your expression cannot be evaluted (you should mention WHERE this error code is from, is it a dx debug message, compile error message, debugger error message, etc.) its also nice of you to finnaly mention the directx version you are using. akes things abit easier (its like pulling teeth to get information that is helpful in some way to help you). the code you sure there is perfectly valid (pretty sure, have not used d3d7 in a while) but horrible written (no checking for errors and returning void, that is just poor practice).

i still stand that you should learn to program so you can better ask your question and understand more of what is going wrong. nobody is going to debug a book''s source code for you peice by piece to make sure it all works. this book, from the small code snippet provided, sounds like it was written in a rush and neglects good programming practices. hiding direct3d in the manner he is, is quite silly and counter productive. granted it may be faster to learn by not understanding d3d7, but it makes for a difficult time trying to debug the code.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by parklife
mr Person, don''t jump people just because you are having a bad day.

/john


It''s the truth..It very hard to debug someone elses error message without the proper information.

Share this post


Link to post
Share on other sites

  • Advertisement