Go to the documentation of this file.
13 inline GL *getGL() {
return(&LGL);}
26 inline void lglVertex(
double x,
double y,
double z,
double w = 1)
27 {LGL.lglVertex(x,y,z,w);}
34 inline void lglColor(
float r,
float g,
float b,
float a = 1)
35 {LGL.lglColor(r,g,b,a);}
43 {LGL.lglNormal(x,y,z);}
50 inline void lglTexCoord(
float s,
float t = 0,
float r = 0,
float w = 1)
51 {LGL.lglTexCoord(s,t,r,w);}
86 inline void lglScale(
double s,
double t,
double r,
double w = 1)
98 inline void lglTranslate(
double x,
double y,
double z,
double w = 1)
106 inline void lglRotate(
double angle,
double vx,
double vy,
double vz)
110 inline void lglOrtho(
double left,
double right,
double bottom,
double top,
double nearp = -1,
double farp = 1)
111 {LGL.
lglOrtho(left, right, bottom, top, nearp, farp);}
114 inline void lglFrustum(
double left,
double right,
double bottom,
double top,
double nearp,
double farp)
115 {LGL.
lglFrustum(left, right, bottom, top, nearp, farp);}
118 inline void lglPerspective(
double fovy,
double aspect,
double nearp,
double farp)
126 inline void lglLookAt(
double eye_x,
double eye_y,
double eye_z,
127 double at_x,
double at_y,
double at_z,
128 double up_x = 0,
double up_y = 1,
double up_z = 0)
129 {LGL.
lglLookAt(eye_x,eye_y,eye_z, at_x,at_y,at_z, up_x,up_y,up_z);}
137 {LGL.lglClearColor(w,w,w,a);}
141 {LGL.lglClearColor(r,g,b,a);}
144 inline void lglClear(GLuint bits = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
152 inline void lglClipPlane(
double a,
double b,
double c,
double d,
unsigned int n = 0,
bool camera_plane =
false)
161 {LGL.
lglFog(density, color);}
183 {LGL.lglAttribute(a,n);}
186 inline void lglAttribute(
float x,
float y,
float z,
float w = 1.0f,
unsigned int n = 0)
187 {LGL.lglAttribute(x,y,z,w, n);}
246 inline void lglProjection(
double left,
double right,
double bottom,
double top,
double nearp,
double farp)
250 inline void lglProjection(
double fovy,
double aspect,
double nearp,
double farp)
282 inline void lglView(
double eye_x,
double eye_y,
double eye_z,
283 double at_x,
double at_y,
double at_z,
284 double up_x = 0,
double up_y = 1,
double up_z = 0)
285 {LGL.
lglView(eye_x,eye_y,eye_z, at_x,at_y,at_z, up_x,up_y,up_z);}
297 {
return(LGL.
getUp());}
308 inline void lglManip(
double focus,
double angle,
double tilt,
double zoom)
309 {LGL.
lglManip(focus, angle, tilt, zoom);}
312 inline void lglManip(
double dx,
double dy,
double zoom = 1)
363 float exponent = 30,
vec3f falloff =
vec3f(1,0,0))
364 {LGL.
lglLight(light, camera_light, ka, kd, ks, Ia, Id, Is, exponent, falloff);}
368 bool ztest =
true,
bool culling =
false)
372 inline void lglRGBAWrite(
bool r =
true,
bool g =
true,
bool b =
true,
bool a =
true)
416 inline void lglAlphaTest(
bool on =
false,
float value = 0.0f,
bool greater =
true,
bool equal =
false)
465 {LGL.lglTogglePolygonMode();}
520 inline GLuint
lglLinkGLSLProgram(GLuint vertex_shader_id, GLuint fragment_shader_id, GLuint custom_shader_program = 0)
521 {
return(LGL.
lglLinkGLSLProgram(vertex_shader_id, fragment_shader_id, custom_shader_program));}
536 inline bool lglSplitGLSLProgram(std::string shader, std::string &vertex_shader, std::string &fragment_shader)
564 inline void lglReplaceDefaultProgram(GLuint program,
bool colors =
false,
bool normals =
true,
bool texcoords =
false,
bool tex3D =
false)
592 inline unsigned int lglUniformf(std::string uniform,
double value)
600 inline unsigned int lglUniformf(std::string uniform,
double x,
double y,
double z,
double w = 1)
604 inline void lglUniformf(
unsigned int index,
double x,
double y,
double z,
double w = 1)
692 inline unsigned int lglSampler(std::string sampler,
int value = 0,
bool warn =
true)
693 {
return(LGL.
lglSampler(sampler, value, warn));}
696 inline void lglSampler(
unsigned int index,
int value = 0,
bool warn =
true)
700 inline unsigned int lglSampler2D(std::string sampler, GLuint texid2D,
int value = 0,
bool warn =
true)
701 {
return(LGL.
lglSampler2D(sampler, texid2D, value, warn));}
704 inline void lglSampler2D(
unsigned int index, GLuint texid2D,
int value = 0,
bool warn =
true)
708 inline unsigned int lglSampler3D(std::string sampler, GLuint texid3D,
int value = 0,
bool warn =
true)
709 {
return(LGL.
lglSampler3D(sampler, texid3D, value, warn));}
712 inline void lglSampler3D(
unsigned int index, GLuint texid3D,
int value = 0,
bool warn =
true)
738 float exponent = 30,
vec3f falloff =
vec3f(1,0,0))
744 float &exponent,
vec3f &falloff)
916 inline void lglTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
const void *pixels)
917 {LGL.lglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);}
920 inline void lglTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type,
const void *pixels)
921 {LGL.lglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);}
948 class lglScopedMatrixStack
952 lglScopedMatrixStack()
955 ~lglScopedMatrixStack()
961 #define lglPushMatrixScoped() lglScopedMatrixStack __lglPushMatrixScoped__
964 #define lglRandom() drand48()
967 #define lglSeed() srand48((unsigned int)time(NULL))
970 #define LGL_WARN(s) lglWarn(std::string(s)+" @ "+__FILE__+":"+glslmath::to_string(__LINE__))
973 #define LGL_ERROR(s) lglError(std::string(s)+" @ "+__FILE__+":"+glslmath::to_string(__LINE__))
978 #define glVertex2f(x,y) LGL_ERROR("use lglVertex instead of glVertex2f")
979 #define glVertex2d(x,y) LGL_ERROR("use lglVertex instead of glVertex2d")
980 #define glVertex3f(x,y,z) LGL_ERROR("use lglVertex instead of glVertex3f")
981 #define glVertex3d(x,y,z) LGL_ERROR("use lglVertex instead of glVertex3d")
982 #define glVertex4f(x,y,z,w) LGL_ERROR("use lglVertex instead of glVertex4f")
983 #define glVertex4d(x,y,z,w) LGL_ERROR("use lglVertex instead of glVertex4d")
984 #define glColor3f(x,y,z) LGL_ERROR("use lglColor instead of glColor3f")
985 #define glColor3d(x,y,z) LGL_ERROR("use lglColor instead of glColor3d")
986 #define glNormal3f(x,y,z) LGL_ERROR("use lglNormal instead of glNormal3f")
987 #define glNormal3d(x,y,z) LGL_ERROR("use lglNormal instead of glNormal3d")
988 #define glTexCoord2f(x,y) LGL_ERROR("use lglTexCoord instead of glTexCoord2f")
989 #define glTexCoord2d(x,y) LGL_ERROR("use lglTexCoord instead of glTexCoord2d")
990 #define glTexCoord3f(x,y,z) LGL_ERROR("use lglTexCoord instead of glTexCoord3f")
991 #define glTexCoord3d(x,y,z) LGL_ERROR("use lglTexCoord instead of glTexCoord3d")
992 #define glTexCoord4f(x,y,z,w) LGL_ERROR("use lglTexCoord instead of glTexCoord4f")
993 #define glTexCoord4d(x,y,z,w) LGL_ERROR("use lglTexCoord instead of glTexCoord4d")
994 #define glMatrixMode(m) LGL_ERROR("use lglMatrixMode instead of glMatrixMode")
995 #define glLoadIdentity(m) LGL_ERROR("use lglLoadIdentity instead of glLoadIdentity")
996 #define glLoadMatrixf(m) LGL_ERROR("use lglLoadMatrix instead of glLoadMatrixf")
997 #define glLoadMatrixd(m) LGL_ERROR("use lglLoadMatrix instead of glLoadMatrixd")
998 #define glMultMatrixf(m) LGL_ERROR("use lglMultMatrix instead of glMultMatrixf")
999 #define glMultMatrixd(m) LGL_ERROR("use lglMultMatrix instead of glMultMatrixd")
1000 #define glPushMatrix() LGL_ERROR("use lglPushMatrix instead of glPushMatrix")
1001 #define glPopMatrix() LGL_ERROR("use lglPopMatrix instead of glPopMatrix")
1002 #define glTranslatef(x,y,z) LGL_ERROR("use lglTranslate instead of glTranslatef")
1003 #define glTranslated(x,y,z) LGL_ERROR("use lglTranslate instead of glTranslated")
1004 #define glRotatef(a,x,y,z) LGL_ERROR("use lglRotate instead of glRotatef")
1005 #define glRotated(a,x,y,z) LGL_ERROR("use lglRotate instead of glRotated")
1006 #define glScalef(x,y,z) LGL_ERROR("use lglScale instead of glScalef")
1007 #define glScaled(x,y,z) LGL_ERROR("use lglScale instead of glScaled")
1008 #define glOrtho(l,r,b,t,n,f) LGL_ERROR("use lglOrtho instead of glOrtho")
1011 #define gluPerspective(fy,ar,np,fp) LGL_ERROR("use lglPerspective instead of gluPerspective")
1012 #define gluLookAt(ex,ey,ez,ax,ay,az,ux,uy,uz) LGL_ERROR("use lglLookAt instead of gluLookAt")
std::string lglGetWarning()
get warning message
Definition: glvertex_api.h:940
lgl_vendor_enum
graphics hardware vendor
Definition: glvertex_core.h:24
3D float vector
Definition: glslmath.h:584
void lglLightPosition(vec3f light=vec3f(0, 0, 0), bool camera_light=true)
set the light position
Definition: glvertex_core.h:4145
void lglMaterialParameters(vec3f ka=vec3f(0.1f), vec3f kd=vec3f(0.7f), vec3f ks=vec3f(0.2f), float exponent=30)
set the material parameters
Definition: glvertex_core.h:4244
lgl_polygonmode_enum
polygon mode enum
Definition: glvertex_core.h:82
std::string lglBasicGLSLFragmentShader(bool colors=false, bool normals=false, bool texcoords=false, bool tex3D=false)
get the LGL default fragment shader
Definition: glvertex_api.h:508
unsigned char * lglReadRGBPixels(int x, int y, int width, int height)
read frame buffer
Definition: glvertex_api.h:856
void lglMessage(std::string m)
generate a status message
Definition: glvertex_api.h:924
void lglBlendMode(lgl_blendmode_enum mode)
change OpenGL state (blending)
Definition: glvertex_api.h:404
static void lglDeleteGLSLProgram(GLuint program)
delete a compiled GLSL program
Definition: glvertex_core.h:3161
void lglAlphaTest(bool on=false, float value=0.0f, bool greater=true, bool equal=false)
change OpenGL state (alpha test)
Definition: glvertex_api.h:416
void lglMaterialParameters(vec3f ka=vec3f(0.1f), vec3f kd=vec3f(0.7f), vec3f ks=vec3f(0.2f), float exponent=30)
set material parameters
Definition: glvertex_api.h:758
static bool lglGetZWrite()
get the depth write mask
Definition: glvertex_core.h:4423
lgl_matrixmode_enum lglGetMatrixMode() const
get the actual matrix mode
Definition: glvertex_core.h:1987
void lglMultMatrix(const mat4 &matrix)
multiply a specific matrix in immediate mode fashion
Definition: glvertex_core.h:2044
void lglWarning(std::string w)
generate a warning message
Definition: glvertex_api.h:932
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)
Definition: glvertex_api.h:367
bool lglGetClipPlane(unsigned int n=0)
get OpenGL state (clip plane)
Definition: glvertex_api.h:436
static GLuint lglCompileGLSLProgram(std::string vertex_shader, std::string fragment_shader)
compile a GLSL program from a vertex and a fragment shader source
Definition: glvertex_core.h:3007
void lglDisableLighting(bool off)
entirely disable vertex normals
Definition: glvertex_api.h:824
static float lglGetLineWidth()
get the line rasterization width
Definition: glvertex_core.h:4741
vec3 getEye()
get eye point for last lookat transformation
Definition: glvertex_api.h:288
void lglComplementaryInterlacingMode(lgl_interlacing_enum mode)
change OpenGL state (complementary interlacing mode)
Definition: glvertex_api.h:476
double lglGetRayCastDistance()
get distance to front-most hit point determined by ray casting
Definition: glvertex_api.h:872
void lglTex()
reset the vbo texturing matrix
Definition: glvertex_core.h:2577
static std::string lglPlainGLSLVertexShader()
get the LGL plain GLSL vertex shader
Definition: glvertex_core.h:2673
mat4 lglGetModelViewProjectionMatrix()
get combined modelview and projection matrix
Definition: glvertex_api.h:214
unsigned int lglUniformfv(std::string uniform, const vec2f &value)
specify GLSL program uniform (vec2f)
Definition: glvertex_api.h:608
lgl_verbosity_enum
verbosity level enum
Definition: glvertex_core.h:100
void lglPolygonMode(lgl_polygonmode_enum mode)
specify polygon mode (as defined by OpenGL 1.2)
Definition: glvertex_api.h:168
static void lglDisableLighting(bool off)
entirely disable vertex normals
Definition: glvertex_core.h:3422
unsigned int lglUniform(std::string uniform)
specify GLSL program uniform (undefined)
Definition: glvertex_api.h:580
static void lglFog(float density=0.0f, vec4f color=vec4f(1))
specify the fog parameters as supported by the default GLSL program
Definition: glvertex_core.h:4710
static void lglRGBAWrite(bool r=true, bool g=true, bool b=true, bool a=true)
specify the RGBA write mask
Definition: glvertex_core.h:4390
void lglBeginExport(void(*callback)(LGL_VBO_TYPE *vbo, void *data), void *data, mat4 m=mat4(1))
begin scene export
Definition: glvertex_api.h:884
vec4 lglGetLightVector() const
get the light vector (in camera coordinates)
Definition: glvertex_core.h:4176
mat4 lglGetMatrix()
get actual matrix
Definition: glvertex_api.h:194
lgl_primitive_enum
graphics primitive type
Definition: glvertex_core.h:33
void lglLineWidth(float width=1.0f)
specify line width (as defined by OpenGL 1.2)
Definition: glvertex_api.h:164
static int lglGetGLVersion()
get the OpenGL version
Definition: glvertex_core.h:5044
void lglDeleteGLSLProgram(GLuint program)
delete GLSL program
Definition: glvertex_api.h:552
static lgl_interlacing_enum lglGetInterlacingMode()
get the actual interlacing mode
Definition: glvertex_core.h:4790
void lglMatrixMode(lgl_matrixmode_enum mode=LGL_MODELVIEW)
determine the actual matrix mode
Definition: glvertex_core.h:1981
vec3 getEye() const
get eye point for last lookat transformation
Definition: glvertex_core.h:2336
GLuint lglLoadGLSLProgram(const char *vertex_shader_file, const char *fragment_shader_file)
load GLSL program
Definition: glvertex_api.h:528
int lglGetGLVersion()
get OpenGL version
Definition: glvertex_api.h:892
void lglResetManip()
reset the manipulator matrix
Definition: glvertex_api.h:320
GLuint lglGetActiveProgram()
get active GLSL program
Definition: glvertex_api.h:572
bool lglGetFog()
get OpenGL state (fog)
Definition: glvertex_api.h:448
bool lglGetBackFaceCulling()
get OpenGL state (back-face culling)
Definition: glvertex_api.h:400
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)
Definition: glvertex_api.h:110
static void lglAlphaTest(bool on=false, float value=0.0f, bool greater=true, bool equal=false)
enable or disable alpha testing
Definition: glvertex_core.h:4575
void lglGetLightSourceParameters(vec3f &Ia, vec3f &Id, vec3f &Is, vec3f &falloff)
get light source parameters
Definition: glvertex_api.h:753
void lglProjection()
reset the actual projection matrix
Definition: glvertex_core.h:2354
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)
Definition: glvertex_api.h:148
void lglVerbosity(lgl_verbosity_enum v)
change verbosity level
Definition: glvertex_api.h:944
mat4 lglGetInverseModelViewMatrix() const
get the inverse of the actual modelview matrix
Definition: glvertex_core.h:2170
void lglDeleteTexture()
delete any texture
Definition: glvertex_api.h:784
void lglColoring(bool on)
enable coloring
Definition: glvertex_api.h:796
std::string lglGetRenderer()
get OpenGL renderer
Definition: glvertex_api.h:904
bool lglGetTexturing() const
check for texturing
Definition: glvertex_core.h:3410
void lglEnd()
end vertex series (as defined by OpenGL 1.2)
Definition: glvertex_api.h:54
bool lglIsManipApplied()
is the manipulator matrix applied?
Definition: glvertex_api.h:328
GLuint lglSupportsGLSL()
get GLSL support
Definition: glvertex_api.h:484
bool lglSplitGLSLProgram(std::string shader, std::string &vertex_shader, std::string &fragment_shader)
split GLSL program
Definition: glvertex_api.h:536
void lglProjection()
reset the actual projection matrix
Definition: glvertex_api.h:238
std::string lglBasicGLSLVertexShader(bool colors=false, bool normals=false, bool texcoords=false)
get the LGL default vertex shader
Definition: glvertex_api.h:504
vec3 getLookAt()
get lookat point for last lookat transformation
Definition: glvertex_api.h:292
void lglTexCoordGen(lgl_texgenmode_enum mode=LGL_TEXGEN_LINEAR, double mix=0.5)
enable texture coordinate generation
Definition: glvertex_core.h:4327
mat4 lglGetManip()
get the manipulator matrix
Definition: glvertex_api.h:324
vec4f lglGetFogColor()
get OpenGL state (fog color)
Definition: glvertex_api.h:456
void lglUseDefaultProgram(bool clear=true)
use default GLSL program
Definition: glvertex_api.h:560
static void lglRayCast(lgl *vbo)
cast a ray and intersect it with the transformed triangles contained in the vbo
Definition: glvertex_core.h:4963
static std::string lglGetGLSLVersionString()
get GLSL version string
Definition: glvertex_core.h:2658
void lglGetLightSourceParameters(vec3f &Ia, vec3f &Id, vec3f &Is, vec3f &falloff) const
get the light source parameters
Definition: glvertex_core.h:4233
void lglAttribute(const vec4f &a, unsigned int n=0)
specify vertex attribute
Definition: glvertex_api.h:182
vec4f lglGetLightVector()
get light vector (in camera coordinates)
Definition: glvertex_api.h:732
void lglManip(bool on=true)
enable or disable the manipulator matrix
Definition: glvertex_api.h:300
static void lglDepthTest(bool on=true)
enable or disable depth testing
Definition: glvertex_core.h:4431
int lglGetGLSLVersion()
get GLSL version
Definition: glvertex_api.h:900
static bool lglGetDepthTest()
check whether or not depth testing is enabled
Definition: glvertex_core.h:4446
LGL_VBO_TYPE * lglEndRayCast()
end ray casting
Definition: glvertex_api.h:868
static void lglClear(GLuint bits=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
clear the color and depth buffer
Definition: glvertex_core.h:4384
void lglUseDefaultProgram(bool clear=true)
use the default GLSL program which simulates the fixed function OpenGL pipeline
Definition: glvertex_core.h:3202
static void lglViewport(int ax, int ay, int bx, int by)
set the viewport
Definition: glvertex_core.h:4367
mat4 lglGetInverseTransposeModelMatrix() const
get the inverse transpose of the vbo modeling matrix
Definition: glvertex_core.h:2545
2D double vector
Definition: glslmath.h:108
void lglRGBAWrite(bool r=true, bool g=true, bool b=true, bool a=true)
change OpenGL state (rgba write)
Definition: glvertex_api.h:372
void lglPopMatrix()
pop the top entry of the matrix stack
Definition: glvertex_core.h:2095
double getAspect()
get aspect parameter for last projection transformation
Definition: glvertex_core.h:2300
void lglLightDirection(vec3f light=vec3f(0, 0, 1), bool camera_light=true)
set light direction
Definition: glvertex_api.h:720
void lglBeginRayCast(vec3 origin, vec3 direction, double mindist=0)
begin ray casting in view coordinates
Definition: glvertex_api.h:860
static GLuint lglCompileGLSLVertexShader(std::string shader)
compile GLSL vertex shader
Definition: glvertex_core.h:2847
2x2 float matrix
Definition: glslmath.h:1408
LGL API: immediate mode class definition.
Definition: glvertex_core.h:5820
double getNear()
get near parameter for last projection transformation
Definition: glvertex_api.h:262
double getNear()
get near parameter for last projection transformation
Definition: glvertex_core.h:2306
float lglGetFogDensity()
get OpenGL state (fog density)
Definition: glvertex_api.h:452
4D double vector
Definition: glslmath.h:713
void lglGetLightParameters(vec3f &ka, vec3f &kd, vec3f &ks, vec3f &Ia, vec3f &Id, vec3f &Is, float &exponent, vec3f &falloff) const
get the light parameters
Definition: glvertex_core.h:4202
void lglViewport(int ax, int ay, int bx, int by)
specify viewport (as defined by OpenGL 1.2)
Definition: glvertex_api.h:132
double getFovy()
get fovy parameter for last projection transformation
Definition: glvertex_api.h:254
static std::string lglGetVendorName()
get the vendor name of the graphics hardware
Definition: glvertex_core.h:5094
void lglTexture3D(GLuint texid, bool owner=false)
bind a 3D texture for the default GLSL program
Definition: glvertex_core.h:4282
std::string lglGetVendorName()
get OpenGL vendor name
Definition: glvertex_api.h:912
void lglUseProgram(GLuint program, bool clear=true)
use GLSL program
Definition: glvertex_api.h:556
static std::string lglCombineGLSLProgram(const std::string &vertex_shader, const std::string &fragment_shader)
combine GLSL program
Definition: glvertex_core.h:3064
void lglTexturing(bool on)
enable texturing
Definition: glvertex_api.h:812
unsigned int lglSampler2D(std::string sampler, GLuint texid2D, int value=0, bool warn=true)
bind 2D sampler
Definition: glvertex_api.h:700
void lglModelView()
reset the actual modelview matrix
Definition: glvertex_core.h:2389
void lglCloneState(const GL *gl)
clone state from vbo (coloring, lighting and texturing)
Definition: glvertex_api.h:840
mat4 lglGetTextureMatrix() const
get the actual texture matrix
Definition: glvertex_core.h:2191
static void lglEnableViewCulling(int minsize=0)
enable view culling
Definition: glvertex_core.h:4991
void lglView(const vec3 &eye, const vec3 &at, const vec3 &up=vec3(0, 1, 0))
set the actual modelview matrix
Definition: glvertex_api.h:278
void lglUseProgram(GLuint program, bool clear=true)
use a custom GLSL program
Definition: glvertex_core.h:3178
GLuint lglGetTexture2D() const
get the bound 2D texture
Definition: glvertex_core.h:4276
GLuint lglGetTexture3D() const
get the bound 3D texture
Definition: glvertex_core.h:4292
void lglDeleteTexture()
delete any texture map
Definition: glvertex_core.h:4320
static void lglError(std::string e)
generate an error message
Definition: glvertex_core.h:5665
void lglLightVector(vec4f light=vec4f(0, 0, 1, 0), bool camera_light=true)
set the light vector
Definition: glvertex_core.h:4151
void lglPopMatrix()
pop matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:78
void lglTogglePolygonMode()
toggle OpenGL state (polygon mode)
Definition: glvertex_api.h:464
void lglModelView()
reset the actual modelview matrix
Definition: glvertex_api.h:270
void lglRotate(double angle, const vec3 &v)
multiply with rotation matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:102
static double lglGetRayCastDistance()
get distance to front-most hit point determined by ray casting
Definition: glvertex_core.h:4985
void lglColor(const vec4f &c)
specify vertex color attribute (as defined by OpenGL 1.2)
Definition: glvertex_api.h:30
lgl_matrixmode_enum
matrix mode enum
Definition: glvertex_core.h:46
void lglReuseProgram(GLuint program)
reuse GLSL program
Definition: glvertex_api.h:576
void lglLightSourceParameters(vec3f Ia=vec3f(1), vec3f Id=vec3f(1), vec3f Is=vec3f(1), vec3f falloff=vec3f(1, 0, 0))
set the light source parameters
Definition: glvertex_core.h:4219
void lglEnd()
end a series of vertices
Definition: glvertex_core.h:981
4x4 float matrix
Definition: glslmath.h:2752
void lglFog(float density=0.0f, vec4f color=vec4f(1))
specify fog (as defined by OpenGL 1.2)
Definition: glvertex_api.h:160
unsigned int lglSampler3D(std::string sampler, GLuint texid3D, int value=0, bool warn=true)
bind 3D sampler
Definition: glvertex_api.h:708
void lglRotateZ(double angle)
multiply with rotation matrix (rotation about z-axis)
Definition: glvertex_api.h:230
void lglClear(GLuint bits=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
clear color and depth buffer (as defined by OpenGL 1.2)
Definition: glvertex_api.h:144
void lglMultMatrix(const mat4 &matrix)
multiply with matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:70
mat4 lglGetMatrix() const
get the top entry of the matrix stack
Definition: glvertex_core.h:2123
void lglFrustum(double left, double right, double bottom, double top, double nearp, double farp)
multiply with frustum matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:114
void lglLoadIdentity()
load identity matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:62
static GLuint lglLoadGLSLProgram(const char *vertex_shader_file, const char *fragment_shader_file)
compile a GLSL program from a vertex and a fragment shader source file
Definition: glvertex_core.h:3040
void lglClearColor(float w=0, float a=1)
specify clear color (as defined by OpenGL 1.2)
Definition: glvertex_api.h:136
void lglOrtho(double left, double right, double bottom, double top, double nearp=-1, double farp=1)
orthographic projection
Definition: glvertex_core.h:2265
void lglNormal(const vec3f &n)
specify vertex normal attribute (as defined by OpenGL 1.2)
Definition: glvertex_api.h:38
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)
Definition: glvertex_api.h:122
void lglInterlacingMode(lgl_interlacing_enum mode)
change OpenGL state (interlacing mode)
Definition: glvertex_api.h:472
static bool lglGetFog()
check whether or not fogging is enabled
Definition: glvertex_core.h:4717
double getFar()
get far parameter for last projection transformation
Definition: glvertex_core.h:2312
static mat4 lglGetInverseTransposeManip()
get the inverse transpose of the manipulator matrix
Definition: glvertex_core.h:2519
lgl_vendor_enum lglGetVendor()
get OpenGL vendor
Definition: glvertex_api.h:908
unsigned int lglSampler(std::string sampler, int value=0, bool warn=true)
specify GLSL program uniform sampler
Definition: glvertex_api.h:692
static unsigned char * lglReadRGBPixels(int x, int y, int width, int height)
read frame buffer
Definition: glvertex_core.h:4796
lgl_interlacing_enum
interlacing mode enum
Definition: glvertex_core.h:90
void lglEndExport()
end scene export
Definition: glvertex_api.h:888
void lglFatal(std::string e)
generate a non-recoverable error
Definition: glvertex_api.h:936
void lglRender(lglVBO *vbo, const GL *gl=&LGL)
render vbo (by copying the global state)
Definition: glvertex_api.h:832
mat4 lglGetInverseTransposeModelMatrix()
get the inverse transpose of the vbo modeling matrix
Definition: glvertex_api.h:344
unsigned int lglSampler2D(std::string sampler, GLuint texid2D, int value=0, bool warn=true)
bind a 2D sampler for the actual compiled GLSL program
Definition: glvertex_core.h:3958
void lglTexture2D(GLuint texid, bool owner=false)
bind 2D texture
Definition: glvertex_api.h:768
static bool lglGetRGBAWrite()
get the RGBA write mask
Definition: glvertex_core.h:4400
void lglRotateX(double angle)
multiply with rotation matrix (rotation about x-axis)
Definition: glvertex_api.h:222
void lglEnableViewCulling(int minsize=0)
enable view culling
Definition: glvertex_api.h:876
static std::string lglPlainGLSLFragmentShader()
get the LGL plain GLSL fragment shader
Definition: glvertex_core.h:2680
void lglGetMaterialParameters(vec3f &ka, vec3f &kd, vec3f &ks, float &exponent)
get material parameters
Definition: glvertex_api.h:763
void lglColoring(bool on)
enable or disable the vertex color attributes contained in vbo
Definition: glvertex_core.h:3353
void lglRotate(double angle, const vec3 &v)
rotate in immediate mode fashion
Definition: glvertex_core.h:2234
static std::string lglGetError()
get a description of the last occured error
Definition: glvertex_core.h:5107
lgl_matrixmode_enum lglGetMatrixMode()
get actual matrix mode
Definition: glvertex_api.h:190
mat4 lglGetTexMatrix()
get the vbo texturing matrix
Definition: glvertex_api.h:356
void lglPerspective(double fovy, double aspect, double nearp, double farp)
perspective projection
Definition: glvertex_core.h:2283
std::string lglPlainGLSLFragmentShader()
get the LGL plain GLSL fragment shader
Definition: glvertex_api.h:496
void lglDepthTest(bool on=false)
change OpenGL state (depth test)
Definition: glvertex_api.h:388
2D float vector
Definition: glslmath.h:261
void lglCloneState(const lgl *vbo)
clone state from vbo (coloring, lighting and texturing)
Definition: glvertex_core.h:4341
static void lglPolygonMode(lgl_polygonmode_enum mode)
specify the polygon mode
Definition: glvertex_core.h:4749
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 the light parameters
Definition: glvertex_core.h:4182
unsigned int lglUniformf(std::string uniform, double value, bool warn=true)
specify a uniform for the actual compiled GLSL program (float)
Definition: glvertex_core.h:3507
void lglScale(const vec4 &c)
scale in immediate mode fashion
Definition: glvertex_core.h:2202
bool lglGetBlending()
get OpenGL state (blending)
Definition: glvertex_api.h:408
double getFar()
get far parameter for last projection transformation
Definition: glvertex_api.h:266
unsigned int lglUniformi(std::string uniform, int value, bool warn=true)
specify a uniform for the actual compiled GLSL program (integer)
Definition: glvertex_core.h:3458
void lglDisableTexturing(bool off)
entirely disable texture coordinates
Definition: glvertex_api.h:828
3D double vector
Definition: glslmath.h:372
2x2 double matrix
Definition: glslmath.h:1130
void lglLightPosition(vec3f light=vec3f(0, 0, 0), bool camera_light=true)
set light position
Definition: glvertex_api.h:724
static GLuint lglLinkGLSLProgram(GLuint vertex_shader_id, GLuint fragment_shader_id, GLuint custom_shader_program=0)
link GLSL program
Definition: glvertex_core.h:2939
static void lglZWrite(bool on=true)
specify the depth write mask
Definition: glvertex_core.h:4408
static void lglManip(bool on=true)
enable or disable the manipulator matrix
Definition: glvertex_core.h:2443
void lglBegin(lgl_primitive_enum primitive)
begin vertex series (as defined by OpenGL 1.2)
Definition: glvertex_api.h:18
4x4 double matrix
Definition: glslmath.h:2116
void lglLightSourceParameters(vec3f Ia=vec3f(1), vec3f Id=vec3f(1), vec3f Is=vec3f(1), vec3f falloff=vec3f(1, 0, 0))
set light source parameters
Definition: glvertex_api.h:748
void lglTranslate(const vec4 &v)
multiply with translation matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:94
double getFovy()
get fovy parameter for last projection transformation
Definition: glvertex_core.h:2294
void lglBackFaceCulling(bool on=true)
change OpenGL state (back-face culling)
Definition: glvertex_api.h:396
void lglLoadIdentity()
load the identity matrix in immediate mode fashion
Definition: glvertex_core.h:1993
mat4 lglGetInverseTransposeModelViewMatrix() const
get the inverse transpose of the actual modelview matrix
Definition: glvertex_core.h:2177
bool lglGetLighting() const
check for lighting
Definition: glvertex_core.h:3389
static void lglComplementaryInterlacingMode(lgl_interlacing_enum mode)
specify the complementary interlacing mode
Definition: glvertex_core.h:4775
void lglError(std::string e)
generate an error message
Definition: glvertex_api.h:928
static void lglBackFaceCulling(bool on=true)
enable or disable back-face culling
Definition: glvertex_core.h:4454
GLuint lglCompileGLSLVertexShader(std::string shader)
compile GLSL vertex shader
Definition: glvertex_api.h:512
GLuint lglCompileGLSLFragmentShader(std::string shader)
compile GLSL fragment shader
Definition: glvertex_api.h:516
std::string lglPlainGLSLVertexShader()
get the LGL plain GLSL vertex shader
Definition: glvertex_api.h:492
GLuint lglGetTexture2D()
get 2D texture
Definition: glvertex_api.h:772
void lglModel(const mat4 &model)
set the vbo modeling matrix
Definition: glvertex_api.h:336
bool lglGetAlphaTest()
get OpenGL state (alpha test)
Definition: glvertex_api.h:420
4D float vector
Definition: glslmath.h:961
void lglGetMaterialParameters(vec3f &ka, vec3f &kd, vec3f &ks, float &exponent) const
get the material parameters
Definition: glvertex_core.h:4255
bool lglGetColoring() const
check for coloring
Definition: glvertex_core.h:3368
static void lglBeginRayCast(vec3 origin, vec3 direction, double mindist=0)
begin ray casting in view coordinates
Definition: glvertex_core.h:4952
static bool lglSupportsGLSL()
check for GLSL support
Definition: glvertex_core.h:2648
void lglCopyUniforms(const lgl *vbo, bool warn=false)
copy uniforms from vbo
Definition: glvertex_core.h:4051
static void lglDisableViewCulling()
disable view culling
Definition: glvertex_core.h:4998
void lglCopyUniforms(const GL *gl, bool warn=false)
copy uniforms from vbo
Definition: glvertex_api.h:848
LGL core.
Definition: glvertex_core.h:156
void lglMatrixMode(lgl_matrixmode_enum mode=LGL_MODELVIEW)
specify matrix mode (as defined by OpenGL 1.2)
Definition: glvertex_api.h:58
static void lglMessage(std::string m)
generate a status message
Definition: glvertex_core.h:5658
static bool lglGetBackFaceCulling()
check whether or not back-face culling is enabled
Definition: glvertex_core.h:4471
lgl_texgenmode_enum lglGetTexCoordGen()
check whether or not texture coordinate generation is enabled
Definition: glvertex_core.h:4335
GLuint lglGetTexture3D()
get 3D texture
Definition: glvertex_api.h:780
lgl_blendmode_enum
blend mode enum
Definition: glvertex_core.h:70
static bool lglGetBlending()
check whether or not blending is enabled
Definition: glvertex_core.h:4561
static vec4f lglGetFogColor()
get the actual fog color
Definition: glvertex_core.h:4729
mat4 lglGetModelViewProjectionMatrix() const
get the combined modelview and projection matrix
Definition: glvertex_core.h:2184
void lglTranslate(const vec4 &v)
translate in immediate mode fashion
Definition: glvertex_core.h:2221
static void lglDeleteGLSLShader(GLuint shader_id)
delete a compiled GLSL shader
Definition: glvertex_core.h:3146
bool lglGetAlphaTestGreater()
get OpenGL state (alpha test comparison mode)
Definition: glvertex_api.h:428
static int lglGetGLSLVersion()
get the GLSL version
Definition: glvertex_core.h:5074
static void lglEndExport()
end scene export
Definition: glvertex_core.h:5038
static std::string lglBasicGLSLFragmentShader(bool colors=false, bool normals=false, bool texcoords=false, bool tex3D=false)
get the LGL default fragment shader
Definition: glvertex_core.h:2740
unsigned int lglUniformi(std::string uniform, int value)
specify GLSL program uniform (integer)
Definition: glvertex_api.h:584
bool lglGetAlphaTestEqual()
get OpenGL state (alpha test equality mode)
Definition: glvertex_api.h:432
unsigned int lglUniformfv(std::string uniform, const vec2f &value, bool warn=true)
specify a uniform for the actual compiled GLSL program (vec2f)
Definition: glvertex_core.h:3556
static void lglVerbosity(lgl_verbosity_enum v)
change verbosity level
Definition: glvertex_core.h:5690
static void lglBlendMode(lgl_blendmode_enum mode=LGL_BLEND_NONE)
enable or disable blending
Definition: glvertex_core.h:4479
static float lglGetAlphaTestValue()
get the actual alpha test comparison value
Definition: glvertex_core.h:4629
vec3 getUp()
get up vector for last lookat transformation
Definition: glvertex_api.h:296
GLuint lglGetProgram()
get actual GLSL program
Definition: glvertex_api.h:568
lgl_texgenmode_enum lglGetTexCoordGen()
check for texture coordinate generation
Definition: glvertex_api.h:792
virtual void lglRender(const lgl *vbo=NULL)
render the series of vertices contained in vbo
Definition: glvertex_core.h:1079
void lglTexture3D(GLuint texid, bool owner=false)
bind 3D texture
Definition: glvertex_api.h:776
void lglPerspective(double fovy, double aspect, double nearp, double farp)
multiply with perspective matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:118
mat4 lglGetProjectionMatrix()
get actual projection matrix
Definition: glvertex_api.h:198
static void lglInitializeOpenGL(float r=0, float g=0, float b=0, float a=1, bool ztest=true, bool culling=false)
initialize the OpenGL state (clear color, depth test, back-face culling)
Definition: glvertex_core.h:4358
static GLuint lglCompileGLSLFragmentShader(std::string shader)
compile GLSL fragment shader
Definition: glvertex_core.h:2893
mat4 lglGetInverseTransposeManip()
get the inverse transpose of the manipulator matrix
Definition: glvertex_api.h:332
int lglMapGL2GLSLVersion(int glversion)
map gl version to glsl version
Definition: glvertex_api.h:896
bool lglGetColoring()
check for coloring
Definition: glvertex_api.h:800
static void lglFatal(std::string e)
generate a non-recoverable error
Definition: glvertex_core.h:5683
void lglTex(const mat4 &tex)
set the vbo texturing matrix
Definition: glvertex_api.h:348
void lglLighting(bool on)
enable or disable the vertex normal attributes contained in vbo
Definition: glvertex_core.h:3374
std::string lglGetError()
get error string (as defined by OpenGL 1.2)
Definition: glvertex_api.h:172
bool lglGetTexturing()
check for texturing
Definition: glvertex_api.h:816
GLuint lglCompileGLSLProgram(std::string vertex_shader, std::string fragment_shader)
compile GLSL program
Definition: glvertex_api.h:524
void lglParallel(const vec3 &p, const vec3 &n, const vec3 &d)
parallel projection
Definition: glvertex_core.h:2277
static void lglBeginExport(void(*callback)(lgl *vbo, void *data), void *data, mat4 matrix=mat4(1))
begin scene export
Definition: glvertex_core.h:5007
void lglRotateZ(double angle)
rotate about z-axis in immediate mode fashion
Definition: glvertex_core.h:2259
mat4 lglGetProjectionMatrix() const
get the actual projection matrix
Definition: glvertex_core.h:2140
static mat4 lglGetManip()
get the manipulator matrix
Definition: glvertex_core.h:2507
void lglReuseProgram(GLuint program)
reuse a compiled GLSL program /wo clearing and updating uniforms
Definition: glvertex_core.h:3256
void lglDeleteGLSLShader(GLuint shader_id)
delete GLSL shader
Definition: glvertex_api.h:548
void lglTexture2D(GLuint texid, bool owner=false)
bind a 2D texture for the default GLSL program
Definition: glvertex_core.h:4266
LGL API: vbo class definition.
Definition: glvertex_core.h:5827
void lglReplaceDefaultProgram(GLuint program, bool colors=false, bool normals=true, bool texcoords=false, bool tex3D=false)
replace default GLSL program
Definition: glvertex_api.h:564
void lglPushMatrix()
push the top entry of the matrix stack
Definition: glvertex_core.h:2069
static void lglLineWidth(float width=1.0f)
specify the line rasterization width
Definition: glvertex_core.h:4735
lgl_blendmode_enum lglGetBlendMode()
get OpenGL state (blend mode)
Definition: glvertex_api.h:412
3x3 double matrix
Definition: glslmath.h:1544
void lglTexCoord(const vec4f &t)
specify vertex texture coordinate attribute (as defined by OpenGL 1.2)
Definition: glvertex_api.h:46
void lglClipPlane(vec4 equation=vec4(0, 0, 0, 0), unsigned int n=0, bool camera_plane=false)
specify a clip plane as supported by the default GLSL program
Definition: glvertex_core.h:4647
std::string lglPlainGLSLProgram()
get the combined LGL plain GLSL program
Definition: glvertex_api.h:500
void lglParallel(const vec3 &p, const vec3 &n, const vec3 &d)
multiply with parallel projection matrix
Definition: glvertex_api.h:234
unsigned int lglUniform(std::string uniform, bool warn=true)
specify a uniform for the actual compiled GLSL program (undefined)
Definition: glvertex_core.h:3434
static std::string lglPlainGLSLProgram()
get the combined LGL plain GLSL program
Definition: glvertex_core.h:2687
static lgl_blendmode_enum lglGetBlendMode()
get the actual blending mode
Definition: glvertex_core.h:4569
lgl_texgenmode_enum
texgen mode enum
Definition: glvertex_core.h:56
static std::string lglGetRenderer()
get the OpenGL renderer
Definition: glvertex_core.h:5080
void lglLightVector(vec4f light=vec4f(0, 0, 1, 0), bool camera_light=true)
set light vector
Definition: glvertex_api.h:728
vec4 lglGetColor() const
get the actual color attribute
Definition: glvertex_core.h:844
void lglFrustum(double left, double right, double bottom, double top, double nearp, double farp)
frustum projection
Definition: glvertex_core.h:2271
static float lglGetFogDensity()
get the actual fog density
Definition: glvertex_core.h:4723
void lglBegin(lgl_primitive_enum primitive)
begin a series of vertices for a particular graphics primitive
Definition: glvertex_core.h:917
vec3 getUp() const
get up vector for last lookat transformation
Definition: glvertex_core.h:2348
static lgl_polygonmode_enum lglGetPolygonMode()
get the actual polygon mode
Definition: glvertex_core.h:4763
void lglZWrite(bool on=true)
change OpenGL state (depth write)
Definition: glvertex_api.h:380
void lglLoadMatrix(const mat4 &matrix)
load matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:66
lgl_interlacing_enum lglGetInterlacingMode()
get OpenGL state (interlacing mode)
Definition: glvertex_api.h:480
vec4 lglGetClipPlaneEquation(unsigned int n=0)
get OpenGL state (clip plane equation)
Definition: glvertex_api.h:440
void lglPushMatrix()
push matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:74
static void lglResetManip()
reset the manipulator matrix
Definition: glvertex_core.h:2499
void lglRotateX(double angle)
rotate about x-axis in immediate mode fashion
Definition: glvertex_core.h:2247
void lglView(const vec3 &eye, const vec3 &at, const vec3 &up=vec3(0, 1, 0))
set the actual modelview matrix
Definition: glvertex_core.h:2407
mat4 scale(const mat4 &m, const vec4 &c)
inline scale
Definition: glslmath.h:2591
void lglDisableViewCulling()
disable view culling
Definition: glvertex_api.h:880
mat4 lglGetTextureMatrix()
get texture matrix
Definition: glvertex_api.h:218
float lglGetAlphaTestValue()
get OpenGL state (alpha test value)
Definition: glvertex_api.h:424
static lgl_vendor_enum lglGetVendor()
get the OpenGL vendor
Definition: glvertex_core.h:5087
void lglModel()
reset the vbo modeling matrix
Definition: glvertex_core.h:2525
3x3 float matrix
Definition: glslmath.h:1939
void lglDisableColoring(bool off)
entirely disable vertex colors
Definition: glvertex_api.h:820
void lglPrintUniforms()
print GLSL uniforms
Definition: glvertex_api.h:716
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
Definition: glvertex_api.h:360
mat4 lglGetModelMatrix() const
get the vbo modeling matrix
Definition: glvertex_core.h:2539
double getAspect()
get aspect parameter for last projection transformation
Definition: glvertex_api.h:258
void lglScale(const vec4 &c)
multiply with scale matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:82
bool lglGetZWrite()
get OpenGL state (depth write)
Definition: glvertex_api.h:384
mat4 lglGetTexMatrix() const
get the vbo texturing matrix
Definition: glvertex_core.h:2597
bool lglGetDepthTest()
get OpenGL state (depth test)
Definition: glvertex_api.h:392
static bool lglIsManipApplied()
is the manipulator matrix applied?
Definition: glvertex_core.h:2513
bool lglGetRGBAWrite()
get OpenGL state (rgba write)
Definition: glvertex_api.h:376
void lglLighting(bool on)
enable lighting
Definition: glvertex_api.h:804
mat4 lglGetInverseTransposeModelViewMatrix()
get inverse transpose of modelview matrix
Definition: glvertex_api.h:210
float lglGetLineWidth()
get OpenGL state (line width)
Definition: glvertex_api.h:460
static void lglDisableColoring(bool off)
entirely disable vertex colors
Definition: glvertex_core.h:3416
GLuint lglGetActiveProgram() const
get the actual GLSL program in use
Definition: glvertex_core.h:3282
static bool lglGetAlphaTestEqual()
get the actual alpha test equality mode
Definition: glvertex_core.h:4641
unsigned int lglSampler(std::string sampler, int value=0, bool warn=true)
specify a uniform sampler for the actual compiled GLSL program
Definition: glvertex_core.h:3946
void lglLoadMatrix(const mat4 &matrix)
load a specific matrix in immediate mode fashion
Definition: glvertex_core.h:2019
static bool lglGetAlphaTest()
check whether or not alpha testing is enabled
Definition: glvertex_core.h:4613
unsigned int lglSampler3D(std::string sampler, GLuint texid3D, int value=0, bool warn=true)
bind a 3D sampler for the actual compiled GLSL program
Definition: glvertex_core.h:3993
static lgl * lglEndRayCast()
end ray casting
Definition: glvertex_core.h:4978
vec3 getLookAt() const
get lookat point for last lookat transformation
Definition: glvertex_core.h:2342
void lglRotateY(double angle)
multiply with rotation matrix (rotation about y-axis)
Definition: glvertex_api.h:226
void lglVertex(const vec4 &v)
specify vertex (as defined by OpenGL 1.2)
Definition: glvertex_api.h:22
std::string lglCombineGLSLProgram(const std::string &vertex_shader, const std::string &fragment_shader)
combine GLSL program
Definition: glvertex_api.h:532
void lglTexturing(bool on)
enable or disable the vertex texture coordinate attributes contained in vbo
Definition: glvertex_core.h:3395
void lglLookAt(const vec3 &eye, const vec3 &at, const vec3 &up=vec3(0, 1, 0))
lookat transformation
Definition: glvertex_core.h:2318
mat4 lglGetInverseModelViewMatrix()
get inverse of modelview matrix
Definition: glvertex_api.h:206
static bool lglGetAlphaTestGreater()
get the actual alpha test comparison mode
Definition: glvertex_core.h:4635
void lglRayCast(lglVBO *vbo)
cast a ray and intersect it with the transformed triangles contained in the vbo
Definition: glvertex_api.h:864
static void lglDisableTexturing(bool off)
entirely disable texture coordinates
Definition: glvertex_core.h:3428
static bool lglSplitGLSLProgram(std::string shader, std::string &vertex_shader, std::string &fragment_shader)
split GLSL program
Definition: glvertex_core.h:3070
static vec4 lglGetClipPlaneEquation(unsigned int n=0)
get the actual clip plane equation
Definition: glvertex_core.h:4691
mat4 lglGetModelMatrix()
get the vbo modeling matrix
Definition: glvertex_api.h:340
void lglGetLightParameters(vec3f &ka, vec3f &kd, vec3f &ks, vec3f &Ia, vec3f &Id, vec3f &Is, float &exponent, vec3f &falloff)
get light parameters
Definition: glvertex_api.h:742
static void lglWarning(std::string w)
generate a warning message
Definition: glvertex_core.h:5674
static bool lglGetClipPlane(unsigned int n=0)
check whether or not a clip plane is enabled
Definition: glvertex_core.h:4682
void lglReplaceDefaultProgram(GLuint program, bool colors=false, bool normals=true, bool texcoords=false, bool tex3D=false)
replace default GLSL program
Definition: glvertex_core.h:3222
vec4 lglGetColor()
get actual color
Definition: glvertex_api.h:178
static void lglInterlacingMode(lgl_interlacing_enum mode)
specify the interlacing mode
Definition: glvertex_core.h:4769
bool lglGetLighting()
check for lighting
Definition: glvertex_api.h:808
lgl_polygonmode_enum lglGetPolygonMode()
get OpenGL state (polygon mode)
Definition: glvertex_api.h:468
std::string lglGetGLSLVersionString()
get GLSL version string
Definition: glvertex_api.h:488
void lglLightDirection(vec3f light=vec3f(0, 0, 1), bool camera_light=true)
set the light direction
Definition: glvertex_core.h:4139
unsigned int lglUniformf(std::string uniform, double value)
specify GLSL program uniform (float)
Definition: glvertex_api.h:592
void lglTexCoordGen(lgl_texgenmode_enum mode=LGL_TEXGEN_LINEAR)
enable texture coordinate generation
Definition: glvertex_api.h:788
void lglRotateY(double angle)
rotate about y-axis in immediate mode fashion
Definition: glvertex_core.h:2253
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
Definition: glvertex_api.h:736
GLuint lglLinkGLSLProgram(GLuint vertex_shader_id, GLuint fragment_shader_id, GLuint custom_shader_program=0)
link GLSL program
Definition: glvertex_api.h:520
static std::string lglGetWarning()
get a description of the last occured warning
Definition: glvertex_core.h:5131
static std::string lglBasicGLSLVertexShader(bool colors=false, bool normals=false, bool texcoords=false)
get the LGL default vertex shader
Definition: glvertex_core.h:2693
void lglPrintUniforms()
print GLSL uniforms
Definition: glvertex_core.h:4078
static int lglMapGL2GLSLVersion(int glversion)
map gl version to glsl version
Definition: glvertex_core.h:5050
GLuint lglGetProgram() const
get the actual custom GLSL program in use
Definition: glvertex_core.h:3242
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 the lighting parameters as supported by the default GLSL program
Definition: glvertex_core.h:4129
mat4 lglGetModelViewMatrix()
get actual modelview matrix
Definition: glvertex_api.h:202
mat4 lglGetModelViewMatrix() const
get the actual modelview matrix
Definition: glvertex_core.h:2151