#include <Batch.h>
Inherits cinder::geom::Source.
|
| VertBatch (GLenum primType=GL_POINTS, bool useContextDefaultBuffers=true) |
|
void | setType (GLenum type) |
|
GLenum | getType () const |
|
void | color (float r, float g, float b, float a=1.0f) |
|
void | color (const Colorf &color) |
|
void | color (const ColorAf &color) |
|
void | normal (float x, float y, float z) |
|
void | normal (const vec3 &n) |
|
void | texCoord (float s, float t, float r=0, float q=1) |
|
void | texCoord (const vec2 &t) |
|
void | texCoord (const vec3 &t) |
|
void | texCoord (const vec4 &t) |
|
void | texCoord0 (float s, float t, float r=0, float q=1) |
|
void | texCoord0 (const vec2 &t) |
|
void | texCoord0 (const vec3 &t) |
|
void | texCoord0 (const vec4 &t) |
|
void | texCoord1 (float s, float t, float r=0, float q=1) |
|
void | texCoord1 (const vec2 &t) |
|
void | texCoord1 (const vec3 &t) |
|
void | texCoord1 (const vec4 &t) |
|
void | vertex (float x, float y, float z=0, float w=1) |
|
void | vertex (const vec2 &v) |
|
void | vertex (const vec3 &v) |
|
void | vertex (const vec4 &v) |
|
void | vertex (const vec4 &v, const ColorAf &c) |
|
void | begin (GLenum type) |
|
void | end () |
|
void | clear () |
|
bool | empty () const |
|
void | draw () |
|
|
static VertBatchRef | create (GLenum primType=GL_POINTS, bool useContextDefaultBuffers=false) |
|
Allows simple creation of basic geometry in a style similar to OpenGL immediate mode. Can be used to construct a gl::Batch for better performance, or can draw() directly. Used with a series of calls to color(), normal(), and/or texCoord(), followed by a call to vertex(), per-vertex.
cinder::gl::VertBatch::VertBatch |
( |
GLenum |
primType = GL_POINTS , |
|
|
bool |
useContextDefaultBuffers = true |
|
) |
| |
Constructs a VertBatch with primitive type primType. Default is GL_POINTS
. If useContextDefaultBuffers is true
, uses default buffers for the context, saving allocations; suitable for single draw.
VertBatchRef cinder::gl::VertBatch::create |
( |
GLenum |
primType = GL_POINTS , |
|
|
bool |
useContextDefaultBuffers = false |
|
) |
| |
|
static |
Creates a VertBatchRef with primitive type primType. Default is GL_POINTS
. If useContextDefaultBuffers is false
, allocates and uses internal buffers and VAO; suitable for multiple draws.
void cinder::gl::VertBatch::setType |
( |
GLenum |
type | ) |
|
Sets the primitive type of the VertBatch. Default is GL_POINTS
.
GLenum cinder::gl::VertBatch::getType |
( |
| ) |
const |
Returns the primitive type of the VertBatch. Default is GL_POINTS
.
void cinder::gl::VertBatch::color |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1.0f |
|
) |
| |
Sets the color for the current vertex (attribute geom::COLOR)
void cinder::gl::VertBatch::color |
( |
const Colorf & |
color | ) |
|
Sets the color for the current vertex (attribute geom::COLOR)
void cinder::gl::VertBatch::color |
( |
const ColorAf & |
color | ) |
|
Sets the color for the current vertex (attribute geom::COLOR)
void cinder::gl::VertBatch::normal |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Sets the normal for the current vertex (attribute geom::NORMAL)
void cinder::gl::VertBatch::normal |
( |
const vec3 & |
n | ) |
|
Sets the normal for the current vertex (attribute geom::NORMAL)
void cinder::gl::VertBatch::texCoord |
( |
float |
s, |
|
|
float |
t, |
|
|
float |
r = 0 , |
|
|
float |
q = 1 |
|
) |
| |
void cinder::gl::VertBatch::texCoord |
( |
const vec2 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord |
( |
const vec3 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord |
( |
const vec4 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord0 |
( |
float |
s, |
|
|
float |
t, |
|
|
float |
r = 0 , |
|
|
float |
q = 1 |
|
) |
| |
void cinder::gl::VertBatch::texCoord0 |
( |
const vec2 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord0 |
( |
const vec3 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord0 |
( |
const vec4 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord1 |
( |
float |
s, |
|
|
float |
t, |
|
|
float |
r = 0 , |
|
|
float |
q = 1 |
|
) |
| |
void cinder::gl::VertBatch::texCoord1 |
( |
const vec2 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord1 |
( |
const vec3 & |
t | ) |
|
void cinder::gl::VertBatch::texCoord1 |
( |
const vec4 & |
t | ) |
|
void cinder::gl::VertBatch::vertex |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z = 0 , |
|
|
float |
w = 1 |
|
) |
| |
void cinder::gl::VertBatch::vertex |
( |
const vec2 & |
v | ) |
|
void cinder::gl::VertBatch::vertex |
( |
const vec3 & |
v | ) |
|
void cinder::gl::VertBatch::vertex |
( |
const vec4 & |
v | ) |
|
void cinder::gl::VertBatch::vertex |
( |
const vec4 & |
v, |
|
|
const ColorAf & |
c |
|
) |
| |
void cinder::gl::VertBatch::begin |
( |
GLenum |
type | ) |
|
Resets the sequence of vertices and sets the VertBatch's primitive type.
void cinder::gl::VertBatch::end |
( |
| ) |
|
No-op. Present for parity with legacy immediate mode.
void cinder::gl::VertBatch::clear |
( |
| ) |
|
Clears all vertices recorded by the VertBatch.
bool cinder::gl::VertBatch::empty |
( |
| ) |
const |
Returns true
if no vertices have been added to the VertBatch.
void cinder::gl::VertBatch::draw |
( |
| ) |
|
void cinder::gl::VertBatch::addVertex |
( |
const vec4 & |
v | ) |
|
|
protected |
void cinder::gl::VertBatch::setupBuffers |
( |
| ) |
|
|
protected |
size_t cinder::gl::VertBatch::getNumVertices |
( |
| ) |
const |
|
overrideprotectedvirtual |
size_t cinder::gl::VertBatch::getNumIndices |
( |
| ) |
const |
|
overrideprotectedvirtual |
uint8_t cinder::gl::VertBatch::getAttribDims |
( |
geom::Attrib |
attr | ) |
const |
|
overrideprotectedvirtual |
VertBatch* cinder::gl::VertBatch::clone |
( |
| ) |
const |
|
overrideprotectedvirtual |
void cinder::geom::Source::copyIndicesNonIndexed |
( |
uint16_t * |
dest | ) |
const |
|
protectedinherited |
Builds a sequential list of vertices to simulate an indexed geometry when Source is non-indexed. Assumes dest contains storage for getNumVertices() entries.
void cinder::geom::Source::copyIndicesNonIndexed |
( |
uint32_t * |
dest | ) |
const |
|
protectedinherited |
Builds a sequential list of vertices to simulate an indexed geometry when Source is non-indexed. Assumes dest contains storage for getNumVertices() entries.
template<typename T >
void cinder::geom::Source::forceCopyIndicesTrianglesImpl |
( |
T * |
dest | ) |
const |
|
protectedinherited |
GLenum cinder::gl::VertBatch::mPrimType |
|
protected |
std::vector<vec4> cinder::gl::VertBatch::mVertices |
|
protected |
std::vector<vec3> cinder::gl::VertBatch::mNormals |
|
protected |
std::vector<ColorAf> cinder::gl::VertBatch::mColors |
|
protected |
std::vector<vec4> cinder::gl::VertBatch::mTexCoords0 |
|
protected |
std::vector<vec4> cinder::gl::VertBatch::mTexCoords1 |
|
protected |
bool cinder::gl::VertBatch::mOwnsBuffers |
|
protected |
bool cinder::gl::VertBatch::mForceUpdate |
|
protected |
Vao* cinder::gl::VertBatch::mVao |
|
protected |
VaoRef cinder::gl::VertBatch::mVaoStorage |
|
protected |
VboRef cinder::gl::VertBatch::mVbo |
|
protected |
The documentation for this class was generated from the following files: