Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Macros | Enumerations | Functions
glemu.hpp File Reference
#include <SDL.h>
#include <SDL_opengl.h>
#include <stddef.h>
#include "inexor/engine/glexts.hpp"
#include "inexor/network/legacy/buffer_types.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/geom.hpp"

Go to the source code of this file.

Namespaces

 gle
 

Macros

#define GLE_DEFATTRIB(name, type, defaultsize, defaultformat)   static inline void def##name(int size = defaultsize, int format = defaultformat) { defattrib(type, size, format); }
 
#define GLE_INITATTRIB(name, index, suffix, type)
 
#define GLE_INITATTRIBF(name, index)
 
#define GLE_INITATTRIBN(name, index, suffix, type, defaultw)   static inline void name##suffix(type x, type y, type z, type w = defaultw) { glVertexAttrib4N##suffix##_(index, x, y, z, w); }
 
#define GLE_ATTRIBPOINTER(name, index, defaultnormalized, defaultsize, defaulttype, prepare)
 
#define GLE_ATTRIB(suffix, type)
 

Enumerations

enum  {
  gle::ATTRIB_VERTEX = 0, gle::ATTRIB_COLOR = 1, gle::ATTRIB_TEXCOORD0 = 2, gle::ATTRIB_TEXCOORD1 = 3,
  gle::ATTRIB_NORMAL = 4, gle::ATTRIB_TANGENT = 5, gle::ATTRIB_BONEWEIGHT = 6, gle::ATTRIB_BONEINDEX = 7,
  gle::MAXATTRIBS = 8
}
 

Functions

void gle::forcedisable ()
 
static void gle::disable ()
 
void gle::begin (GLenum mode)
 
void gle::begin (GLenum mode, int numverts)
 
void gle::multidraw ()
 
void gle::defattribs (const char *fmt)
 
void gle::defattrib (int type, int size, int format)
 
static void gle::color (const bvec &v, uchar alpha=255)
 
static void gle::color (const bvec4 &v)
 
static void gle::normal (float x, float y, float z)
 
static void gle::normal (const vec &v)
 
static void gle::tangent (float x, float y, float z, float w=1.0f)
 
static void gle::tangent (const vec &v, float w=1.0f)
 
static void gle::tangent (const vec4 &v)
 
static void gle::enableattrib (int index)
 
static void gle::disableattrib (int index)
 
static void gle::bindebo (GLuint ebo)
 
static void gle::clearebo ()
 
static void gle::bindvbo (GLuint vbo)
 
static void gle::clearvbo ()
 
template<class T >
static void gle::attrib (T x)
 
template<class T >
static void gle::attrib (T x, T y)
 
template<class T >
static void gle::attrib (T x, T y, T z)
 
template<class T >
static void gle::attrib (T x, T y, T z, T w)
 
template<size_t N, class T >
static void gle::attribv (const T *v)
 
static void gle::attrib (const vec &v)
 
static void gle::attrib (const vec &v, float w)
 
static void gle::attrib (const vec2 &v)
 
static void gle::attrib (const vec4 &v)
 
static void gle::attrib (const ivec &v)
 
static void gle::attrib (const ivec &v, int w)
 
static void gle::attrib (const ivec2 &v)
 
static void gle::attrib (const ivec4 &v)
 
static void gle::attrib (const bvec &b)
 
static void gle::attrib (const bvec &b, uchar w)
 
static void gle::attrib (const bvec4 &b)
 
int gle::end ()
 
void gle::enablequads ()
 
void gle::disablequads ()
 
void gle::drawquads (int offset, int count)
 
void gle::setup ()
 
void gle::cleanup ()
 

Macro Definition Documentation

#define GLE_ATTRIB (   suffix,
  type 
)
Value:
static inline void attrib##suffix(type x) { attrib<type>(x); } \
static inline void attrib##suffix(type x, type y) { attrib<type>(x, y); } \
static inline void attrib##suffix(type x, type y, type z) { attrib<type>(x, y, z); } \
static inline void attrib##suffix(type x, type y, type z, type w) { attrib<type>(x, y, z, w); }
static void attrib(const bvec4 &b)
Definition: glemu.hpp:182
#define GLE_ATTRIBPOINTER (   name,
  index,
  defaultnormalized,
  defaultsize,
  defaulttype,
  prepare 
)
Value:
static inline void enable##name() { prepare; glEnableVertexAttribArray_(index); } \
static inline void disable##name() { glDisableVertexAttribArray_(index); } \
static inline void name##pointer(int stride, const void *data, GLenum type = defaulttype, int size = defaultsize, GLenum normalized = defaultnormalized) { \
prepare; \
glVertexAttribPointer_(index, size, type, normalized, stride, data); \
}
PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray_
Definition: rendergl.cpp:174
typedef GLenum(APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target)
PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray_
Definition: rendergl.cpp:175
GLuint index
Definition: glexts.hpp:412
void enable()
Definition: explosion.cpp:92
static void disable()
Definition: glemu.hpp:34
GLuint GLuint GLintptr GLsizeiptr size
Definition: glexts.hpp:412
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer_
Definition: rendergl.cpp:204
#define GLE_DEFATTRIB (   name,
  type,
  defaultsize,
  defaultformat 
)    static inline void def##name(int size = defaultsize, int format = defaultformat) { defattrib(type, size, format); }
#define GLE_INITATTRIB (   name,
  index,
  suffix,
  type 
)
Value:
static inline void name##suffix(type x) { glVertexAttrib1##suffix##_(index, x); } \
static inline void name##suffix(type x, type y) { glVertexAttrib2##suffix##_(index, x, y); } \
static inline void name##suffix(type x, type y, type z) { glVertexAttrib3##suffix##_(index, x, y, z); } \
static inline void name##suffix(type x, type y, type z, type w) { glVertexAttrib4##suffix##_(index, x, y, z, w); }
GLuint index
Definition: glexts.hpp:412
#define GLE_INITATTRIBF (   name,
  index 
)
Value:
GLE_INITATTRIB(name, index, f, float) \
static inline void name(const vec &v) { glVertexAttrib3fv_(index, v.v); } \
static inline void name(const vec &v, float w) { glVertexAttrib4f_(index, v.x, v.y, v.z, w); } \
static inline void name(const vec2 &v) { glVertexAttrib2fv_(index, v.v); } \
static inline void name(const vec4 &v) { glVertexAttrib4fv_(index, v.v); }
PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv_
Definition: rendergl.cpp:190
2-dimensional float vectors
Definition: geom.hpp:38
PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv_
Definition: rendergl.cpp:186
ICOMMAND * f(float *a, float *b), floatret(*a **b)
4-dimensional float vector all methods stay basicly the same but with an extra dimension ...
Definition: geom.hpp:343
GLuint index
Definition: glexts.hpp:412
vector with 3 floats and some useful methods.
Definition: geom.hpp:110
PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv_
Definition: rendergl.cpp:182
PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_
Definition: rendergl.cpp:189
#define GLE_INITATTRIB(name, index, suffix, type)
Definition: glemu.hpp:54
#define GLE_INITATTRIBN (   name,
  index,
  suffix,
  type,
  defaultw 
)    static inline void name##suffix(type x, type y, type z, type w = defaultw) { glVertexAttrib4N##suffix##_(index, x, y, z, w); }