Win 32 API with OpenGL
I wanted to create a window which would popup when the program start. It would allow the user to select the window height, width, fullscreen, screen resolution .. etc. Then create the Gl Window based to that info. Is that possible?
My Creative Contest demo entry source" has got exectly what you're talking about.
Have a look at the following files: Dlg.h, Dlg.cpp, OptionsDlg.h, OptionsDlg.cpp, and main.cpp. Basically, you create a dialog template in visual c++ (which I'm assuming you're using), give its ID to my Dlg class (My OptionDlg class hard codes that ID (its a child class of Dlg)) and call DoModal(). The dialog will stay open until the user closes the dialog whereafter I get the settings. The code is all straight Win32, and can thus be a bit much, but you can use MFC (which an add a lot of bloat to your code) instead as it handles the win32 wrapping for you. Personally I like the "down and dirty" win32 code [smile]
While you're more than welcome to make use my code, I strongly suggest that you just use it as a reference and look up the Win32 function calls necessary to create a dialog, as well as the commands needed to get the states of tick boxes, radio buttons, edit boxes etc. I'm also not on the net too often so can't help you much with working out my code [depressed]
Hope that helps and good luck.
Have a look at the following files: Dlg.h, Dlg.cpp, OptionsDlg.h, OptionsDlg.cpp, and main.cpp. Basically, you create a dialog template in visual c++ (which I'm assuming you're using), give its ID to my Dlg class (My OptionDlg class hard codes that ID (its a child class of Dlg)) and call DoModal(). The dialog will stay open until the user closes the dialog whereafter I get the settings. The code is all straight Win32, and can thus be a bit much, but you can use MFC (which an add a lot of bloat to your code) instead as it handles the win32 wrapping for you. Personally I like the "down and dirty" win32 code [smile]
While you're more than welcome to make use my code, I strongly suggest that you just use it as a reference and look up the Win32 function calls necessary to create a dialog, as well as the commands needed to get the states of tick boxes, radio buttons, edit boxes etc. I'm also not on the net too often so can't help you much with working out my code [depressed]
Hope that helps and good luck.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement