Programming with OpenGL

Posted by Mordi on April 14, 2012, 6:24 p.m.

We decided to switch to C++ for our game. This is a better fit since our programmer will be using C++ and OpenGL at his university, and has proper knowledge about it, and I have been wanting to learn C++ myself. I'm not planning on learning it extensively, but I would like to know enough to make some simple stuff with it.

The last few days, I've gotten to the point where I can load and render images in a window. Now I'll be moving on to making an object-oriented system where I can make a simple user-interface. I might even look into making a system for rooms/states. We'll see how it goes.

Here's how it looks at the moment. It has some animation, but I'll just paste an image.

I'm using OpenGL, with GLEW and freeglut to handle the window and main program. I also use DevIL to load png-textures.

The reason we chose these particular libraries is that they are cross-platform compatible. Our programmer already has code that is cross-platform across Windows, Mac and Linux. Pretty cool!

Our programmer has extensive knowledge about game programming, so he'll be programming the engine we'll be using for the game. I just want to learn a thing or two, so that's why I'm making this.

Stay tuned for more.

Fin.

Comments

JuurianChi 12 years ago

I find it strange that you don't already know that language, due to the level of awesome you always exude.

Good Luck.

Acid 12 years ago

Quote:
I find it strange that you don't already know that language, due to the level of awesome you always exude.

Good Luck.

Rob 12 years ago

Quote:
The reason we chose these particular libraries is that they are cross-platform compatible. Our programmer already has code that is cross-platform across Windows, Mac and Linux. Pretty cool!

Or you could have went with SFML which is compatible with Windows, OSX and Linux, and been able to draw a sprite like this:

windows.Draw(sprite);

Quote:
I find it strange that you don't already know that language, due to the level of awesome you always exude.

I thought he usually worked in C#/XNA?

sirxemic 12 years ago

Quote: Rob
Or you could have went with SFML which is compatible with Windows, OSX and Linux, and been able to draw a sprite like this:
Of course if you have more spare time, it might be more fun to create your own framework.

Like I am thinking of writing my own framework lately after I discovered framework3. No code has been written, just making some plans… slowly…

Mordi 12 years ago

I think SFML would add uneccesary bloat in our case. I want to learn how to use OpenAL as well. I might look into using SDL, though. http://www.libsdl.org/

Alert Games 12 years ago

Well be sure to stick around after you get into it. I'm not going into game development as of now, but in-case I do, I'd like to know how the C++ and OpenGL compares with C# and XNA!

Mega 12 years ago

I'm using SFML for windowing and OpenGL for rendering the sprites (Because of the transforms that can be applied, and the nicer blending functionality).

SFML doesn't add much bloat if you link in the static libraries. :P

Mordi 12 years ago

Today I learned that GLUT/GLEW isn't so great, and should really only be used for quick prototyping or simple apps. I think I'll look into using SDL instead. It seems pretty good, although that too carries with it some "bloat". I would prefer to do everything with zero bloat, but I could settle for something like SDL. I guess it's not too dissimilar to SFML in some ways.

SpectreNectar:

There are actually only 12 vertices in that application, across three quads. In all seriousness though, I've been meaning to figure out whether using a pixelbuffer/buffer-object (not sure what it's called) would be faster. I've seen several examples using the method I have in there now, and none of them mentioned anything about speed. But I can't help thinking that rendering a texture to a quad would be slow… I'm not used low-level functionality.

Mordi 12 years ago

Cool, thanks for the tip.

sirxemic 12 years ago

If you want as little bloat as possible, perhaps the framework used for these tutorials might be useful for you - http://www.arcsynthesis.org/gltut/

(Oh, and that's just graphics)

EDIT: such little bloat that you would have to implement texture creation from png and jpg images yourself. But it's useful for 'modern' graphics programming.