Home ios - opengl getting started
Post
Cancel

ios - opengl getting started

wiki

Initialization

Before you can actually use OpenGL in a program, you must first initialize it. Because OpenGL is platform-independent, there is not a standard way to initialize OpenGL; each platform handles it differently. Non-C/C++ language bindings can also handle these differently.

2 phrases of OpenGL initialization:

  1. The creation of an OpenGL Context

    1
    2
    3
    
    An OpenGL context represents all of OpenGL.
    Creating one is very platform-specific, as well as language-binding specific.
       
    
  2. load all of the necessary functions to use OpenGL

1
2
3
4
5
6
7
8
If you are using a non-C/C++ language binding, then the maintainer of that binding will already handle this as part of context creation. If you are using C/C++, read on.

In order to use OpenGL, you must get OpenGL API functions. 

For most libraries you are familiar with, you simply #include a header file, make sure a library is linked into your project or makefile, and it all works.

OpenGL doesn't work that way. you must manually load functions via a platform-specific API call. This boilerplate work is done with various OpenGL loading libraries; these make this process smooth.

Tutorials and How To Guides

This post is licensed under CC BY 4.0 by the author.