Bases: object
Passed iterables of vertex positions, colors, normals and indices, converts them into ctypes arrays, stores them in a VBO, and then creates a VAO that can be used to bind them later for rendering.
Bases: object
Manage modelview matrix.
Presumably this class will go away in future releases of Gloopy as we use a more OpenGL3 style.
Bases: object
Manage projection matrix.
Presumably this class will go away, or be severely modified, in some future release of Gloopy which may use a more OpenGL3 style.
Handler for window resize events TODO: do we also need to set clipping?
Set OpenGL projection matrix to Ortho2D, such that the screen’s shortest dimension (height on a landscape monitor or window) will show exactly scale of the world from the center of the screen to each edge, regardless of screen resolution or window size.
Bases: object
Render class does all the OpenGL rendering
world: instance of World.
window: instance of pyglet Window class
camera: gloopy camera (might be a GameItem instance)
options: instance of Options.
Boolean property to get or set backface culling.
Bases: object
Wraps PyOpenGL’s shader compile and link functions
vertex: filename of vertex shader source code
fragment: filename of fragment shader source code
attribs: a list of attribute names
Compiles and links the shader. For each attribute_name in attribs, looks up the attribute location, and stores it in self.attrib[attribute_name].
Can be bound and unbound by use as a context-manager:
shader = Shader('vert.glsl', 'frag.glsl', [])
with shader:
# draw calls