Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::gfxutils Namespace Reference

Classes

class  BufferToAttributeBinder
 BufferToAttributeBinder is a simple interface to insert a set of Attributes containing BufferObjectElements into a AttributeArray, and also create the corresponding Elements in the BufferObject. More...
 
class  Frame
 Frame manages an application-defined frame of execution. More...
 
class  Printer
 The Printer class can be used for debugging. More...
 
class  ResourceCallback
 Class that allows blocking until a callback is called and automagically destroys itself after both Callback() and WaitForCompletion() have executed. More...
 
class  ShaderManager
 ShaderManager contains an association between shader programs, their names, and any source dependencies they have. More...
 
class  ShaderSourceComposer
 A ShaderSourceComposer is a generic interface for constructing a shader source string. More...
 
class  StringComposer
 Simple composer that just returns the string passed to its constructor. More...
 
class  FilterComposer
 Applies a fixed transformation to the output of another composer. More...
 
class  IncludeComposer
 Loads a shader source from a resource that may include other resources using the special directive '$input "name"'. More...
 
class  ZipAssetComposer
 Loads a shader source from zip asset resources that may $input other zip assets. More...
 
struct  ShapeSpec
 This struct contains specifications common to all basic shapes. More...
 
struct  ExternalShapeSpec
 External geometry formats. More...
 
struct  PlanarShapeSpec
 Planar shape. More...
 
struct  RectangleSpec
 Rectangle. More...
 
struct  RegularPolygonSpec
 Regular polygon. More...
 
struct  BoxSpec
 Box. More...
 
struct  EllipsoidSpec
 Ellipsoid. More...
 
struct  CylinderSpec
 Cylinder. More...
 

Typedefs

typedef base::ReferentPtr
< Frame >::Type 
FramePtr
 Convenience typedef for shared pointer to a Frame. More...
 
typedef ResourceCallback
< gfx::ResourceManager::ArrayInfo
ArrayCallback
 
typedef ResourceCallback
< gfx::ResourceManager::BufferInfo
BufferCallback
 
typedef ResourceCallback
< gfx::ResourceManager::FramebufferInfo
FramebufferCallback
 
typedef ResourceCallback
< gfx::ResourceManager::SamplerInfo
SamplerCallback
 
typedef ResourceCallback
< gfx::ResourceManager::ShaderInfo
ShaderCallback
 
typedef ResourceCallback
< gfx::ResourceManager::PlatformInfo
PlatformCallback
 
typedef ResourceCallback
< gfx::ResourceManager::ProgramInfo
ProgramCallback
 
typedef ResourceCallback
< gfx::ResourceManager::TextureImageInfo
TextureImageCallback
 
typedef ResourceCallback
< gfx::ResourceManager::TextureInfo
TextureCallback
 
typedef base::ReferentPtr
< ShaderManager >::Type 
ShaderManagerPtr
 
typedef base::ReferentPtr
< ShaderSourceComposer >::Type 
ShaderSourceComposerPtr
 
typedef base::ReferentPtr
< StringComposer >::Type 
StringComposerPtr
 
typedef base::ReferentPtr
< FilterComposer >::Type 
FilterComposerPtr
 
typedef base::ReferentPtr
< IncludeComposer >::Type 
IncludeComposerPtr
 
typedef base::ReferentPtr
< ZipAssetComposer >::Type 
ZipAssetComposerPtr
 

Functions

 DefineComponentFunctions (char, kByte, i8)
 
 DefineComponentFunctions (unsigned char, kUnsignedByte, ui8)
 
 DefineComponentFunctions (int16, kShort, i16)
 
 DefineComponentFunctions (uint16, kUnsignedShort, ui16)
 
 DefineComponentFunctions (int32, kInt, i)
 
 DefineComponentFunctions (uint32, kUnsignedInt, ui)
 
 DefineComponentFunctions (float, kFloat, f)
 
 DefineComponentFunctionPair (math::Matrix2f, kFloatMatrixColumn2, 2U)
 
 DefineComponentFunctionPair (math::Matrix3f, kFloatMatrixColumn3, 3U)
 
 DefineComponentFunctionPair (math::Matrix4f, kFloatMatrixColumn4, 4U)
 
template<typename T >
ION_API
gfx::BufferObject::ComponentType 
GetComponentType ()
 These functions must be specialized for every type used in a vertex. More...
 
template<typename T >
ION_API size_t GetComponentCount ()
 
const gfx::IndexBufferPtr BuildWireframeIndexBuffer (const gfx::IndexBufferPtr &tri_index_buffer)
 Public functions. More...
 
const gfx::ShapePtr LoadExternalShape (const ExternalShapeSpec &spec, std::istream &in)
 Loads a Shape with the specified format from the passed stream. More...
 
const gfx::ShapePtr BuildRectangleShape (const RectangleSpec &spec)
 Builds and returns a Shape representing a rectangle in one of the principal Cartesian planes. More...
 
const gfx::ShapePtr BuildRegularPolygonShape (const RegularPolygonSpec &spec)
 Builds and returns a Shape representing a flat regular polygon. More...
 
const gfx::ShapePtr BuildBoxShape (const BoxSpec &spec)
 Builds and returns a Shape representing an axis-aligned box. More...
 
const gfx::ShapePtr BuildEllipsoidShape (const EllipsoidSpec &spec)
 Builds and returns a Shape representing an axis-aligned ellipsoid. More...
 
const gfx::ShapePtr BuildCylinderShape (const CylinderSpec &spec)
 Builds and returns a Shape representing an axis-aligned cylinder. More...
 

Typedef Documentation

Convenience typedef for shared pointer to a Frame.

Definition at line 84 of file frame.h.

Function Documentation

ION_API const gfx::ShapePtr ion::gfxutils::BuildBoxShape ( const BoxSpec &  spec)

Builds and returns a Shape representing an axis-aligned box.

Definition at line 1310 of file shapeutils.cc.

References ion::gfxutils::ShapeSpec::allocator, and ion::gfx::Shape::kTriangles.

ION_API const gfx::ShapePtr ion::gfxutils::BuildCylinderShape ( const CylinderSpec &  spec)

Builds and returns a Shape representing an axis-aligned cylinder.

Definition at line 1330 of file shapeutils.cc.

References ion::gfxutils::ShapeSpec::allocator, and ion::gfx::Shape::kTriangles.

ION_API const gfx::ShapePtr ion::gfxutils::BuildEllipsoidShape ( const EllipsoidSpec &  spec)

Builds and returns a Shape representing an axis-aligned ellipsoid.

Definition at line 1320 of file shapeutils.cc.

References ion::gfxutils::ShapeSpec::allocator, and ion::gfx::Shape::kTriangles.

ION_API const gfx::ShapePtr ion::gfxutils::BuildRectangleShape ( const RectangleSpec &  spec)

Builds and returns a Shape representing a rectangle in one of the principal Cartesian planes.

Definition at line 1290 of file shapeutils.cc.

References ion::gfxutils::ShapeSpec::allocator, and ion::gfx::Shape::kTriangles.

ION_API const gfx::ShapePtr ion::gfxutils::BuildRegularPolygonShape ( const RegularPolygonSpec &  spec)

Builds and returns a Shape representing a flat regular polygon.

Definition at line 1300 of file shapeutils.cc.

References ion::gfxutils::ShapeSpec::allocator, DCHECK_LE, ion::gfx::Shape::kTriangleFan, and ion::gfxutils::RegularPolygonSpec::sides.

ION_API const gfx::IndexBufferPtr ion::gfxutils::BuildWireframeIndexBuffer ( const gfx::IndexBufferPtr &  tri_index_buffer)

Public functions.

Generic shape utilities.

This function can be used to create wireframe versions of filled shapes. Given an IndexBuffer representing indices for triangles, it creates and returns an IndexBuffer representing indices for lines forming the triangle edges. The new IndexBuffer uses the same index type, Allocator, and usage mode as the passed one. If there is any reason that the indices cannot be converted (NULL pointer, no data, bad number of indices, wiped indices, and so on), this returns a NULL pointer.

Definition at line 1236 of file shapeutils.cc.

References ion::gfx::BufferObject::Spec::byte_offset, DCHECK, DCHECK_EQ, ion::base::SharedPtr< T >::Get(), ion::base::IsInvalidReference(), ion::gfx::BufferObject::kUnsignedByte, ion::gfx::BufferObject::kUnsignedShort, and ion::gfx::BufferObject::Spec::type.

ion::gfxutils::DefineComponentFunctionPair ( math::Matrix2f  ,
kFloatMatrixColumn2  ,
2U   
)
ion::gfxutils::DefineComponentFunctionPair ( math::Matrix3f  ,
kFloatMatrixColumn3  ,
3U   
)
ion::gfxutils::DefineComponentFunctionPair ( math::Matrix4f  ,
kFloatMatrixColumn4  ,
4U   
)
ion::gfxutils::DefineComponentFunctions ( char  ,
kByte  ,
i8   
)
ion::gfxutils::DefineComponentFunctions ( unsigned  char,
kUnsignedByte  ,
ui8   
)
ion::gfxutils::DefineComponentFunctions ( int16  ,
kShort  ,
i16   
)
ion::gfxutils::DefineComponentFunctions ( uint16  ,
kUnsignedShort  ,
ui16   
)
ion::gfxutils::DefineComponentFunctions ( int32  ,
kInt  ,
 
)
ion::gfxutils::DefineComponentFunctions ( uint32  ,
kUnsignedInt  ,
ui   
)
ion::gfxutils::DefineComponentFunctions ( float  ,
kFloat  ,
 
)
template<typename T >
ION_API size_t ion::gfxutils::GetComponentCount ( )
template<typename T >
ION_API gfx::BufferObject::ComponentType ion::gfxutils::GetComponentType ( )

These functions must be specialized for every type used in a vertex.

Ion has implementations for the following types: int8, int16, int32 uint8, uint16, uint32 float All VectorBase types defined in ion/math/vector.h

ION_API const gfx::ShapePtr ion::gfxutils::LoadExternalShape ( const ExternalShapeSpec &  spec,
std::istream &  in 
)

Loads a Shape with the specified format from the passed stream.

On a successful load, returns a Shape that contains vertices of the type specified. The returned Shape is centered at the origin, unless center_at_origin is set to false in the spec. If anything goes wrong, returns a NULL Shape.

Definition at line 1272 of file shapeutils.cc.

References ion::gfxutils::ShapeSpec::allocator, ion::gfxutils::ExternalShapeSpec::format, and ion::gfx::Shape::kTriangles.