Good modern OpenGL tutorial for 2D games

Can you recommend me a good OpenGL tutorial for 2D games? I want to use OpenGL 2.1 (no glBegin(), glEnd() and other deprecated functions).
closed account (10X9216C)
Well OpenGL 2.1 still supports those functions, you might as well use OpenGL 3.3+ which removes them, and does quite a few changes to GLSL, which you'd be using.

It's not 2d but 2d is basically just 3d with z component set to zero and using a different type of projection matrix.
http://www.arcsynthesis.org/gltut/
Thanks, then I will learn 3D and for 2D render (multiple) triangle(s) to which I will apply a texture to. (I will make a Sprite class to make drawing multiple sprites easy)

you might as well use OpenGL 3.3+

Thanks for pointing this out. I ran into a weird problem.

When I run glewinfo.exe from the GLEW package, I get this output:


....
GLEW version 1.10.0
..
Running on Intel HD Graphics GPU from Intel
OpenGL version 2.1.0 - Build 8.15.10.2993 is supported

........

// Everything to 3.1 is OK

GL_VERSION_3_1:                                                OK 
---------------
  glDrawArraysInstanced:                                       OK
  glDrawElementsInstanced:                                     OK
  glPrimitiveRestartIndex:                                     OK
  glTexBuffer:                                                 OK

GL_VERSION_3_2:                                                MISSING 
---------------
  glFramebufferTexture:                                        OK
  glGetBufferParameteri64v:                                    MISSING
  glGetInteger64i_v:                                           MISSING



(Almost) everything OK.
Now the weird part:


GL_VERSION_3_3:                                                OK 
---------------
  glVertexAttribDivisor:                                       OK


Note: Things after // are comments that I added, like in C++

Remember the bold text on the beginning?
What is this?

Question 1:
Why does glewinfo.exe say that max OpenGL version is 2.1.0, but everything to 3.1 is fully supported?

Question 2:
Why can't I use OpenGL 3.3 if just 2 out of 3 features from OpenGL 3.2 aren't supported?

Thanks in advance.
closed account (10X9216C)
There is a lot more to the extensions than just those functions (some are GLSL related and looks like glew doesn't check those, only the functions). If it doesn't support all the extensions then it doesn't support that core. Even if it does only support a part of it.

If you are using an integrated intel 2000 HD graphics chip, those have probably dropped support a long time a go. I know my intel 3000 hd only supports 3.1 fully. Your better off getting a dedicated graphics card, nvidia has a pretty decent one for $100.
some are GLSL related and looks like glew doesn't check those, only the functions

For example, my GPU supports shaders #version 120 , and OpenGL 3.1 is #version 310 core

If you are using an integrated intel 2000 HD graphics chip, those have probably dropped support a long time a go. I know my intel 3000 hd only supports 3.1 fully

Yes, I know these graphics cards have dropped support a long time ago. My solution: Get a cheapest Mac (with Intel HD Graphics 4000 or Intel Iris (pro) graphics) and add -framework OpenGL to command line options, or even better, create an Xcode project from the OpenGL game template. Maybe use SpriteKit for 2D and SceneKit for 3D (unfortunately, Objective-C).
Last edited on
Topic archived. No new replies allowed.