glVertex  5.5.2
Macros | Functions
glvertex_api.h File Reference
#include "glvertex_core.h"
#include <time.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define lglPushMatrixScoped()   lglScopedMatrixStack __lglPushMatrixScoped__
 scoped replacement for lglPushMatrix/lglPopMatrix pairs
 
#define lglRandom()   drand48()
 random macro
 
#define lglSeed()   srand48((unsigned int)time(NULL))
 seed macro
 
#define LGL_WARN(s)   lglWarn(std::string(s)+" @ "+__FILE__+":"+glslmath::to_string(__LINE__))
 warning macro that outputs the file name and the line number of the occurrence
 
#define LGL_ERROR(s)   lglError(std::string(s)+" @ "+__FILE__+":"+glslmath::to_string(__LINE__))
 error macro that outputs the file name and the line number of the occurrence
 

Functions

void lglBegin (lgl_primitive_enum primitive)
 begin vertex series (as defined by OpenGL 1.2)
 
void lglVertex (const vec4 &v)
 specify vertex (as defined by OpenGL 1.2)
 
void lglVertex (double x, double y, double z, double w=1)
 specify vertex (as defined by OpenGL 1.2)
 
void lglColor (const vec4f &c)
 specify vertex color attribute (as defined by OpenGL 1.2)
 
void lglColor (float r, float g, float b, float a=1)
 specify vertex color attribute (as defined by OpenGL 1.2)
 
void lglNormal (const vec3f &n)
 specify vertex normal attribute (as defined by OpenGL 1.2)
 
void lglNormal (float x, float y, float z)
 specify vertex normal attribute (as defined by OpenGL 1.2)
 
void lglTexCoord (const vec4f &t)
 specify vertex texture coordinate attribute (as defined by OpenGL 1.2)
 
void lglTexCoord (float s, float t=0, float r=0, float w=1)
 specify vertex texture coordinate attribute (as defined by OpenGL 1.2)
 
void lglEnd ()
 end vertex series (as defined by OpenGL 1.2)
 
void lglMatrixMode (lgl_matrixmode_enum mode=LGL_MODELVIEW)
 specify matrix mode (as defined by OpenGL 1.2)
 
void lglLoadIdentity ()
 load identity matrix (as defined by OpenGL 1.2)
 
void lglLoadMatrix (const mat4 &matrix)
 load matrix (as defined by OpenGL 1.2)
 
void lglMultMatrix (const mat4 &matrix)
 multiply with matrix (as defined by OpenGL 1.2)
 
void lglPushMatrix ()
 push matrix (as defined by OpenGL 1.2)
 
void lglPopMatrix ()
 pop matrix (as defined by OpenGL 1.2)
 
void lglScale (const vec4 &c)
 multiply with scale matrix (as defined by OpenGL 1.2)
 
void lglScale (double s, double t, double r, double w=1)
 multiply with scale matrix (as defined by OpenGL 1.2)
 
void lglScale (double s, double w=1)
 multiply with scale matrix (as defined by OpenGL 1.2)
 
void lglTranslate (const vec4 &v)
 multiply with translation matrix (as defined by OpenGL 1.2)
 
void lglTranslate (double x, double y, double z, double w=1)
 multiply with translation matrix (as defined by OpenGL 1.2)
 
void lglRotate (double angle, const vec3 &v)
 multiply with rotation matrix (as defined by OpenGL 1.2)
 
void lglRotate (double angle, double vx, double vy, double vz)
 multiply with rotation matrix (as defined by OpenGL 1.2)
 
void lglOrtho (double left, double right, double bottom, double top, double nearp=-1, double farp=1)
 multiply with orthgraphic matrix (as defined by OpenGL 1.2)
 
void lglFrustum (double left, double right, double bottom, double top, double nearp, double farp)
 multiply with frustum matrix (as defined by OpenGL 1.2)
 
void lglPerspective (double fovy, double aspect, double nearp, double farp)
 multiply with perspective matrix (as defined by OpenGL 1.2)
 
void lglLookAt (const vec3 &eye, const vec3 &at, const vec3 &up=vec3(0, 1, 0))
 multiply with lookat matrix (as defined by OpenGL 1.2)
 
void lglLookAt (double eye_x, double eye_y, double eye_z, double at_x, double at_y, double at_z, double up_x=0, double up_y=1, double up_z=0)
 multiply with lookat matrix (as defined by OpenGL 1.2)
 
void lglViewport (int ax, int ay, int bx, int by)
 specify viewport (as defined by OpenGL 1.2)
 
void lglClearColor (float w=0, float a=1)
 specify clear color (as defined by OpenGL 1.2)
 
void lglClearColor (float r, float g, float b, float a=1)
 specify clear color (as defined by OpenGL 1.2)
 
void lglClear (GLuint bits=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
 clear color and depth buffer (as defined by OpenGL 1.2)
 
void lglClipPlane (vec4 equation=vec4(0, 0, 0, 0), unsigned int n=0, bool camera_plane=false)
 specify clip plane (as defined by OpenGL 1.2)
 
void lglClipPlane (double a, double b, double c, double d, unsigned int n=0, bool camera_plane=false)
 specify clip plane (as defined by OpenGL 1.2)
 
void lglClipPlane (vec3 point, vec3 normal, unsigned int n=0, bool camera_plane=false)
 specify clip plane (as defined by OpenGL 1.2)
 
void lglFog (float density=0.0f, vec4f color=vec4f(1))
 specify fog (as defined by OpenGL 1.2)
 
void lglLineWidth (float width=1.0f)
 specify line width (as defined by OpenGL 1.2)
 
void lglPolygonMode (lgl_polygonmode_enum mode)
 specify polygon mode (as defined by OpenGL 1.2)
 
std::string lglGetError ()
 get error string (as defined by OpenGL 1.2)
 
vec4 lglGetColor ()
 get actual color
 
void lglAttribute (const vec4f &a, unsigned int n=0)
 specify vertex attribute
 
void lglAttribute (float x, float y, float z, float w=1.0f, unsigned int n=0)
 specify vertex attribute
 
lgl_matrixmode_enum lglGetMatrixMode ()
 get actual matrix mode
 
mat4 lglGetMatrix ()
 get actual matrix
 
mat4 lglGetProjectionMatrix ()
 get actual projection matrix
 
mat4 lglGetModelViewMatrix ()
 get actual modelview matrix
 
mat4 lglGetInverseModelViewMatrix ()
 get inverse of modelview matrix
 
mat4 lglGetInverseTransposeModelViewMatrix ()
 get inverse transpose of modelview matrix
 
mat4 lglGetModelViewProjectionMatrix ()
 get combined modelview and projection matrix
 
mat4 lglGetTextureMatrix ()
 get texture matrix
 
void lglRotateX (double angle)
 multiply with rotation matrix (rotation about x-axis)
 
void lglRotateY (double angle)
 multiply with rotation matrix (rotation about y-axis)
 
void lglRotateZ (double angle)
 multiply with rotation matrix (rotation about z-axis)
 
void lglParallel (const vec3 &p, const vec3 &n, const vec3 &d)
 multiply with parallel projection matrix
 
void lglProjection ()
 reset the actual projection matrix
 
void lglProjection (const mat4 &projection)
 set the actual projection matrix
 
void lglProjection (double left, double right, double bottom, double top, double nearp, double farp)
 set the actual projection matrix
 
void lglProjection (double fovy, double aspect, double nearp, double farp)
 set the actual projection matrix
 
double getFovy ()
 get fovy parameter for last projection transformation
 
double getAspect ()
 get aspect parameter for last projection transformation
 
double getNear ()
 get near parameter for last projection transformation
 
double getFar ()
 get far parameter for last projection transformation
 
void lglModelView ()
 reset the actual modelview matrix
 
void lglModelView (const mat4 &modelview)
 set the actual modelview matrix
 
void lglView (const vec3 &eye, const vec3 &at, const vec3 &up=vec3(0, 1, 0))
 set the actual modelview matrix
 
void lglView (double eye_x, double eye_y, double eye_z, double at_x, double at_y, double at_z, double up_x=0, double up_y=1, double up_z=0)
 set the actual modelview matrix
 
vec3 getEye ()
 get eye point for last lookat transformation
 
vec3 getLookAt ()
 get lookat point for last lookat transformation
 
vec3 getUp ()
 get up vector for last lookat transformation
 
void lglManip (bool on=true)
 enable or disable the manipulator matrix
 
void lglManip (const mat4 &manip)
 update the manipulator matrix by multiplying it with a custom matrix
 
void lglManip (double focus, double angle, double tilt, double zoom)
 update the manipulator matrix by applying a rotation about a focus point and a zoom factor
 
void lglManip (double dx, double dy, double zoom=1)
 update the manipulator matrix by applying a screen-space delta
 
void lglManip (vec2 delta, double zoom=1)
 update the manipulator matrix by applying a screen-space delta
 
void lglResetManip ()
 reset the manipulator matrix
 
mat4 lglGetManip ()
 get the manipulator matrix
 
bool lglIsManipApplied ()
 is the manipulator matrix applied?
 
mat4 lglGetInverseTransposeManip ()
 get the inverse transpose of the manipulator matrix
 
void lglModel (const mat4 &model)
 set the vbo modeling matrix
 
mat4 lglGetModelMatrix ()
 get the vbo modeling matrix
 
mat4 lglGetInverseTransposeModelMatrix ()
 get the inverse transpose of the vbo modeling matrix
 
void lglTex (const mat4 &tex)
 set the vbo texturing matrix
 
void lglTex (const vec4 &scale, const vec4 &offset)
 set the vbo texturing matrix
 
mat4 lglGetTexMatrix ()
 get the vbo texturing matrix
 
void lglLight (vec4f light=vec4f(0, 0, 1, 0), bool camera_light=true, vec3f ka=vec3f(0.1f), vec3f kd=vec3f(0.7f), vec3f ks=vec3f(0.2f), vec3f Ia=vec3f(1), vec3f Id=vec3f(1), vec3f Is=vec3f(1), float exponent=30, vec3f falloff=vec3f(1, 0, 0))
 specify lighting parameters
 
void lglInitializeOpenGL (float r=0, float g=0, float b=0, float a=1, bool ztest=true, bool culling=false)
 initialize OpenGL state (clear color, depth test, back-face culling)
 
void lglRGBAWrite (bool r=true, bool g=true, bool b=true, bool a=true)
 change OpenGL state (rgba write)
 
bool lglGetRGBAWrite ()
 get OpenGL state (rgba write)
 
void lglZWrite (bool on=true)
 change OpenGL state (depth write)
 
bool lglGetZWrite ()
 get OpenGL state (depth write)
 
void lglDepthTest (bool on=false)
 change OpenGL state (depth test)
 
bool lglGetDepthTest ()
 get OpenGL state (depth test)
 
void lglBackFaceCulling (bool on=true)
 change OpenGL state (back-face culling)
 
bool lglGetBackFaceCulling ()
 get OpenGL state (back-face culling)
 
void lglBlendMode (lgl_blendmode_enum mode)
 change OpenGL state (blending)
 
bool lglGetBlending ()
 get OpenGL state (blending)
 
lgl_blendmode_enum lglGetBlendMode ()
 get OpenGL state (blend mode)
 
void lglAlphaTest (bool on=false, float value=0.0f, bool greater=true, bool equal=false)
 change OpenGL state (alpha test)
 
bool lglGetAlphaTest ()
 get OpenGL state (alpha test)
 
float lglGetAlphaTestValue ()
 get OpenGL state (alpha test value)
 
bool lglGetAlphaTestGreater ()
 get OpenGL state (alpha test comparison mode)
 
bool lglGetAlphaTestEqual ()
 get OpenGL state (alpha test equality mode)
 
bool lglGetClipPlane (unsigned int n=0)
 get OpenGL state (clip plane)
 
vec4 lglGetClipPlaneEquation (unsigned int n=0)
 get OpenGL state (clip plane equation)
 
vec4 lglGetClipPlaneEquation (vec3 point, vec3 normal)
 compute OpenGL parameters (clip plane equation)
 
bool lglGetFog ()
 get OpenGL state (fog)
 
float lglGetFogDensity ()
 get OpenGL state (fog density)
 
vec4f lglGetFogColor ()
 get OpenGL state (fog color)
 
float lglGetLineWidth ()
 get OpenGL state (line width)
 
void lglTogglePolygonMode ()
 toggle OpenGL state (polygon mode)
 
lgl_polygonmode_enum lglGetPolygonMode ()
 get OpenGL state (polygon mode)
 
void lglInterlacingMode (lgl_interlacing_enum mode)
 change OpenGL state (interlacing mode)
 
void lglComplementaryInterlacingMode (lgl_interlacing_enum mode)
 change OpenGL state (complementary interlacing mode)
 
lgl_interlacing_enum lglGetInterlacingMode ()
 get OpenGL state (interlacing mode)
 
GLuint lglSupportsGLSL ()
 get GLSL support
 
std::string lglGetGLSLVersionString ()
 get GLSL version string
 
std::string lglPlainGLSLVertexShader ()
 get the LGL plain GLSL vertex shader
 
std::string lglPlainGLSLFragmentShader ()
 get the LGL plain GLSL fragment shader
 
std::string lglPlainGLSLProgram ()
 get the combined LGL plain GLSL program
 
std::string lglBasicGLSLVertexShader (bool colors=false, bool normals=false, bool texcoords=false)
 get the LGL default vertex shader
 
std::string lglBasicGLSLFragmentShader (bool colors=false, bool normals=false, bool texcoords=false, bool tex3D=false)
 get the LGL default fragment shader
 
GLuint lglCompileGLSLVertexShader (std::string shader)
 compile GLSL vertex shader
 
GLuint lglCompileGLSLFragmentShader (std::string shader)
 compile GLSL fragment shader
 
GLuint lglLinkGLSLProgram (GLuint vertex_shader_id, GLuint fragment_shader_id, GLuint custom_shader_program=0)
 link GLSL program
 
GLuint lglCompileGLSLProgram (std::string vertex_shader, std::string fragment_shader)
 compile GLSL program
 
GLuint lglLoadGLSLProgram (const char *vertex_shader_file, const char *fragment_shader_file)
 load GLSL program
 
std::string lglCombineGLSLProgram (const std::string &vertex_shader, const std::string &fragment_shader)
 combine GLSL program
 
bool lglSplitGLSLProgram (std::string shader, std::string &vertex_shader, std::string &fragment_shader)
 split GLSL program
 
GLuint lglCompileGLSLProgram (std::string shader)
 compile combined GLSL program
 
GLuint lglLoadGLSLProgram (const char *shader_file)
 load combined GLSL program
 
void lglDeleteGLSLShader (GLuint shader_id)
 delete GLSL shader
 
void lglDeleteGLSLProgram (GLuint program)
 delete GLSL program
 
void lglUseProgram (GLuint program, bool clear=true)
 use GLSL program
 
void lglUseDefaultProgram (bool clear=true)
 use default GLSL program
 
void lglReplaceDefaultProgram (GLuint program, bool colors=false, bool normals=true, bool texcoords=false, bool tex3D=false)
 replace default GLSL program
 
GLuint lglGetProgram ()
 get actual GLSL program
 
GLuint lglGetActiveProgram ()
 get active GLSL program
 
void lglReuseProgram (GLuint program)
 reuse GLSL program
 
unsigned int lglUniform (std::string uniform)
 specify GLSL program uniform (undefined)
 
unsigned int lglUniformi (std::string uniform, int value)
 specify GLSL program uniform (integer)
 
void lglUniformi (unsigned int index, int value)
 specify GLSL program uniform (integer, indexed)
 
unsigned int lglUniformf (std::string uniform, double value)
 specify GLSL program uniform (float)
 
void lglUniformf (unsigned int index, double value)
 specify GLSL program uniform (float, indexed)
 
unsigned int lglUniformf (std::string uniform, double x, double y, double z, double w=1)
 specify GLSL program uniform (4xfloat)
 
void lglUniformf (unsigned int index, double x, double y, double z, double w=1)
 specify GLSL program uniform (4xfloat, indexed)
 
unsigned int lglUniformfv (std::string uniform, const vec2f &value)
 specify GLSL program uniform (vec2f)
 
void lglUniformfv (unsigned int index, const vec2f &value)
 specify GLSL program uniform (vec2f, indexed)
 
unsigned int lglUniformfv (std::string uniform, const vec3f &value)
 specify GLSL program uniform (vec3f)
 
void lglUniformfv (unsigned int index, const vec3f &value)
 specify GLSL program uniform (vec3f, indexed)
 
unsigned int lglUniformfv (std::string uniform, const vec4f &value)
 specify GLSL program uniform (vec4f)
 
void lglUniformfv (unsigned int index, const vec4f &value)
 specify GLSL program uniform (vec4f, indexed)
 
unsigned int lglUniformfv (std::string uniform, const mat2f &value)
 specify GLSL program uniform matrix (mat2f)
 
void lglUniformfv (unsigned int index, const mat2f &value)
 specify GLSL program uniform matrix (mat2f, indexed)
 
unsigned int lglUniformfv (std::string uniform, const mat3f &value)
 specify GLSL program uniform matrix (mat3f)
 
void lglUniformfv (unsigned int index, const mat3f &value)
 specify GLSL program uniform matrix (mat3f, indexed)
 
unsigned int lglUniformfv (std::string uniform, const mat4f &value)
 specify GLSL program uniform matrix (mat4f)
 
void lglUniformfv (unsigned int index, const mat4f &value)
 specify GLSL program uniform matrix (mat4f, indexed)
 
unsigned int lglSampler (std::string sampler, int value=0, bool warn=true)
 specify GLSL program uniform sampler
 
void lglSampler (unsigned int index, int value=0, bool warn=true)
 specify GLSL program uniform sampler (indexed)
 
unsigned int lglSampler2D (std::string sampler, GLuint texid2D, int value=0, bool warn=true)
 bind 2D sampler
 
void lglSampler2D (unsigned int index, GLuint texid2D, int value=0, bool warn=true)
 bind 2D sampler (indexed)
 
unsigned int lglSampler3D (std::string sampler, GLuint texid3D, int value=0, bool warn=true)
 bind 3D sampler
 
void lglSampler3D (unsigned int index, GLuint texid3D, int value=0, bool warn=true)
 bind 3D sampler (indexed)
 
void lglPrintUniforms ()
 print GLSL uniforms
 
void lglLightDirection (vec3f light=vec3f(0, 0, 1), bool camera_light=true)
 set light direction
 
void lglLightPosition (vec3f light=vec3f(0, 0, 0), bool camera_light=true)
 set light position
 
void lglLightVector (vec4f light=vec4f(0, 0, 1, 0), bool camera_light=true)
 set light vector
 
vec4f lglGetLightVector ()
 get light vector (in camera coordinates)
 
void lglLightParameters (vec3f ka=vec3f(0.1f), vec3f kd=vec3f(0.7f), vec3f ks=vec3f(0.2f), vec3f Ia=vec3f(1), vec3f Id=vec3f(1), vec3f Is=vec3f(1), float exponent=30, vec3f falloff=vec3f(1, 0, 0))
 set light parameters
 
void lglGetLightParameters (vec3f &ka, vec3f &kd, vec3f &ks, vec3f &Ia, vec3f &Id, vec3f &Is, float &exponent, vec3f &falloff)
 get light parameters
 
void lglLightSourceParameters (vec3f Ia=vec3f(1), vec3f Id=vec3f(1), vec3f Is=vec3f(1), vec3f falloff=vec3f(1, 0, 0))
 set light source parameters
 
void lglGetLightSourceParameters (vec3f &Ia, vec3f &Id, vec3f &Is, vec3f &falloff)
 get light source parameters
 
void lglMaterialParameters (vec3f ka=vec3f(0.1f), vec3f kd=vec3f(0.7f), vec3f ks=vec3f(0.2f), float exponent=30)
 set material parameters
 
void lglGetMaterialParameters (vec3f &ka, vec3f &kd, vec3f &ks, float &exponent)
 get material parameters
 
void lglTexture2D (GLuint texid, bool owner=false)
 bind 2D texture
 
GLuint lglGetTexture2D ()
 get 2D texture
 
void lglTexture3D (GLuint texid, bool owner=false)
 bind 3D texture
 
GLuint lglGetTexture3D ()
 get 3D texture
 
void lglDeleteTexture ()
 delete any texture
 
void lglTexCoordGen (lgl_texgenmode_enum mode=LGL_TEXGEN_LINEAR)
 enable texture coordinate generation
 
lgl_texgenmode_enum lglGetTexCoordGen ()
 check for texture coordinate generation
 
void lglColoring (bool on)
 enable coloring
 
bool lglGetColoring ()
 check for coloring
 
void lglLighting (bool on)
 enable lighting
 
bool lglGetLighting ()
 check for lighting
 
void lglTexturing (bool on)
 enable texturing
 
bool lglGetTexturing ()
 check for texturing
 
void lglDisableColoring (bool off)
 entirely disable vertex colors
 
void lglDisableLighting (bool off)
 entirely disable vertex normals
 
void lglDisableTexturing (bool off)
 entirely disable texture coordinates
 
void lglRender (lglVBO *vbo, const GL *gl=&LGL)
 render vbo (by copying the global state)
 
void lglRender (lglVBO &vbo, const GL *gl=&LGL)
 render vbo (by copying the global state)
 
void lglCloneState (const GL *gl)
 clone state from vbo (coloring, lighting and texturing)
 
void lglCloneState (const lglVBO *vbo)
 clone state from vbo (coloring, lighting and texturing)
 
void lglCopyUniforms (const GL *gl, bool warn=false)
 copy uniforms from vbo
 
void lglCopyUniforms (const lglVBO *vbo, bool warn=false)
 copy uniforms from vbo
 
unsigned char * lglReadRGBPixels (int x, int y, int width, int height)
 read frame buffer
 
void lglBeginRayCast (vec3 origin, vec3 direction, double mindist=0)
 begin ray casting in view coordinates
 
void lglRayCast (lglVBO *vbo)
 cast a ray and intersect it with the transformed triangles contained in the vbo
 
LGL_VBO_TYPElglEndRayCast ()
 end ray casting
 
double lglGetRayCastDistance ()
 get distance to front-most hit point determined by ray casting
 
void lglEnableViewCulling (int minsize=0)
 enable view culling
 
void lglDisableViewCulling ()
 disable view culling
 
void lglBeginExport (void(*callback)(LGL_VBO_TYPE *vbo, void *data), void *data, mat4 m=mat4(1))
 begin scene export
 
void lglEndExport ()
 end scene export
 
int lglGetGLVersion ()
 get OpenGL version
 
int lglMapGL2GLSLVersion (int glversion)
 map gl version to glsl version
 
int lglGetGLSLVersion ()
 get GLSL version
 
std::string lglGetRenderer ()
 get OpenGL renderer
 
lgl_vendor_enum lglGetVendor ()
 get OpenGL vendor
 
std::string lglGetVendorName ()
 get OpenGL vendor name
 
void lglMessage (std::string m)
 generate a status message
 
void lglError (std::string e)
 generate an error message
 
void lglWarning (std::string w)
 generate a warning message
 
void lglFatal (std::string e)
 generate a non-recoverable error
 
std::string lglGetWarning ()
 get warning message
 
void lglVerbosity (lgl_verbosity_enum v)
 change verbosity level
 

Detailed Description

LGL immediate mode API (as specified by OpenGL 1.2 plus extensions)