Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Friends | List of all members
sv::GeometryResource Class Reference

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 AxisAlignedBoxBoundingBox () const
 

Friends

class ResourceManager
 
class Drawable
 

Detailed Description

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.

Member Function Documentation

void sv::GeometryResource::Load ( const GeometryData data)

Loads the specified geometry into this resource.

Automatically allocates buffers in graphics memory as needed.


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