Skip to content

Instantly share code, notes, and snippets.

@uniqx
Created July 21, 2011 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uniqx/d3b869dd3fbc428728d2 to your computer and use it in GitHub Desktop.
Save uniqx/d3b869dd3fbc428728d2 to your computer and use it in GitHub Desktop.
simple_opengles_wrapper.py
# -*- coding: utf-8 -*-
#!/usr/bin/python
from ctypes import cdll, c_int, c_uint, c_float
GL = cdll.LoadLibrary('libGLESv2.so')
GL.GLuint = c_uint
GL.GLint = c_int
GL.GLenum = c_uint
GL.GLfloat = c_float
# OpenGL ES core versions
GL.GL_ES_VERSION_2_0 = 1
GL.GL_TEXTURE_2D = 0x0DE1
GL.GL_CULL_FACE = 0x0B44
GL.GL_BLEND = 0x0BE2
GL.GL_DITHER = 0x0BD0
GL.GL_STENCIL_TEST = 0x0B90
GL.GL_DEPTH_TEST = 0x0B71
GL.GL_SCISSOR_TEST = 0x0C11
GL.GL_POLYGON_OFFSET_FILL = 0x8037
GL.GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E
GL.GL_SAMPLE_COVERAGE = 0x80A0
GL.GL_NEVER = 0x0200
GL.GL_LESS = 0x0201
GL.GL_EQUAL = 0x0202
GL.GL_LEQUAL = 0x0203
GL.GL_GREATER = 0x0204
GL.GL_NOTEQUAL = 0x0205
GL.GL_GEQUAL = 0x0206
GL.GL_ALWAYS = 0x0207
GL.GL_FRONT = 0x0404
GL.GL_BACK = 0x0405
GL.GL_FRONT_AND_BACK = 0x0408
# ClearBufferMask
GL.GL_DEPTH_BUFFER_BIT = 0x00000100
GL.GL_STENCIL_BUFFER_BIT = 0x00000400
GL.GL_COLOR_BUFFER_BIT = 0x00004000
# Boolean
GL.GL_FALSE = 0
GL.GL_TRUE = 1
# BeginMode
GL.GL_POINTS = 0x0000
GL.GL_LINES = 0x0001
GL.GL_LINE_LOOP = 0x0002
GL.GL_LINE_STRIP = 0x0003
GL.GL_TRIANGLES = 0x0004
GL.GL_TRIANGLE_STRIP = 0x0005
GL.GL_TRIANGLE_FAN = 0x0006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment