Package examples :: Module introduction
[hide private]
[frames] | no frames]

Module introduction

source code

Basic example using VertexArrays, ShaderPrograms, Pipelines, Textures, and logging.


Author: Stephan Wenger

Date: 2012-02-29

Classes [hide private]
  IntroductionExample
Variables [hide private]
  vertex_shader = '\n#version 400 core\n\nlayout(location=0) in ...
  fragment_shader = '\n#version 400 core\n#extension GL_ARB_text...
  copy_vertex_shader = '\n#version 400 core\n\nlayout(location=0...
  copy_fragment_shader = '\n#version 400 core\n#extension GL_ARB...
  vertices = ((0.0, 0.0, 0.0, 1.0), (-0.2, 0.8, 0.0, 1.0), (0.2,...
  colors = ((1.0, 1.0, 1.0, 1.0), (0.0, 1.0, 0.0, 1.0), (0.0, 0....
  indices = ((0, 1, 3), (0, 3, 2), (3, 1, 4), (3, 4, 2), (0, 5, ...
  __package__ = 'examples'
Variables Details [hide private]

vertex_shader

Value:
'''
#version 400 core

layout(location=0) in vec4 in_position;
layout(location=1) in vec4 in_color;
uniform mat4 modelview_matrix;
out vec4 ex_color;
out vec2 ex_texcoord;
...

fragment_shader

Value:
'''
#version 400 core
#extension GL_ARB_texture_rectangle : enable

in vec4 ex_color;
in vec2 ex_texcoord;
uniform sampler2D texture_0;
uniform sampler2DRect texture_1;
...

copy_vertex_shader

Value:
'''
#version 400 core

layout(location=0) in vec4 in_position;

void main() {
    gl_Position = in_position;
}
...

copy_fragment_shader

Value:
'''
#version 400 core
#extension GL_ARB_texture_rectangle : enable

uniform sampler2DRect image;
layout(location=0) out vec4 out_color;

void main() {
...

vertices

Value:
((0.0, 0.0, 0.0, 1.0),
 (-0.2, 0.8, 0.0, 1.0),
 (0.2, 0.8, 0.0, 1.0),
 (0.0, 0.8, 0.0, 1.0),
 (0.0, 1.0, 0.0, 1.0),
 (-0.2, -0.8, 0.0, 1.0),
 (0.2, -0.8, 0.0, 1.0),
 (0.0, -0.8, 0.0, 1.0),
...

colors

Value:
((1.0, 1.0, 1.0, 1.0),
 (0.0, 1.0, 0.0, 1.0),
 (0.0, 0.0, 1.0, 1.0),
 (0.0, 1.0, 1.0, 1.0),
 (1.0, 0.0, 0.0, 1.0),
 (0.0, 0.0, 1.0, 1.0),
 (0.0, 1.0, 0.0, 1.0),
 (0.0, 1.0, 1.0, 1.0),
...

indices

Value:
((0, 1, 3),
 (0, 3, 2),
 (3, 1, 4),
 (3, 4, 2),
 (0, 5, 7),
 (0, 7, 6),
 (7, 5, 8),
 (7, 8, 6),
...