Sign in to follow this  
KrishKP

OpenGL programming

Recommended Posts

In general....OpenGL programming is c++ "graphics programming". Why i say that?

Because to code something which has graphical elements you need external libaries which

support such feature like OpenGL.

So C++ itself cannot do any graphical stuff at all. First additional libaries which their

API's allow the programmer to use function or classes that allow graphical programming.

 

Again OpenGL is such a libary. SDL would be an other one as example.

Edited by exOfde

Share this post


Link to post
Share on other sites
  • I would not say built in functions, because the library itself provides functions we need for our purpose. In the library itself is nothing "built in"
    • but simply said yes you are right
  • OpenGL Code
    • if you use c++ as code language and use the OpenGL library then yes
Edited by exOfde

Share this post


Link to post
Share on other sites

OpenGL, like directx, are bits of code stored in a dll. It doesn't matter which language use them, as long as the language can load dlls, and you have the proper include files to access those functions from the dll, you'll be fine. For example, you could do OpenGL or dx in delphi or c# if you want to, it's just a bit more trouble to make it work at first, but when you're setuped, it's pretty much the same as c++.

 

Learning pure opengl is not easy at first, but fesable. You could start with glut since it handle the setup of a basic application for you, which mean you can concentrate on the code that really matter. Or try something like SDL.

Share this post


Link to post
Share on other sites

OpenGL, like directx, are bits of code stored in a dll. It doesn't matter which language use them, as long as the language can load dlls, and you have the proper include files to access those functions from the dll, you'll be fine. For example, you could do OpenGL or dx in delphi or c# if you want to, it's just a bit more trouble to make it work at first, but when you're setuped, it's pretty much the same as c++.

 

Learning pure opengl is not easy at first, but fesable. You could start with glut since it handle the setup of a basic application for you, which mean you can concentrate on the code that really matter. Or try something like SDL.

what is pure OpenGL?

Share this post


Link to post
Share on other sites
I would guess he meant writing OpenGL code without any helper libraries. That is usually not a good idea. There is a lot of boiler plate code to be written until you get a window you can draw in. SFML, GLFW or SDL both simplify that process massively and are relatively easy to use (and cross-platform). I would not recommend GLUT.

If you are working on Windows you will also want GLEW since you only get (completely useless) OpenGL 1.1 out of the box.

Share this post


Link to post
Share on other sites
The language of your OpenGL implementation is completely irrelevant and there is no one answer. Even on a fairly locked down operating system like Windows, the code contained in the library you link to is just a thin wrapper to communicate with the driver. The language the driver is written in is anyone's guess. Probably C and Assembler. Maybe not. Maybe something else.
The driver will communicate with the graphics card (unless it's a pure software OpenGL implementation, which is possible but not a common use case during game development) where the commands will be run by the manufacturer and model specific hardware.

The point you have to concern yourself with is the C interface defined by OpenGL. Any language which can link to C functions can use OpenGL (pretty much every language which could be used in a production environment can do that). Using a thin C library as a binding any such language could also to be used to create an OpenGL implementation. Edited by BitMaster

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