Support Forum       G3D Web Page     
Classes | Namespaces | Macros
glFormat.h File Reference

G3D Innovation Engine http://casual-effects.com/g3d Copyright 2000-2019, Morgan McGuire All rights reserved Available under the BSD License. More...

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< Vector4int32 >
 
class  G3D::_internal::_GLFormat< Vector4int8 >
 
class  G3D::_internal::_GLFormat< Vector4uint16 >
 
class  G3D::_internal::_GLFormat< Vector4uint8 >
 
class  G3D::_internal::_GLFormat< Vector4unorm8 >
 

Namespaces

 G3D
 
 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. More...
 
#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. More...
 
#define glFormatOf(T)   (G3D::_internal::_GLFormat<T>::type())
 A macro that maps G3D types to OpenGL formats (e.g. More...
 
#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. More...
 

Detailed Description

G3D Innovation Engine http://casual-effects.com/g3d Copyright 2000-2019, Morgan McGuire All rights reserved Available under the BSD License.

Macro Definition Documentation

◆ DECLARE_GLFORMATOF

#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; \
} \
}; \
} \
}
Definition: AABox.h:20


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.
G3DType
GLType
_isNormalizedFixedPoint

◆ glCanBeIndexType

#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.

◆ glFormatOf

#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().

◆ glIsNormalizedFixedPoint

#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 Wed Nov 24 2021 08:01:51 using doxygen 1.8.15