Geometry that can be rendered with glDrawArrays() or glDrawElements(). More...
#include <sceneview/geometry_resource.hpp>
Public Types | |
typedef std::shared_ptr < GeometryResource > | Ptr |
Public Member Functions | |
void | Load (const GeometryData &data) |
Loads the specified geometry into this resource. More... | |
QOpenGLBuffer * | VBO () |
QOpenGLBuffer * | IndexBuffer () |
int | VertexOffset () const |
int | NumVertices () const |
int | NormalOffset () const |
int | NumNormals () const |
int | DiffuseOffset () const |
int | NumDiffuse () const |
int | NumSpecular () const |
int | SpecularOffset () const |
int | NumShininess () const |
int | ShininessOffset () const |
int | TexCoords0Offset () const |
int | NumTexCoords0 () const |
int | NumIndices () const |
GLenum | IndexType () const |
Returns the type parameter to pass to glDrawElements() Either GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. | |
GLenum | GLMode () const |
What kind of primitives are in this geometry (GL_POINTS, GL_LINE_STRIP, ...) | |
const AxisAlignedBox & | BoundingBox () const |
Friends | |
class | ResourceManager |
class | Drawable |
Geometry that can be rendered with glDrawArrays() or glDrawElements().
A GeometryResource manages per-vertex attributes using a combination of vertex buffer objects and index buffers.
GeometryResource objects cannot be directly instantiated. Instead, use ResourceManager or StockResources.
Typically the data is loaded from a GeometryData() object.
void sv::GeometryResource::Load | ( | const GeometryData & | data | ) |
Loads the specified geometry into this resource.
Automatically allocates buffers in graphics memory as needed.