C Board  

Go Back   C Board > General Programming Boards > Game Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-26-2004, 05:49 PM   #1
#junkie
 
Join Date: Oct 2004
Posts: 240
Glut and Dev C++, Programs not Quitting?

When i write simple programs using dev c++ and glut, i get it to run fine finally, however. lol.

When i run the program, and quit, by either Esc or the Close Box Button, Dev C++ will not compile or run another program. Aparently it thinks my program is still running, and i have to press program reset.

I want to know is this a problem with the coding of the program? Ie is it actually not closing and causing memory leaks and whatnot? Or is this another quirk of Dev C++ i am missing? Because i have had Dev C++ do that before, however not with opengl programs. I believe it was incorrectly coded Win32 programs.

Anyway thanks again to anyone that helps, hopefully this will be the last of my quirk bugs lol.

Then ofcourse we got syntax, coding, and ect. Bugs.

Thanks all
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-26-2004, 06:17 PM   #2
I am the worst best coder
 
Quantrizi's Avatar
 
Join Date: Mar 2002
Posts: 644
We can't tell you when we have nothing to see...

Anyways, I'm assuming you didn't add a PostQuitMessage(0); inside your WM_DESTROY.
__________________
poems by me
Quantrizi is offline   Reply With Quote
Old 11-27-2004, 01:08 AM   #3
#junkie
 
Join Date: Oct 2004
Posts: 240
I dont know, i didnt add anything. It is all tutorials i got online, not changed at all. No errors during the build, just a after effect of runtime if you will.

I'll try and post a sample Tutorial tonight, a exact txt of one or two im using, then try to include the links of them. If i can find the links lol, i download them into mht format cuz my comp isnt on the internet lol. (obviously im not on mine ).
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-27-2004, 05:38 AM   #4
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
>>I'll try and post a sample Tutorial tonight<<

If the project is small enough, just zip it up and attach it to your post. That way it should be easier for someone else to test your code exactly as you have (compiler switches, libs etc).
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 11-27-2004, 06:06 PM   #5
#junkie
 
Join Date: Oct 2004
Posts: 240
Well here it is, hope this is what you wanted lol.

My .dev file and .cpp file from a tutorial that is not working correctly. Hopefully, by what you said, the dev file contains all the project info such as libs, ect.

Anyway, i dont know jack about opengl or glut, i am learning the basics of glut to allow me to code in opengl (windowed), and other benifits of it obviously lol.

Anyway, thanks for the help
Attached Files
File Type: zip main.zip (1.5 KB, 62 views)
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-27-2004, 06:40 PM   #6
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
Works for me, which doesn't help you much. You don't have to forward declare your 'main' function, BTW, but that isn't the problem.

I tested your code with under winxp sp2 using glut 3.7.3. If your not using that version of glut then try it and see if that helps.

Also check the task manager to see if the program is exiting properly or it's just an issue with dev-cpp.
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 11-27-2004, 08:17 PM   #7
#junkie
 
Join Date: Oct 2004
Posts: 240
i think i am using 3.7.6 if i remember right, but like i said it RUNS fine. Which is why im seeking help also from dev c++ ppl, thinking it may have to do something with c++.

But ya, like i said it runs properly but Dev C++ says it is still running after every run, it makes me Alt-F2 to close it, then it will let me compile or run through devcpp again.

I havent checked the task manager to see if its still running though, but i will when i get home (got places to be atm lol).

Thanks
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-28-2004, 03:54 AM   #8
#junkie
 
Join Date: Oct 2004
Posts: 240
Yes it remains in processes, any ideas on what is wrong with the code?

There has to be some simple shutdown function i am leaving out, hmm.
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-28-2004, 06:12 AM   #9
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
>>Which is why im seeking help also from dev c++ ppl<<

Dev-cpp is just an ide for MinGW.

>>There has to be some simple shutdown function i am leaving out<<

Glut handles windowing, including startup and shutdown code. I've updated my version of glut to 3.7.6 and cannot reproduce your problem with dev-cpp 4.9.9.0.

The only thing I can suggest at this point is that you 'clean' the project prior to rebuild and if that doesn't solve the problem then create a new project making sure that the project path has no spaces in it.
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 11-28-2004, 12:13 PM   #10
#junkie
 
Join Date: Oct 2004
Posts: 240
ya i know the compiler is MinGW, i dont think it is a problem with the compiler, more the ide/source. Which is why i ... as i said, was looking for help from devcpp ppl lol, so maybe they can help with a quirk.

But anyway, man, this is weird. Iv created a bunch of dif projects from these default tutorial sources, and i still get the same result. Dunno what to say :/
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-28-2004, 01:51 PM   #11
#junkie
 
Join Date: Oct 2004
Posts: 240
Here is the exe of the program in question too, does it do it on your comp?
Attached Files
File Type: zip Project1.zip (5.3 KB, 57 views)
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-28-2004, 06:10 PM   #12
Registered User
 
Join Date: May 2004
Posts: 1,362
I dont have glut installed so i couldnt run it (needs glut32.dll)
Are you sure you are shutting down glut properly and the end of your code?
__________________
sand_man is offline   Reply With Quote
Old 11-28-2004, 07:00 PM   #13
#junkie
 
Join Date: Oct 2004
Posts: 240
if you scroll up to another attachment you can see my code.

But to answer your question, "No".

Ken said it runs fine, my code that is, it came from a tutorial so i didnt code it at all. I do not know glut what so ever, nor opengl. Im trying to learn, but i have this to get over.
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Old 11-29-2004, 08:43 PM   #14
#junkie
 
Join Date: Oct 2004
Posts: 240
gah, found the problem. Sorry all. Aparently there was a problem with the dll i used with the glut version i had. i replaced the dll with the one from OpenGL.com's site, (glut32.dll) and my programs now work like a charm. Sigh.

Thanks for all your help , btw Ken, where did you get your version of 3.6.7? I need one that works lol.
__________________
01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010
Zeusbwr is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenGL/GLUT in Dev C++ Nextstopearth Game Programming 3 10-01-2008 05:25 AM
How to Install Glut? Zeusbwr Game Programming 3 11-26-2004 05:42 PM


All times are GMT -6. The time now is 02:24 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22