Generated Exe files.
Hello people. This isn’t too serious, yet. But I still think it’s strange. Compiling and executing projects in VC++ 6.0 works great, with the help of all the articles on this page I’m doing some real progress. But the .exe files the compiler generates doesn’t seem to really work to well. For example, the compiled and executed program shows a texture mapped cube spinning around. Works perfectly, but once I try to start it by using the precompiled .Exe file. It does nothing, it just shows an empty OpenGl window. Iv tried the obvious ‘Build all’ ‘Build .exe’ and so on. But nothing seems to work. So ... anyone know what could be wrong.
--------------------Moo, that’s right, moo!
Build all just means to update everything i think.
Try changing from debug mode to Release mode.
Try changing from debug mode to Release mode.
If you''re reading data from files, make sure that the paths are correct: If you run the program directly from devstudio, the current directory is the project directory. If you run the exe without using msdev, the current directory is the .exe directory, which is project directory\debug\ or project directory\release\
GA
GA
Visit our homepage: www.rarebyte.de.stGA
Ga is right. When running a program after building it, the root directory is the main project folder, but when you run the .exe file, the root directory is the debug or release folder. in which case the data used in your game cant be found.
Ga, It was pretty much exactly what you said so everything’s in order. Thanks for helping out a newbie!
--------------------Moo, that’s right, moo!
This is a common question that I''m asked, as a few people have stated, if you run the program from the RELEASE or DEBUG folder it can''t find the DATA folder... what you have to do is copy the program into the directory where your DATA folder is.
Or better, change the output exe under the link tap in the project settings to the project directory.
Thanks people, its working fine now so It’s ok. , Sorry if I asked a question that’s asked a lot NeHe, it’s just that it isn’t that obvious when your new to the whole thing, just worked with DJGPP before ... Hmm ... I guess I could take the opportunity to ask another thing. Iv been working a bunch with the tutorials here, and as any respectful newbie does, I have tried to modify them using what little knowledge I have. After applying textures to the cube, I peeked ahead a little to see how to do Key Control. This was easy enough to implement so I did just that. After you could rotate the cube I started playing around with the glTranslatef function in order to create controls that allow you to move around the cube as well. Worked great! ... Until I noticed something strange, when rotating and moving around the cube, it seemed to change its X,Y,Z directions. So X could be Right into/out of the screen for example. After a little thinking I realized that I wasn’t moving/rotating the cube, but the camera! I don’t know if that’s the way the tutorial is built, or it’s just me who has screwed things up. So my question is this, how do you ... ‘bind’ glTranslatef/glRotatef to things, like the camera or a list of polygons(the cube)? ... I guess I’m way of what I should be learning right now, it’s just that I’m on an exploration hype, and just want to know!
--------------------Moo, that’s right, moo!
I will assume that you have your keys[256] array since you are following NeHe''s code, I will also assume that you have windows set a key to true if it recieves a key down msg, and false if key up...
What you will then need to do is, in your WinMain()...
if (keys[VK_RIGHT])
{
execute some statements
}
if (keys[VK_LEFT])
{
execute some more
}
etc...
you can also use normal letters like
if (keys[''A''])
{
statements
}
the above does not imply capital A, it mearly implies the A key on the keyboard is down, if you want capital A, for some reason, do this...
if (keys[''A''] && keys[VK_SHIFT])
{
statements
}
Hope I helped ya.
S.
What you will then need to do is, in your WinMain()...
if (keys[VK_RIGHT])
{
execute some statements
}
if (keys[VK_LEFT])
{
execute some more
}
etc...
you can also use normal letters like
if (keys[''A''])
{
statements
}
the above does not imply capital A, it mearly implies the A key on the keyboard is down, if you want capital A, for some reason, do this...
if (keys[''A''] && keys[VK_SHIFT])
{
statements
}
Hope I helped ya.
S.
Oops, forgot about your second question...
Ok, you have in your drawing function
glTranslated(xTranslate, yTranslate, zTranslate);
glRotated(xRotate, 1, 0, 0);
glRotated(yRotate, 0, 1, 0);
glRotated(zRotate, 0, 0, 1);
Then in your WinMain()
if (keys[VK_LEFT])
{
xRotate ++;
}
etc...
Hope that helped some more.
S.
Ok, you have in your drawing function
glTranslated(xTranslate, yTranslate, zTranslate);
glRotated(xRotate, 1, 0, 0);
glRotated(yRotate, 0, 1, 0);
glRotated(zRotate, 0, 0, 1);
Then in your WinMain()
if (keys[VK_LEFT])
{
xRotate ++;
}
etc...
Hope that helped some more.
S.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement