PDA

View Full Version : Something simple in OpenGL



mihalis_vlhs
01-01-2010, 05:33 PM
I want to make a exe file with C++ including OpenGl library. All ok when i m running the exe but when i close the graphical environment that time the dos environment close also. I want to have a menu with tasks in black environment of C++ and everytime i want drawing i 'd like the graph window open, close and continue in home menu of dos environment.

V-man
01-01-2010, 07:25 PM
That has nothing to do with GL.
For windows, you would just make a console project with main(). I think you need to call CreateWindow (I think GLUT works that way) and setup the pixel format, render with GL.
When the user want to close the window, just kill the window. Your console will continue to run.



int main()
{
while(1)
{
cin>>dowhat;
if(dowhat==makeWindow)
CreatWindow();
else
break;
}
cout<<user doesnt want to make another window. Quitting.
}