gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
Public Types | Public Member Functions | Static Public Attributes | List of all members
gdk::webgl1es2_model Class Referencefinal

Vertex data representing a 3D graphical object. More...

#include <webgl1es2_model.h>

Inheritance diagram for gdk::webgl1es2_model:
gdk::model

Public Types

enum  Type { Type::Dynamic, Type::Static, Type::Stream }
 Hint to the graphics device about how the vertex data will be used. More...
 
enum  PrimitiveMode {
  PrimitiveMode::Points, PrimitiveMode::Lines, PrimitiveMode::LineStrip, PrimitiveMode::LineLoop,
  PrimitiveMode::Triangles, PrimitiveMode::TriangleStrip, PrimitiveMode::TriangleFan
}
 Determines the primitive type used at the primitive assembly stage. More...
 
using attribute_component_data_type = GLfloat
 
using index_data_type = GLushort
 type that must be used for index buffer data
 
- Public Types inherited from gdk::model
enum  UsageHint { Static, Dynamic, Streaming }
 

Public Member Functions

void bind (const webgl1es2_shader_program &aShaderProgram) const
 strong association with draw. If draw is on this instance is not called after bind() has not been called before draw, the behaviour will be unintended More...
 
void draw () const
 invokes pipeline on the data. data must be bound
 
virtual void update_vertex_data (const UsageHint &, const vertex_data &vertexDataView) override
 replace current data in the vbo and ibo with new data
 
bool operator== (const webgl1es2_model &)
 equality semantics based on handle values
 
bool operator!= (const webgl1es2_model &)
 equality semantics based on handle values
 
webgl1es2_modeloperator= (webgl1es2_model &&)=default
 support move semantics
 
 webgl1es2_model (webgl1es2_model &&)=default
 support move semantics
 
webgl1es2_modeloperator= (const webgl1es2_model &other)=delete
 disable copy semantics
 
 webgl1es2_model (const webgl1es2_model &)=delete
 disable copy semantics
 
 webgl1es2_model (const UsageHint &aUsage, const vertex_data &aData)
 

Static Public Attributes

static const jfc::shared_proxy_ptr< gdk::webgl1es2_modelQuad
 a quad with format pos3uv2
 
static const jfc::shared_proxy_ptr< gdk::webgl1es2_modelCube
 a cube with format pos3uv2norm3
 

Detailed Description

Vertex data representing a 3D graphical object.

Member Typedef Documentation

◆ attribute_component_data_type

type that must be used to populate vertex data buffers. All GLES2 attrib types have a float based component type. (float, float vec2, float mat etc)

Member Enumeration Documentation

◆ PrimitiveMode

Determines the primitive type used at the primitive assembly stage.

Enumerator
Points 

Every vertex is replaced with a point at the primitive assembly stage.

Lines 

Every two verticies define a line.

LineStrip 

Same as lines except the last vertex of the last defined line serves as the first vertex of the line currently being defined

LineLoop 

Same as LineStrip except an additional line is defined between the last and first vertex.

Triangles 

Every 3 verticies define a triangle.

TriangleStrip 

Every vertex after the first three define a new triangle.

TriangleFan 

Same as Triangle strip except draws in a "fan shape" (???) TODO: find & document better explanation

◆ Type

Hint to the graphics device about how the vertex data will be used.

Enumerator
Dynamic 

The data store contents will be modified repeatedly and used many times.

Static 

The data store contents will be modified once and used many times.

Stream 

The data store contents will be modified once and used at most a few times.

Member Function Documentation

◆ bind()

void gdk::webgl1es2_model::bind ( const webgl1es2_shader_program aShaderProgram) const

strong association with draw. If draw is on this instance is not called after bind() has not been called before draw, the behaviour will be unintended

Binds this vertex data to the pipeline, enables attributes on the currently used shaderprogram


The documentation for this class was generated from the following file: