Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros
glFormat.h File Reference

Classes

class  G3D::_internal::_GLFormat< T >
 
class  G3D::_internal::_GLFormat< Color3 >
 
class  G3D::_internal::_GLFormat< Color3unorm8 >
 
class  G3D::_internal::_GLFormat< Color4 >
 
class  G3D::_internal::_GLFormat< Color4unorm8 >
 
class  G3D::_internal::_GLFormat< double >
 
class  G3D::_internal::_GLFormat< float >
 
class  G3D::_internal::_GLFormat< int16 >
 
class  G3D::_internal::_GLFormat< int32 >
 
class  G3D::_internal::_GLFormat< int8 >
 
class  G3D::_internal::_GLFormat< snorm16 >
 
class  G3D::_internal::_GLFormat< snorm8 >
 
class  G3D::_internal::_GLFormat< uint16 >
 
class  G3D::_internal::_GLFormat< uint32 >
 
class  G3D::_internal::_GLFormat< uint8 >
 
class  G3D::_internal::_GLFormat< unorm16 >
 
class  G3D::_internal::_GLFormat< unorm8 >
 
class  G3D::_internal::_GLFormat< Vector2 >
 
class  G3D::_internal::_GLFormat< Vector2int16 >
 
class  G3D::_internal::_GLFormat< Vector2int32 >
 
class  G3D::_internal::_GLFormat< Vector2unorm16 >
 
class  G3D::_internal::_GLFormat< Vector3 >
 
class  G3D::_internal::_GLFormat< Vector3int16 >
 
class  G3D::_internal::_GLFormat< Vector3int32 >
 
class  G3D::_internal::_GLFormat< Vector4 >
 
class  G3D::_internal::_GLFormat< Vector4int16 >
 
class  G3D::_internal::_GLFormat< Vector4int8 >
 

Namespaces

namespace  G3D
 
namespace  G3D::_internal
 

Macros

#define DECLARE_GLFORMATOF(G3DType, GLType, _isIndex, _isNormalizedFixedPoint)
 Macro to declare the underlying format (as will be returned by glFormatOf) of a type.
 
#define glCanBeIndexType(T)   (G3D::_internal::_GLFormat<T>::canBeIndex())
 True if the C-type passed as an argument can be used by an OpenGL index buffer as the data type.
 
#define glFormatOf(T)   (G3D::_internal::_GLFormat<T>::type())
 A macro that maps G3D types to OpenGL formats (e.g.
 
#define glIsNormalizedFixedPoint(T)   (G3D::_internal::_GLFormat<T>::isNormalizedFixedPoint())
 True if the C-type passed as an argument is stored in OpenGL normalized fixed point format.
 

Detailed Description

Maintainer:
Morgan McGuire, http://graphics.cs.williams.edu
Created:
2002-08-07
Last modified:
2012-03-16

Copyright 2002-2012, Morgan McGuire. All rights reserved.

Macro Definition Documentation

#define DECLARE_GLFORMATOF (   G3DType,
  GLType,
  _isIndex,
  _isNormalizedFixedPoint 
)
Value:
namespace G3D { \
namespace _internal { \
template<> class _GLFormat<G3DType> { \
public: \
static GLenum type() { \
return GLType; \
} \
static bool canBeIndex() { \
return _isIndex; \
} \
static bool isNormalizedFixedPoint() { \
return _isNormalizedFixedPoint; \
} \
}; \
} \
}

Macro to declare the underlying format (as will be returned by glFormatOf) of a type.

For example,

DECLARE_GLFORMATOF(Vector4, GL_FLOAT, false, false)

Use this so you can make vertex arrays of your own classes and not just the standard ones.

Parameters
_isIndexTrue for types that can be used as indices.
#define glCanBeIndexType (   T)    (G3D::_internal::_GLFormat<T>::canBeIndex())

True if the C-type passed as an argument can be used by an OpenGL index buffer as the data type.

e.g., glCanBeIndexType(float) = false.

#define glFormatOf (   T)    (G3D::_internal::_GLFormat<T>::type())

A macro that maps G3D types to OpenGL formats (e.g.

glFormat(Vector3) == GL_FLOAT).

Use DECLARE_GLFORMATOF(MyType, GLType, bool) at top-level to define glFormatOf values for your own classes.

Used by the vertex array infrastructure.

Referenced by G3D::AttributeArray::AttributeArray(), G3D::AttributeArray::createInterleaved(), G3D::AttributeArray::set(), and G3D::AttributeArray::update().

#define glIsNormalizedFixedPoint (   T)    (G3D::_internal::_GLFormat<T>::isNormalizedFixedPoint())

True if the C-type passed as an argument is stored in OpenGL normalized fixed point format.

e.g., glIsNormalizedFixedPoint(Vector2unorm16) = true.

Referenced by G3D::AttributeArray::AttributeArray(), G3D::AttributeArray::createInterleaved(), G3D::AttributeArray::set(), and G3D::AttributeArray::update().


documentation generated on Sat Jan 12 2013 22:49:53 using doxygen 1.8.2