OpenGL Blues

Started by
5 comments, last by PyroFragger 24 years, 6 months ago
OpenGL programs for windows, must be Win32 applications (window and all), and cannot be console programs as far as I know (it may be possible)
Advertisement
Console apps in the newer versions (4.0 and above) or Microsoft compilers are weird things. They aren't exactly DOS apps. From consoles, you can still get access to all the windowing functions available in the win32 api. Console apps even support mfc. So you can use either console or Win32 apps to program for OpenGl.

What those tutorials were probably getting at though is that there are a couple of ways to use Opengl. Typically, if you're using a Win32 app, you're going to be creating your window and doing all your setup yourself. If you're going to be using a console app, the way to go is probably GLUT, the GL Utility Toolkit(I think). This is just a library that makes it a lot easier to initialize OpenGL and get yourself up and running. It's commonly used for demos, but I don't think too many commercial apps use it, as it's not installed in Windows by default.

Hope this was helpful
Jonathan

Thanks guys. I see now. And I have been experimenting with GLUT myself. I'm going to go with the win32 app and not the console. Does anyone know a tutorial abbout implementing a GUI with OpenGL, I've only seen one for DX.
I just felt that I'd throw in a little bit extra. Usually you use console apps with, as Jonathan said, GLUT. This is actually usually a useful thing, because, in addition to being able to render your GL stuff in the graphical window that you open up, you can printf stuff to the console window at the same time -- it makes it extremely easy to debug. As for the commercial use of GLUT, there is none. I don't know of any commercial apps that use it, but that doesn't make it any less useful -- in fact, I love it, and you will too, damnit! =)

Well, I suppose I should stop typing now.

-Nick

It doesn't really matter to OpenGL, both console or Win32 apps work fine. What matters is what makes sense for your game/app.

In Tribes (and Tribes2) we used a console app because we wanted to use the same executable for the dedicated server as well as the client. In client mode, it just created a window and used wglCreateContext to "bind" OpenGl to that window DC (just like you would for a win32 app). In dedicated mode it does not create a window, avoiding a ton of windows/opengl overhead, and simply echos info to the console.

--Rick

This is a really simple question, yet the answer eludes me. I have looked on two different OpenGL tutorial pages, one says that the OpenGL program should be a win32 app and the other says that it should be a console app. Anybody got an answer.
You want a GUI for opengl?
You might want to check out GLUI:

GLUI is a GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications. It is window-system independent, relying on
GLUT to handle all system-dependent issues, such as window and mouse management. Features of the GLUI User Interface Library include:

- Complete integration with GLUT toolkit
- Simple creation of a new user interface window with a single line of code
- Support for multiple user interface windows
- Standard user interface controls such as:
- Buttons
- Checkboxes for boolean variables
- Radio Buttons for mutually-exclusive options
- Editable text boxes for inputting text, integers, and floating-point values
- Spinners for interactively manipulating integer and floating-point values
- Static text fields
- Panels for grouping sets of controls
- Separator lines to help visually organize groups of controls
- Controls can generate callbacks when their values change
- Variables can be linked to controls and automatically updated when the value of the control changes ("live variables")
- Controls can be automatically synchronized to reflect changes in live variables
- Controls can trigger GLUT redisplay events when their values change
- Layout and sizing of controls is automatic
- Controls can be grouped into columns
- User can cycle through controls using Tab key


I never used it before so I can't recomend it from experience, I ran across it the other day while looking for a cross platform GUI.

Also, if you were to write your program as a console app I would think it would be easier to port to Linix if you ever decided to do so.


"You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!""

This topic is closed to new replies.

Advertisement