Changes between Version 4 and Version 5 of dev/gfx/opengl


Ignore:
Timestamp:
Jun 24, 2012, 9:50:06 AM (8 years ago)
Author:
sam
Comment:

OpenGL version numbers

Legend:

Unmodified
Added
Removed
Modified
  • dev/gfx/opengl

    v4 v5  
    1 = OpenGL 4.0 and other transitions =
     1= The road to OpenGL 4.0 and other transitions =
    22
    3 Trying to get things done the right way.
     3Notes about various OpenGL versions.
    44
    5 Most of the current code is written for OpenGL 1.1. We want to target both OpenGL 4.0, OpenGL ES and OpenGL ES 2.0.
     5== OpenGL headers ==
    66
    7 == OpenGL usage in Lol Engine ==
     7=== GLEW ===
    88
    9 `class TileSet`:
    10  * ~~`glGenTextures`~~ (available in all flavours)
    11  * ~~`glBindTexture`~~ (available in all flavours)
    12  * ~~`glTexImage2D`~~ (available in all flavours)
    13  * ~~`glTexParameteri`~~ (available in all flavours)
    14  * ~~`glDeleteTextures`~~ (available in all flavours)
     9{{{
     10#include <glew.h>
     11}}}
    1512
    16 `Video::Setup()`:
    17  * ~~`glViewport`~~ (available in all flavours)
    18  * ~~`glEnable`~~ (available in all flavours)
    19  * `glShadeModel` (not in GLES 2)
    20  * ~~`glClearColor`~~ (available in all flavours)
    21  * ~~`glClearDepth`~~ (available in all flavours, as `glClearDepthf` sometimes)
    22  * ~~`glHint`~~ (available in all flavours)
     13=== Most other OpenGL platforms ===
    2314
    24 `Video::SetFov()`:
    25  * `glMatrixMode` (not in GLES 2)
    26  * `glLoadIdentity` (not in GLES 2)
    27  * `glOrtho` (not in GLES 2)
    28  * `glFrustum` (not in GLES 2)
    29  * `glTranslatef` (not in GLES 2)
     15Including Linux, Windows.
     16
     17{{{
     18#define GL_GLEXT_PROTOTYPES
     19#include <GL/gl.h>
     20}}}
     21
     22=== Mac OS X ===
     23
     24Check for both `__APPLE__` and `__MACH__`.
     25
     26{{{
     27#define MACOS_OPENGL
     28#define GL_GLEXT_PROTOTYPES
     29#include <OpenGL/OpenGL.h>
     30#include <OpenGL/gl.h>
     31#include <OpenGL/glext.h>
     32}}}
     33
     34== OpenGL ES headers ==
     35
     36=== Most OpenGL ES platforms ===
     37
     38Android, NaCl.
     39
     40{{{
     41#include <GLES2/gl2.h>
     42#include <GLES2/gl2ext.h>
     43}}}
     44
     45=== Apple iOS ===
     46
     47{{{
     48#include <OpenGLES/ES2/gl.h>
     49#include <OpenGLES/ES2/glext.h>
     50}}}
     51
     52=== Old OpenGL ES 1.x systems ===
     53
     54{{{
     55#include <GLES/gl.h>
     56#include <GLES/glext.h>
     57}}}
     58
     59=== PSGL ===
     60
     61Will include `GLES/gl.h` in turn.
     62
     63{{{
     64#include <PSGL/psgl.h>
     65#include <PSGL/psglu.h>
     66}}}
     67
     68== Version Macros ==
     69
     70=== OpenGL ===
     71
     72All versions of OpenGL provide a version number in addition to the previous versions:
     73
     74{{{
     75#define GL_VERSION_1_1 1
     76#define GL_VERSION_1_2 1
     77#define GL_VERSION_1_2_1 1
     78#define GL_VERSION_1_3 1
     79#define GL_VERSION_1_4 1
     80#define GL_VERSION_1_5 1
     81
     82#define GL_VERSION_2_0 1
     83#define GL_VERSION_2_1 1
     84
     85#define GL_VERSION_3_0 1
     86#define GL_VERSION_3_1 1
     87#define GL_VERSION_3_2 1
     88#define GL_VERSION_3_3 1
     89
     90#define GL_VERSION_4_0 1
     91#define GL_VERSION_4_1 1
     92}}}
     93
     94=== OpenGL ES 1.0 ===
     95
     96{{{
     97#define GL_OES_VERSION_1_0 1
     98}}}
     99
     100=== OpenGL ES 1.1 ===
     101
     102{{{
     103#define GL_VERSION_ES_CM_1_0 1
     104#define GL_VERSION_ES_CL_1_0 1
     105#define GL_VERSION_ES_CM_1_1 1
     106#define GL_VERSION_ES_CL_1_1 1
     107}}}
     108
     109=== OpenGL ES 2.0 ===
     110
     111{{{
     112#define GL_ES_VERSION_2_0 1
     113}}}