SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | List of all members
sgl::BatchVK Class Reference

This class is used for batch rendering with Vulkan. More...

#include <batching_vk.hpp>

Inheritance diagram for sgl::BatchVK:
sgl::Batch

Public Member Functions

 BatchVK (int capacity=1024 *1024)
 Creates a new batch with specified capacity. More...
 
 ~BatchVK (void)
 Destroys a batch. More...
 
void flush () override
 Flushes the batch, could be used if the batch would overflow. More...
 
- Public Member Functions inherited from sgl::Batch
 ~Batch (void)
 Destroys a batch. More...
 
virtual void begin ()
 Starts drawing with the default mode. More...
 
virtual void end ()
 Ends the drawing, this should also flush the batch. More...
 
void vertex (float x, float y)
 Defines a new vertex at specified coordinates. More...
 
void vertex (float x, float y, float z)
 Defines a new vertex at specified coordinates. More...
 
void vertex (glm::vec2 vertex)
 Defines a new vertex at specified coordinates. More...
 
void vertex (glm::vec3 vertex)
 Defines a new vertex at specified coordinates. More...
 
void color (float r, float g, float b)
 Defines a new color with specified components. More...
 
void color (float r, float g, float b, float a)
 Defines a new color with specified components. More...
 
void color (glm::vec3 color)
 Defines a new color with specified components. More...
 
void color (glm::vec4 color)
 Defines a new color with specified components. More...
 
void texCoord (float s, float t)
 Defines a new texture coordinate with specified values. More...
 
void texCoord (glm::vec2 texCoord)
 Defines a new texture coordinate with specified values. More...
 
void normal (float nx, float ny, float nz)
 Defines a new normal with specified values. More...
 
void normal (glm::vec3 normal)
 Defines a new normal with specified values. More...
 
void setModel (glm::mat4 model)
 Sets the model matrix. More...
 
glm::mat4 getModel ()
 Gets the model matrix. More...
 
void setView (glm::mat4 view)
 Sets the view matrix. More...
 
glm::mat4 getView ()
 Gets the view matrix. More...
 
void setProjection (glm::mat4 projection)
 Sets the projection matrix. More...
 
glm::mat4 getProjection ()
 Gets the projection matrix. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sgl::Batch
 Batch (void)
 Initializes a new batch. More...
 
- Protected Attributes inherited from sgl::Batch
Transformation transformation
 The transformation for the batch. More...
 
bool drawing
 Tells if the batch is drawing. More...
 
int numVertices
 The counter for the number of vertices. More...
 
std::vector< glm::vec3 > vertices
 The storage for vertices. More...
 
std::vector< glm::vec4 > colors
 The storage for colors. More...
 
std::vector< glm::vec2 > texCoords
 The storage for texture coordinates. More...
 
std::vector< glm::vec3 > normals
 The storage for normals. More...
 

Detailed Description

This class is used for batch rendering with Vulkan.

Definition at line 31 of file batching_vk.hpp.

Constructor & Destructor Documentation

sgl::BatchVK::BatchVK ( int  capacity = 1024 * 1024)

Creates a new batch with specified capacity.

If no capacity is specified it will use a default capacity of 1048576 vertices.

Parameters
capacityThe capacity of this batch.

Definition at line 193 of file batching_vk.cpp.

sgl::BatchVK::~BatchVK ( void  )

Destroys a batch.

Definition at line 246 of file batching_vk.cpp.

Member Function Documentation

void sgl::BatchVK::flush ( )
overridevirtual

Flushes the batch, could be used if the batch would overflow.

Implements sgl::Batch.

Definition at line 263 of file batching_vk.cpp.


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