Sign in to follow this  
justin12343

FLTK on win32

Recommended Posts

I'm using FLTK to create a window (for my renderer) in my current project, but as I understand it will always create a console window in win32 for some reason, which is fine in my debug build. I read that FLTK has a WinMain function that can be overridden, but how? I tried but I've gotten errors so I left it alone and forgot about it, which leads to my second question. Sometimes I forget that I have to close the window that I created to close the app and NOT close the console window, because the game terminates right then and doesn't clean up (DirectX, FMOD, etc.) and causes memory leaks. With that being said, how do I check if the console window was closed or if the application is about to be terminated?

Share this post


Link to post
Share on other sites
It seems like I am linking it correctly. I'm also using the standard main function. I forgot to mention that I am using visual studio 2010, could there be a problem with its compiler?

Share this post


Link to post
Share on other sites
If you are using main(), you are linking a command line application that wants a command prompt window.
You can tell Visual C++ that you want to link a Windows application (using WinMain(), which you must provide) instead; I don't know where the option is located, maybe the entry point is chosen according to which function is present..

Share this post


Link to post
Share on other sites
Thanks a lot! now it doesn't show a console in my release build. Now the only thing is that in debug build when I close the console window, it doesn't break the game loop like it should. Is there any way to check if the console window was closed?

Share this post


Link to post
Share on other sites
My guess: either you or FLTK are doing an ongoing loop in a thread which is not the main thread, and FLTK's main joins that worker thread.

I suggest asking on the FLTK mailing lists TBH.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this