module charge.gfx.draw
Super simple 2D drawing helper.
Code Map
//! Super simple 2D drawing helper.
module charge.gfx.draw;
enum vertexShaderES;
enum fragmentShaderES;
//! VBO used for 2D drawing operations.
class DrawBuffer : Buffer
{
public:
num: GLsizei;
public:
fn update(vb: DrawVertexBuilder) { }
public:
static fn make(name: string, vb: DrawVertexBuilder) DrawBuffer { }
}
class DrawVertexBuilder : Builder
{
public:
alias add = Builder.add;
public:
this(num: size_t) { }
fn reset(num: size_t) { }
fn add(x: f32, y: f32, u: f32, v: f32) { }
fn add(x: f32, y: f32, u: f32, v: f32, color: math.Color4b) { }
fn add(vert: DrawVertex*, num: size_t) { }
fn bake(vao: GLuint, buf: GLuint, num: GLsizei) { }
}
//! Vertex format.
struct DrawVertex
{
public:
x: f32;
y: f32;
u: f32;
v: f32;
color: math.Color4b;
}
//! Shader to be used with the vertex format in this file.
global drawShader: Shader;
global drawSamplerLinear: GLuint;
global drawSamplerNearest: GLuint;
//! Dereference and reference helper function.
fn reference(dec: DrawBuffer, inc: DrawBuffer) { }
//! Closes and sets reference to null.
fn destroy(obj: DrawVertexBuilder) { }
fn __ctor() { }
fn initDraw() { }
fn closeDraw() { }
fn reference(dec: DrawBuffer, inc: DrawBuffer)
Dereference and reference helper function.
Parameters
dec |
Object to dereference passed by reference, set to |
inc |
Object to reference. |
fn destroy(obj: DrawVertexBuilder)
Closes and sets reference to null.
class DrawBuffer : Buffer
VBO used for 2D drawing operations.
global drawShader: Shader
Shader to be used with the vertex format in this file.
It has one shader uniform called 'matrix' that is the.
struct DrawVertex
Vertex format.