I myself use OpenGL. Its easy to understand once you get a grasp of which version your video card can support and if you follow the tutorials on this website for game programing : http://www.videotutorialsrock.com
Note : That website is still using OpenGL 2.1 versions. Roughly. But it will still work in your code if your not using functions that are older then version 3.1. AGAIN, your version that you start to code in is what makes the difference between your program working and not working. This IS important. Know your functions ( API calls ) to your OpenGL version. You have been warned.
By the way, to use any of the example source code in any IDE your using, make sure to install freeGlut library since most tutorials are heading that direction now. The old Glut is from 2001. The freeGlut is its replacement. UNLESS your on a MAC --> Then you use the Glut.Framework and the OpenGL.framework.
Code::Blocks fully supports freeGlut / OpenGL it if you install it correctly. There is a tutorial on the C::B wiki that explains how to install FreeGlut for Code::Blocks :