What is OpenGl ? Should i start with it ?

Started by
12 comments, last by Daaark 11 years, 2 months ago
Hello guys i have a doubt, what is opengl and should I start of with it ? And also is it necessary for anyone to make their game from open gl or they can start their own ??
Advertisement

Hello guys i have a doubt, what is opengl and should I start of with it ? And also is it necessary for anyone to make their game from open gl or they can start their own ??

OpenGL is a 3D rendering API that provides a reasonably uniform way for your application to talk to the GPU driver, on Mac and Linux it is the only option you have for hardware accelerated graphics. (Allthough there are higher level libraries that you can use instead but those all use OpenGL under the hood).

On Windows there is also Direct3D which does the same thing (and alot of people consider Direct3D to be cleaner and thus less painful to work with), Direct3D tends to also have better support on intels GPUs (So for semi-advanced -> advanced games on Windows it is often the better option of the two since it allows users with cheaper hardware to play aswell)

You don't have to use either of them unless you need hardware acceleration, The only way to get hardware acceleration without using OpenGL or Direct3D (directly or indirectly) (On the PC, consoles normally have their own APIs but you don't have to worry about those at this point) would be to write your own driver for each GPU you want your game/API to support (This is extremely difficult since the necessary documentation is kept secret by the manufacturers and the number of different GPUs out there is growing constantly).

There used to be a few other vendor specific 3D APIs on the PC (Glide for example was used by the Voodoo series) but they're all dead now, any new PC GPUs that gets released must support Direct3D and OpenGL in order to work with existing software and game developers don't want to use an API that only works with hardware from a single manufacturer (unless its a console where all units will use the same hardware anyway) so introducing a new low level 3D API will be incredibly difficult.

If you don't need hardware acceleration you can use whatever 2D API your OS provides. (Or a higher level library).

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

so you mean that every game made is made with opengl or direct3d ?

so you mean that every game made is made with opengl or direct3d ?

Every modern game that uses 3D, yes. (post 2000 or so)

With exception of some consoles that have their own APIs

so you mean that every game made is made with opengl or direct3d ?

No. He said that games could be using

A: OpenGL

B: DirectX

C: Your own drivers and custom API

D: The drawing API provided by the OSes of choice.

Naturally you can also create 3D games using C and D. Take a look at Quake, for instance.

That's software rasterized polygons. Simple 2D raycasting can be used to create games like Wolfenstein 3D (and Doom, if you're clever)

You can access much in cross-platform drawing through the use of browsers. It's easily the most cross-platform way to create games, and doesn't necessarily depend on OpenGL (That's the browser that decides on rendering.)

So there's no rules as of what to use where.

Only it's probably more common to use existing API's for Hardware acceleration when developing 3D applications (As Olof said, most modern 3D games use them)

Naturally, higher level frameworks and libraries such as SDL allow even more abstraction than basic DirectX and OpenGL.

Every game will probably need to communicate to the GPU in some way. Thats what Direct3D and OpenGL are there for (in PC at least). You choose one or the other to communicate to your GPU and tell it what to do.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

so you mean that every game made is made with opengl or direct3d ?

These days, yes. Glide is long-gone.

These days DirectX 11 is the de facto standard in 3D graphics. Newer OpenGL versions aim to mimic the functionality of DirectX 11 but still retain the flaws of the past where bind-to-edit made a small semblance of sense.
DirectX 11 is closer to how hardware actually works and gives you closer access to the root of the hardware.

Another problem with OpenGL is that its support varies quite widely between vendors. What works for you will not necessarily work for your friend when you ask him or her to test your game. Due to DirectX’s strict guidelines this is much less common in DirectX. I know of only one single mobile graphics card and driver version in which what works for you may not work with your friend. Otherwise, if your friend does not have that mobile Radeon graphics card and that specific driver installed for it, what works for you works for all.

In any case, all relevant consoles are using API’s that are either DirectX 11 or extremely similar, and this is where the industry is heading. It is basically your best bet for now as far as learning an API relevant to the future of game programming.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

If your just starting out programming start by learning C++ and maybe SDL...Then check out OpenGL once your more confident.

I'm just starting and going with Allegro as my API which I think also links into OpenGL

SDL or Allegro give user inputs, sound etc then u can use OpenGL to do the graphics if u want.

What is OpenGL

OpenGL is a library of C code that talks directly to your graphics driver, which in turn sends commands to your GPU. Basically, it does little more than set rendering options, and than send commands to draw lists of vertices. Microsoft has a version of this for their platforms called Direct3D, and it has just about the same functionality.

Should I start with it?

Only if you are programming a graphics engine (as that's all it's good for). If you just want to make games, go use a toolkit like Unity3D, Panda3D, or something similar, and focus on your content, design, ideas, and actually making a working game.

There is really no reason to write your own graphics engine anymore.

For several reasons:

Graphics engines have gotten complex. It's very difficult and time consuming to implement all the required features, and make sure they work across all the different GPUs. Making a graphics engine will take on a life of it's own, that will detract from actually making a game.

There is nothing left to invent. A graphics engine just organizes the steps of setting up vertex buffers, render states, and draw calls. Everything interesting after that happens on the GPU. It's all standardized behavior. So regardless of what your code looks like, the end result is entirely up to your content(models, shaders, materials).

Given the same content input should get you a similar final image from any rendering engine regardless of if it uses Direct3D or OpenGL, and regardless of who wrote the engine.

So if you want to make games, go find a toolkit and make games.
If you want to be a graphics programmer, start mucking around with Direct3D or OpenGL.

There is really no reason to write your own graphics engine anymore.

For several reasons:

...

There is nothing left to invent. A graphics engine just organizes the steps of setting up vertex buffers, render states, and draw calls. Everything interesting after that happens on the GPU. It's all standardized behavior. So regardless of what your code looks like, the end result is entirely up to your content(models, shaders, materials).

Hardly true at all. If Doom, the Quakes, and then Rage have proved anything, it is that there is still a lot left to be done on even current-gen hardware. Rage running at 60FPS on the equivalent of a Radeon X1800 is nothing to laugh at, and neither is the notion of writing one's own graphics engine. As far as having "nothing left to invent", again, not true at all. A game made with Unreal Engine 3 will look different and run much slower (invariably) than a game made using, say, id Tech 4 or Unity.

This topic is closed to new replies.

Advertisement