Glut and Dev C++, Programs not Quitting?

This is a discussion on Glut and Dev C++, Programs not Quitting? within the Game Programming forums, part of the General Programming Boards category; When i write simple programs using dev c++ and glut, i get it to run fine finally, however. lol. When ...

  1. #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

  2. #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.

  3. #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

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>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.

  5. #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 Attached Files
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  6. #6
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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.

  7. #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

  8. #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

  9. #9
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>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.

  10. #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

  11. #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 Attached Files
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  12. #12
    ---
    Join Date
    May 2004
    Posts
    1,379
    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?

  13. #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

  14. #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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL/GLUT in Dev C++
    By Nextstopearth in forum Game Programming
    Replies: 3
    Last Post: 10-01-2008, 06:25 AM
  2. How to Install Glut?
    By Zeusbwr in forum Game Programming
    Replies: 3
    Last Post: 11-26-2004, 05:42 PM

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