module charge.gfx.simple
Graphics

Simpler object rendering code, shader, buffer and builder.

Code Map

//! Simpler object rendering code, shader, buffer and builder.
module charge.gfx.simple;


enum vertexShaderES;
enum fragmentShaderES;

//! VBO used for simple drawing operations.
class SimpleBuffer : Buffer
{
public:
	num: GLsizei;


public:
	fn update(vb: SimpleVertexBuilder) { }


public:
	static fn make(name: string, vb: SimpleVertexBuilder) SimpleBuffer { }
}

//! Building simple vertex buffers.
class SimpleVertexBuilder : Builder
{
public:
	alias add = Builder.add;


public:
	this(num: size_t) { }
	fn reset(num: size_t) { }
	fn add(x: f32, y: f32, z: f32, u: f32, v: f32) { }
	fn add(x: f32, y: f32, z: f32, u: f32, v: f32, color: math.Color4b) { }
	fn add(vert: SimpleVertex*, num: size_t) { }
	fn bake(vao: GLuint, buf: GLuint, num: GLsizei) { }
}

//! Vertex format, vec3f32 position, vec2f32 coordinate and vec4!u8 color.
struct SimpleVertex
{
public:
	x: f32;
	y: f32;
	z: f32;
	u: f32;
	v: f32;
	color: math.Color4b;
}

//! Shader to be used with the vertex format in this file.
global simpleShader: Shader;

//! Dereference and reference helper function.
fn reference(dec: SimpleBuffer, inc: SimpleBuffer) { }
//! Closes and sets reference to null.
fn destroy(obj: SimpleVertexBuilder) { }
fn __ctor() { }
fn initSimple() { }
fn closeSimple() { }
fn reference(dec: SimpleBuffer, inc: SimpleBuffer)

Dereference and reference helper function.

Parameters

dec

Object to dereference passed by reference, set to inc.

inc

Object to reference.

fn destroy(obj: SimpleVertexBuilder)

Closes and sets reference to null.

class SimpleBuffer : Buffer

VBO used for simple drawing operations.

global simpleShader: Shader

Shader to be used with the vertex format in this file.

It has one shader uniform called 'matrix' that is the.

struct SimpleVertex

Vertex format, vec3f32 position, vec2f32 coordinate and vec4!u8 color.

class SimpleVertexBuilder : Builder

Building simple vertex buffers.