12 comments

[ 0.32 ms ] story [ 56.7 ms ] thread
Thanks for this, I'm just starting with graphic programming. I'm using the irrlicht engine, but this is better to get the theory down.
This is really good, but it hasn't been updated for more than one year now.
anyone have a recommendation for an introduction to using open gl for 2d stuff?
It's pretty much exactly the same thing except you multiply everything by a matrix that looks something like this instead of the standard projection matrix:

    2/screen_width,  0,               0, 0.5,
    0,              -2/screen_height, 0, 0.5,
    0,               0,               1, 0,
    0,               0,               0, 1
Then assuming that you are drawing back-to-front and don't want to do depth-rejection you can just disable depth testing:

    glDisable(GL_DEPTH_TEST);
Also sprite batching and texture atlasing tend to matter a little more since you're rendering a ton of 4-vertex sprites.
Sure, but when you're at the tutorial level, I think you can mostly ignore that. Worry about it once you've got the rest down.
I think you are better off using higher-level 2D library. For example, SDL will do the same, while reducing the amount of boilerplate code.
Great work. I just skimmed thru it and only found references to regular GL... Does it talk about GL ES too? thanks for making this available
(comment deleted)
Note of warning: the book is not complete AND is in this state for a few years already.