glVertex  5.5.2
glvertex_api.h
Go to the documentation of this file.
1 // (c) by Stefan Roettger, licensed under MIT license
2 
5 #ifndef GLVERTEX_API_H
6 #define GLVERTEX_API_H
7 
8 #include "glvertex_core.h"
9 
10 #include <time.h> // for seed
11 
12 static GL LGL; // LGL immediate mode singleton
13 inline GL *getGL() {return(&LGL);}
14 
15 // legacy OpenGL API (as specified by OpenGL 1.2):
16 
18 inline void lglBegin(lgl_primitive_enum primitive)
19  {LGL.lglBegin(primitive);}
20 
22 inline void lglVertex(const vec4 &v)
23  {LGL.lglVertex(v);}
24 
26 inline void lglVertex(double x, double y, double z, double w = 1)
27  {LGL.lglVertex(x,y,z,w);}
28 
30 inline void lglColor(const vec4f &c)
31  {LGL.lglColor(c);}
32 
34 inline void lglColor(float r, float g, float b, float a = 1)
35  {LGL.lglColor(r,g,b,a);}
36 
38 inline void lglNormal(const vec3f &n)
39  {LGL.lglNormal(n);}
40 
42 inline void lglNormal(float x, float y, float z)
43  {LGL.lglNormal(x,y,z);}
44 
46 inline void lglTexCoord(const vec4f &t)
47  {LGL.lglTexCoord(t);}
48 
50 inline void lglTexCoord(float s, float t = 0, float r = 0, float w = 1)
51  {LGL.lglTexCoord(s,t,r,w);}
52 
54 inline void lglEnd()
55  {LGL.lglEnd();}
56 
58 inline void lglMatrixMode(lgl_matrixmode_enum mode = LGL_MODELVIEW)
59  {LGL.lglMatrixMode(mode);}
60 
62 inline void lglLoadIdentity()
63  {LGL.lglLoadIdentity();}
64 
66 inline void lglLoadMatrix(const mat4 &matrix)
67  {LGL.lglLoadMatrix(matrix);}
68 
70 inline void lglMultMatrix(const mat4 &matrix)
71  {LGL.lglMultMatrix(matrix);}
72 
74 inline void lglPushMatrix()
75  {LGL.lglPushMatrix();}
76 
78 inline void lglPopMatrix()
79  {LGL.lglPopMatrix();}
80 
82 inline void lglScale(const vec4 &c)
83  {LGL.lglScale(c);}
84 
86 inline void lglScale(double s, double t, double r, double w = 1)
87  {LGL.lglScale(s,t,r,w);}
88 
90 inline void lglScale(double s, double w = 1)
91  {LGL.lglScale(s,w);}
92 
94 inline void lglTranslate(const vec4 &v)
95  {LGL.lglTranslate(v);}
96 
98 inline void lglTranslate(double x, double y, double z, double w = 1)
99  {LGL.lglTranslate(x,y,z,w);}
100 
102 inline void lglRotate(double angle, const vec3 &v)
103  {LGL.lglRotate(angle, v);}
104 
106 inline void lglRotate(double angle, double vx, double vy, double vz)
107  {LGL.lglRotate(angle, vx,vy,vz);}
108 
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);}
112 
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);}
116 
118 inline void lglPerspective(double fovy, double aspect, double nearp, double farp)
119  {LGL.lglPerspective(fovy, aspect, nearp, farp);}
120 
122 inline void lglLookAt(const vec3 &eye, const vec3 &at, const vec3 &up = vec3(0,1,0))
123  {LGL.lglLookAt(eye, at, up);}
124 
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);}
130 
132 inline void lglViewport(int ax, int ay, int bx, int by)
133  {LGL.lglViewport(ax, ay, bx, by);}
134 
136 inline void lglClearColor(float w=0, float a=1)
137  {LGL.lglClearColor(w,w,w,a);}
138 
140 inline void lglClearColor(float r, float g, float b, float a=1)
141  {LGL.lglClearColor(r,g,b,a);}
142 
144 inline void lglClear(GLuint bits = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
145  {LGL.lglClear(bits);}
146 
148 inline void lglClipPlane(vec4 equation = vec4(0,0,0,0), unsigned int n = 0, bool camera_plane = false)
149  {LGL.lglClipPlane(equation, n, camera_plane);}
150 
152 inline void lglClipPlane(double a, double b, double c, double d, unsigned int n = 0, bool camera_plane = false)
153  {LGL.lglClipPlane(a, b, c, d, n, camera_plane);}
154 
156 inline void lglClipPlane(vec3 point, vec3 normal, unsigned int n = 0, bool camera_plane = false)
157  {LGL.lglClipPlane(point, normal, n, camera_plane);}
158 
160 inline void lglFog(float density = 0.0f, vec4f color = vec4f(1))
161  {LGL.lglFog(density, color);}
162 
164 inline void lglLineWidth(float width = 1.0f)
165  {LGL.lglLineWidth(width);}
166 
169  {LGL.lglPolygonMode(mode);}
170 
172 inline std::string lglGetError()
173  {return(LGL.lglGetError());}
174 
175 // extended OpenGL API:
176 
179  {return(LGL.lglGetColor());}
180 
182 inline void lglAttribute(const vec4f &a, unsigned int n = 0)
183  {LGL.lglAttribute(a,n);}
184 
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);}
188 
191  {return(LGL.lglGetMatrixMode());}
192 
195  {return(LGL.lglGetMatrix());}
196 
199  {return(LGL.lglGetProjectionMatrix());}
200 
203  {return(LGL.lglGetModelViewMatrix());}
204 
207  {return(LGL.lglGetInverseModelViewMatrix());}
208 
212 
215  {return(LGL.lglGetModelViewProjectionMatrix());}
216 
219  {return(LGL.lglGetTextureMatrix());}
220 
222 inline void lglRotateX(double angle)
223  {LGL.lglRotateX(angle);}
224 
226 inline void lglRotateY(double angle)
227  {LGL.lglRotateY(angle);}
228 
230 inline void lglRotateZ(double angle)
231  {LGL.lglRotateZ(angle);}
232 
234 inline void lglParallel(const vec3 &p,const vec3 &n,const vec3 &d)
235  {LGL.lglParallel(p, n, d);}
236 
238 inline void lglProjection()
239  {LGL.lglProjection();}
240 
242 inline void lglProjection(const mat4 &projection)
243  {LGL.lglProjection(projection);}
244 
246 inline void lglProjection(double left, double right, double bottom, double top, double nearp, double farp)
247  {LGL.lglProjection(left, right, bottom, top, nearp, farp);}
248 
250 inline void lglProjection(double fovy, double aspect, double nearp, double farp)
251  {LGL.lglProjection(fovy, aspect, nearp, farp);}
252 
254 inline double getFovy()
255  {return(LGL.getFovy());}
256 
258 inline double getAspect()
259  {return(LGL.getAspect());}
260 
262 inline double getNear()
263  {return(LGL.getNear());}
264 
266 inline double getFar()
267  {return(LGL.getFar());}
268 
270 inline void lglModelView()
271  {LGL.lglModelView();}
272 
274 inline void lglModelView(const mat4 &modelview)
275  {LGL.lglModelView(modelview);}
276 
278 inline void lglView(const vec3 &eye, const vec3 &at, const vec3 &up = vec3(0,1,0))
279  {LGL.lglView(eye, at, up);}
280 
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);}
286 
288 inline vec3 getEye()
289  {return(LGL.getEye());}
290 
292 inline vec3 getLookAt()
293  {return(LGL.getLookAt());}
294 
296 inline vec3 getUp()
297  {return(LGL.getUp());}
298 
300 inline void lglManip(bool on = true)
301  {LGL.lglManip(on);}
302 
304 inline void lglManip(const mat4 &manip)
305  {LGL.lglManip(manip);}
306 
308 inline void lglManip(double focus, double angle, double tilt, double zoom)
309  {LGL.lglManip(focus, angle, tilt, zoom);}
310 
312 inline void lglManip(double dx, double dy, double zoom = 1)
313  {LGL.lglManip(dx, dy, zoom);}
314 
316 inline void lglManip(vec2 delta, double zoom = 1)
317  {LGL.lglManip(delta, zoom);}
318 
320 inline void lglResetManip()
321  {LGL.lglResetManip();}
322 
325  {return(LGL.lglGetManip());}
326 
328 inline bool lglIsManipApplied()
329  {return(LGL.lglIsManipApplied());}
330 
333  {return(LGL.lglGetInverseTransposeManip());}
334 
336 inline void lglModel(const mat4 &model)
337  {LGL.lglModel(model);}
338 
341  {return(LGL.lglGetModelMatrix());}
342 
345  {return(LGL.lglGetInverseTransposeModelMatrix());}
346 
348 inline void lglTex(const mat4 &tex)
349  {LGL.lglTex(tex);}
350 
352 inline void lglTex(const vec4 &scale, const vec4 &offset)
353  {LGL.lglTex(scale, offset);}
354 
357  {return(LGL.lglGetTexMatrix());}
358 
360 inline void lglLight(vec4f light = vec4f(0,0,1,0), bool camera_light = true,
361  vec3f ka = vec3f(0.1f), vec3f kd = vec3f(0.7f), vec3f ks = vec3f(0.2f),
362  vec3f Ia = vec3f(1), vec3f Id = vec3f(1), vec3f Is = vec3f(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);}
365 
367 inline void lglInitializeOpenGL(float r=0, float g=0, float b=0, float a=1,
368  bool ztest = true, bool culling = false)
369  {LGL.lglInitializeOpenGL(r,g,b,a, ztest, culling);}
370 
372 inline void lglRGBAWrite(bool r = true, bool g = true, bool b = true, bool a = true)
373  {LGL.lglRGBAWrite(r,g,b,a);}
374 
376 inline bool lglGetRGBAWrite()
377  {return(LGL.lglGetRGBAWrite());}
378 
380 inline void lglZWrite(bool on = true)
381  {LGL.lglZWrite(on);}
382 
384 inline bool lglGetZWrite()
385  {return(LGL.lglGetZWrite());}
386 
388 inline void lglDepthTest(bool on = false)
389  {LGL.lglDepthTest(on);}
390 
392 inline bool lglGetDepthTest()
393  {return(LGL.lglGetDepthTest());}
394 
396 inline void lglBackFaceCulling(bool on = true)
397  {LGL.lglBackFaceCulling(on);}
398 
401  {return(LGL.lglGetBackFaceCulling());}
402 
405  {LGL.lglBlendMode(mode);}
406 
408 inline bool lglGetBlending()
409  {return(LGL.lglGetBlending());}
410 
413  {return(LGL.lglGetBlendMode());}
414 
416 inline void lglAlphaTest(bool on = false, float value = 0.0f, bool greater = true, bool equal = false)
417  {LGL.lglAlphaTest(on, value, greater, equal);}
418 
420 inline bool lglGetAlphaTest()
421  {return(LGL.lglGetAlphaTest());}
422 
424 inline float lglGetAlphaTestValue()
425  {return(LGL.lglGetAlphaTestValue());}
426 
429  {return(LGL.lglGetAlphaTestGreater());}
430 
432 inline bool lglGetAlphaTestEqual()
433  {return(LGL.lglGetAlphaTestEqual());}
434 
436 inline bool lglGetClipPlane(unsigned int n = 0)
437  {return(LGL.lglGetClipPlane(n));}
438 
440 inline vec4 lglGetClipPlaneEquation(unsigned int n = 0)
441  {return(LGL.lglGetClipPlaneEquation(n));}
442 
444 inline vec4 lglGetClipPlaneEquation(vec3 point, vec3 normal)
445  {return(LGL.lglGetClipPlaneEquation(point, normal));}
446 
448 inline bool lglGetFog()
449  {return(LGL.lglGetFog());}
450 
452 inline float lglGetFogDensity()
453  {return(LGL.lglGetFogDensity());}
454 
457  {return(LGL.lglGetFogColor());}
458 
460 inline float lglGetLineWidth()
461  {return(LGL.lglGetLineWidth());}
462 
464 inline void lglTogglePolygonMode()
465  {LGL.lglTogglePolygonMode();}
466 
469  {return(LGL.lglGetPolygonMode());}
470 
473  {LGL.lglInterlacingMode(mode);}
474 
478 
481  {return(LGL.lglGetInterlacingMode());}
482 
484 inline GLuint lglSupportsGLSL()
485  {return(LGL.lglSupportsGLSL());}
486 
488 inline std::string lglGetGLSLVersionString()
489  {return(LGL.lglGetGLSLVersionString());}
490 
492 inline std::string lglPlainGLSLVertexShader()
493  {return(LGL.lglPlainGLSLVertexShader());}
494 
496 inline std::string lglPlainGLSLFragmentShader()
497  {return(LGL.lglPlainGLSLFragmentShader());}
498 
500 inline std::string lglPlainGLSLProgram()
501  {return(LGL.lglPlainGLSLProgram());}
502 
504 inline std::string lglBasicGLSLVertexShader(bool colors = false, bool normals = false, bool texcoords = false)
505  {return(LGL.lglBasicGLSLVertexShader(colors, normals, texcoords));}
506 
508 inline std::string lglBasicGLSLFragmentShader(bool colors = false, bool normals = false, bool texcoords = false, bool tex3D = false)
509  {return(LGL.lglBasicGLSLFragmentShader(colors, normals, texcoords, tex3D));}
510 
512 inline GLuint lglCompileGLSLVertexShader(std::string shader)
513  {return(LGL.lglCompileGLSLVertexShader(shader));}
514 
516 inline GLuint lglCompileGLSLFragmentShader(std::string shader)
517  {return(LGL.lglCompileGLSLFragmentShader(shader));}
518 
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));}
522 
524 inline GLuint lglCompileGLSLProgram(std::string vertex_shader, std::string fragment_shader)
525  {return(LGL.lglCompileGLSLProgram(vertex_shader, fragment_shader));}
526 
528 inline GLuint lglLoadGLSLProgram(const char *vertex_shader_file, const char *fragment_shader_file)
529  {return(LGL.lglLoadGLSLProgram(vertex_shader_file, fragment_shader_file));}
530 
532 inline std::string lglCombineGLSLProgram(const std::string &vertex_shader, const std::string &fragment_shader)
533  {return(LGL.lglCombineGLSLProgram(vertex_shader, fragment_shader));}
534 
536 inline bool lglSplitGLSLProgram(std::string shader, std::string &vertex_shader, std::string &fragment_shader)
537  {return(LGL.lglSplitGLSLProgram(shader, vertex_shader, fragment_shader));}
538 
540 inline GLuint lglCompileGLSLProgram(std::string shader)
541  {return(LGL.lglCompileGLSLProgram(shader));}
542 
544 inline GLuint lglLoadGLSLProgram(const char *shader_file)
545  {return(LGL.lglLoadGLSLProgram(shader_file));}
546 
548 inline void lglDeleteGLSLShader(GLuint shader_id)
549  {LGL.lglDeleteGLSLShader(shader_id);}
550 
552 inline void lglDeleteGLSLProgram(GLuint program)
553  {LGL.lglDeleteGLSLProgram(program);}
554 
556 inline void lglUseProgram(GLuint program, bool clear = true)
557  {LGL.lglUseProgram(program, clear);}
558 
560 inline void lglUseDefaultProgram(bool clear = true)
561  {LGL.lglUseDefaultProgram(clear);}
562 
564 inline void lglReplaceDefaultProgram(GLuint program, bool colors = false, bool normals = true, bool texcoords = false, bool tex3D = false)
565  {LGL.lglReplaceDefaultProgram(program, colors, normals, texcoords, tex3D);}
566 
568 inline GLuint lglGetProgram()
569  {return(LGL.lglGetProgram());}
570 
572 inline GLuint lglGetActiveProgram()
573  {return(LGL.lglGetActiveProgram());}
574 
576 inline void lglReuseProgram(GLuint program)
577  {LGL.lglReuseProgram(program);}
578 
580 inline unsigned int lglUniform(std::string uniform)
581  {return(LGL.lglUniform(uniform));}
582 
584 inline unsigned int lglUniformi(std::string uniform, int value)
585  {return(LGL.lglUniformi(uniform, value));}
586 
588 inline void lglUniformi(unsigned int index, int value)
589  {LGL.lglUniformi(index, value);}
590 
592 inline unsigned int lglUniformf(std::string uniform, double value)
593  {return(LGL.lglUniformf(uniform, value));}
594 
596 inline void lglUniformf(unsigned int index, double value)
597  {LGL.lglUniformf(index, value);}
598 
600 inline unsigned int lglUniformf(std::string uniform, double x, double y, double z, double w = 1)
601  {return(LGL.lglUniformf(uniform, x, y, z, w));}
602 
604 inline void lglUniformf(unsigned int index, double x, double y, double z, double w = 1)
605  {LGL.lglUniformf(index, x, y, z, w);}
606 
608 inline unsigned int lglUniformfv(std::string uniform, const vec2f &value)
609  {return(LGL.lglUniformfv(uniform, value));}
610 
612 inline void lglUniformfv(unsigned int index, const vec2f &value)
613  {LGL.lglUniformfv(index, value);}
614 
615 inline unsigned int lglUniformfv(std::string uniform, const vec2 &value)
616  {return(LGL.lglUniformfv(uniform, value));}
617 
618 inline void lglUniformfv(unsigned int index, const vec2 &value)
619  {LGL.lglUniformfv(index, value);}
620 
622 inline unsigned int lglUniformfv(std::string uniform, const vec3f &value)
623  {return(LGL.lglUniformfv(uniform, value));}
624 
626 inline void lglUniformfv(unsigned int index, const vec3f &value)
627  {LGL.lglUniformfv(index, value);}
628 
629 inline unsigned int lglUniformfv(std::string uniform, const vec3 &value)
630  {return(LGL.lglUniformfv(uniform, value));}
631 
632 inline void lglUniformfv(unsigned int index, const vec3 &value)
633  {LGL.lglUniformfv(index, value);}
634 
636 inline unsigned int lglUniformfv(std::string uniform, const vec4f &value)
637  {return(LGL.lglUniformfv(uniform, value));}
638 
640 inline void lglUniformfv(unsigned int index, const vec4f &value)
641  {LGL.lglUniformfv(index, value);}
642 
643 inline unsigned int lglUniformfv(std::string uniform, const vec4 &value)
644  {return(LGL.lglUniformfv(uniform, value));}
645 
646 inline void lglUniformfv(unsigned int index, const vec4 &value)
647  {LGL.lglUniformfv(index, value);}
648 
650 inline unsigned int lglUniformfv(std::string uniform, const mat2f &value)
651  {return(LGL.lglUniformfv(uniform, value));}
652 
654 inline void lglUniformfv(unsigned int index, const mat2f &value)
655  {LGL.lglUniformfv(index, value);}
656 
657 inline unsigned int lglUniformfv(std::string uniform, const mat2 &value)
658  {return(LGL.lglUniformfv(uniform, value));}
659 
660 inline void lglUniformfv(unsigned int index, const mat2 &value)
661  {LGL.lglUniformfv(index, value);}
662 
664 inline unsigned int lglUniformfv(std::string uniform, const mat3f &value)
665  {return(LGL.lglUniformfv(uniform, value));}
666 
668 inline void lglUniformfv(unsigned int index, const mat3f &value)
669  {LGL.lglUniformfv(index, value);}
670 
671 inline unsigned int lglUniformfv(std::string uniform, const mat3 &value)
672  {return(LGL.lglUniformfv(uniform, value));}
673 
674 inline void lglUniformfv(unsigned int index, const mat3 &value)
675  {LGL.lglUniformfv(index, value);}
676 
678 inline unsigned int lglUniformfv(std::string uniform, const mat4f &value)
679  {return(LGL.lglUniformfv(uniform, value));}
680 
682 inline void lglUniformfv(unsigned int index, const mat4f &value)
683  {LGL.lglUniformfv(index, value);}
684 
685 inline unsigned int lglUniformfv(std::string uniform, const mat4 &value)
686  {return(LGL.lglUniformfv(uniform, value));}
687 
688 inline void lglUniformfv(unsigned int index, const mat4 &value)
689  {LGL.lglUniformfv(index, value);}
690 
692 inline unsigned int lglSampler(std::string sampler, int value = 0, bool warn = true)
693  {return(LGL.lglSampler(sampler, value, warn));}
694 
696 inline void lglSampler(unsigned int index, int value = 0, bool warn = true)
697  {LGL.lglSampler(index, value, warn);}
698 
700 inline unsigned int lglSampler2D(std::string sampler, GLuint texid2D, int value = 0, bool warn = true)
701  {return(LGL.lglSampler2D(sampler, texid2D, value, warn));}
702 
704 inline void lglSampler2D(unsigned int index, GLuint texid2D, int value = 0, bool warn = true)
705  {LGL.lglSampler2D(index, texid2D, value, warn);}
706 
708 inline unsigned int lglSampler3D(std::string sampler, GLuint texid3D, int value = 0, bool warn = true)
709  {return(LGL.lglSampler3D(sampler, texid3D, value, warn));}
710 
712 inline void lglSampler3D(unsigned int index, GLuint texid3D, int value = 0, bool warn = true)
713  {LGL.lglSampler3D(index, texid3D, value, warn);}
714 
716 inline void lglPrintUniforms()
717  {LGL.lglPrintUniforms();}
718 
720 inline void lglLightDirection(vec3f light = vec3f(0,0,1), bool camera_light = true)
721  {LGL.lglLightDirection(light, camera_light);}
722 
724 inline void lglLightPosition(vec3f light = vec3f(0,0,0), bool camera_light = true)
725  {LGL.lglLightPosition(light, camera_light);}
726 
728 inline void lglLightVector(vec4f light = vec4f(0,0,1,0), bool camera_light = true)
729  {LGL.lglLightVector(light, camera_light);}
730 
733  {return(LGL.lglGetLightVector());}
734 
736 inline void lglLightParameters(vec3f ka = vec3f(0.1f), vec3f kd = vec3f(0.7f), vec3f ks = vec3f(0.2f),
737  vec3f Ia = vec3f(1), vec3f Id = vec3f(1), vec3f Is = vec3f(1),
738  float exponent = 30, vec3f falloff = vec3f(1,0,0))
739  {LGL.lglLightParameters(ka, kd, ks, Ia, Id, Is, exponent, falloff);}
740 
742 inline void lglGetLightParameters(vec3f &ka, vec3f &kd, vec3f &ks,
743  vec3f &Ia, vec3f &Id, vec3f &Is,
744  float &exponent, vec3f &falloff)
745  {LGL.lglGetLightParameters(ka, kd, ks, Ia, Id, Is, exponent, falloff);}
746 
748 inline void lglLightSourceParameters(vec3f Ia = vec3f(1), vec3f Id = vec3f(1), vec3f Is = vec3f(1),
749  vec3f falloff = vec3f(1,0,0))
750  {LGL.lglLightSourceParameters(Ia, Id, Is, falloff);}
751 
753 inline void lglGetLightSourceParameters(vec3f &Ia, vec3f &Id, vec3f &Is,
754  vec3f &falloff)
755  {LGL.lglGetLightSourceParameters(Ia, Id, Is, falloff);}
756 
758 inline void lglMaterialParameters(vec3f ka = vec3f(0.1f), vec3f kd = vec3f(0.7f), vec3f ks = vec3f(0.2f),
759  float exponent = 30)
760  {LGL.lglMaterialParameters(ka, kd, ks, exponent);}
761 
763 inline void lglGetMaterialParameters(vec3f &ka, vec3f &kd, vec3f &ks,
764  float &exponent)
765  {LGL.lglGetMaterialParameters(ka, kd, ks, exponent);}
766 
768 inline void lglTexture2D(GLuint texid, bool owner = false)
769  {LGL.lglTexture2D(texid, owner);}
770 
772 inline GLuint lglGetTexture2D()
773  {return(LGL.lglGetTexture2D());}
774 
776 inline void lglTexture3D(GLuint texid, bool owner = false)
777  {LGL.lglTexture3D(texid, owner);}
778 
780 inline GLuint lglGetTexture3D()
781  {return(LGL.lglGetTexture3D());}
782 
784 inline void lglDeleteTexture()
785  {LGL.lglDeleteTexture();}
786 
788 inline void lglTexCoordGen(lgl_texgenmode_enum mode = LGL_TEXGEN_LINEAR)
789  {LGL.lglTexCoordGen(mode);}
790 
793  {return(LGL.lglGetTexCoordGen());}
794 
796 inline void lglColoring(bool on)
797  {LGL.lglColoring(on);}
798 
800 inline bool lglGetColoring()
801  {return(LGL.lglGetColoring());}
802 
804 inline void lglLighting(bool on)
805  {LGL.lglLighting(on);}
806 
808 inline bool lglGetLighting()
809  {return(LGL.lglGetLighting());}
810 
812 inline void lglTexturing(bool on)
813  {LGL.lglTexturing(on);}
814 
816 inline bool lglGetTexturing()
817  {return(LGL.lglGetTexturing());}
818 
820 inline void lglDisableColoring(bool off)
821  {LGL.lglDisableColoring(off);}
822 
824 inline void lglDisableLighting(bool off)
825  {LGL.lglDisableLighting(off);}
826 
828 inline void lglDisableTexturing(bool off)
829  {LGL.lglDisableTexturing(off);}
830 
832 inline void lglRender(lglVBO *vbo, const GL *gl = &LGL)
833  {vbo->lglRender(gl);}
834 
836 inline void lglRender(lglVBO &vbo, const GL *gl = &LGL)
837  {vbo.lglRender(gl);}
838 
840 inline void lglCloneState(const GL *gl)
841  {LGL.lglCloneState(gl);}
842 
844 inline void lglCloneState(const lglVBO *vbo)
845  {LGL.lglCloneState(vbo);}
846 
848 inline void lglCopyUniforms(const GL *gl, bool warn = false)
849  {LGL.lglCopyUniforms(gl);}
850 
852 inline void lglCopyUniforms(const lglVBO *vbo, bool warn = false)
853  {LGL.lglCopyUniforms(vbo);}
854 
856 inline unsigned char *lglReadRGBPixels(int x, int y, int width, int height)
857  {return(LGL.lglReadRGBPixels(x, y, width, height));}
858 
860 inline void lglBeginRayCast(vec3 origin, vec3 direction, double mindist = 0)
861  {LGL.lglBeginRayCast(origin, direction, mindist);}
862 
864 inline void lglRayCast(lglVBO *vbo)
865  {LGL.lglRayCast(vbo);}
866 
869  {return(LGL.lglEndRayCast());}
870 
872 inline double lglGetRayCastDistance()
873  {return(LGL.lglGetRayCastDistance());}
874 
876 inline void lglEnableViewCulling(int minsize = 0)
877  {LGL.lglEnableViewCulling(minsize);}
878 
881  {LGL.lglDisableViewCulling();}
882 
884 inline void lglBeginExport(void (*callback)(LGL_VBO_TYPE *vbo, void *data), void *data, mat4 m = mat4(1))
885  {LGL.lglBeginExport(callback, data, m);}
886 
888 inline void lglEndExport()
889  {LGL.lglEndExport();}
890 
892 inline int lglGetGLVersion()
893  {return(LGL.lglGetGLVersion());}
894 
896 inline int lglMapGL2GLSLVersion(int glversion)
897  {return(LGL.lglMapGL2GLSLVersion(glversion));}
898 
900 inline int lglGetGLSLVersion()
901  {return(LGL.lglGetGLSLVersion());}
902 
904 inline std::string lglGetRenderer()
905  {return(LGL.lglGetRenderer());}
906 
909  {return(LGL.lglGetVendor());}
910 
912 inline std::string lglGetVendorName()
913  {return(LGL.lglGetVendorName());}
914 
915 // wrapped extension function
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);}
918 
919 // wrapped extension function
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);}
922 
924 inline void lglMessage(std::string m)
925  {LGL.lglMessage(m);}
926 
928 inline void lglError(std::string e)
929  {LGL.lglError(e);}
930 
932 inline void lglWarning(std::string w)
933  {LGL.lglWarning(w);}
934 
936 inline void lglFatal(std::string e)
937  {LGL.lglFatal(e);}
938 
940 inline std::string lglGetWarning()
941  {return(LGL.lglGetWarning());}
942 
945  {LGL.lglVerbosity(v);}
946 
947 // scoped matrix stack
948 class lglScopedMatrixStack
949 {
950 public:
951 
952  lglScopedMatrixStack()
953  {lglPushMatrix();}
954 
955  ~lglScopedMatrixStack()
956  {lglPopMatrix();}
957 
958 };
959 
961 #define lglPushMatrixScoped() lglScopedMatrixStack __lglPushMatrixScoped__
962 
964 #define lglRandom() drand48()
965 
967 #define lglSeed() srand48((unsigned int)time(NULL))
968 
970 #define LGL_WARN(s) lglWarn(std::string(s)+" @ "+__FILE__+":"+glslmath::to_string(__LINE__))
971 
973 #define LGL_ERROR(s) lglError(std::string(s)+" @ "+__FILE__+":"+glslmath::to_string(__LINE__))
974 
975 #ifdef LGL_CORE
976 
977 // explicitly disallow the usage of all OpenGL legacy functions
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")
1009 
1010 #ifdef GLU_VERSION
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")
1013 #endif
1014 
1015 #endif
1016 
1017 #endif
lglGetWarning
std::string lglGetWarning()
get warning message
Definition: glvertex_api.h:940
lgl_vendor_enum
lgl_vendor_enum
graphics hardware vendor
Definition: glvertex_core.h:24
vec3f
3D float vector
Definition: glslmath.h:584
lgl::lglLightPosition
void lglLightPosition(vec3f light=vec3f(0, 0, 0), bool camera_light=true)
set the light position
Definition: glvertex_core.h:4145
lgl::lglMaterialParameters
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
lgl_polygonmode_enum
polygon mode enum
Definition: glvertex_core.h:82
lglBasicGLSLFragmentShader
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
lglReadRGBPixels
unsigned char * lglReadRGBPixels(int x, int y, int width, int height)
read frame buffer
Definition: glvertex_api.h:856
lglMessage
void lglMessage(std::string m)
generate a status message
Definition: glvertex_api.h:924
lglBlendMode
void lglBlendMode(lgl_blendmode_enum mode)
change OpenGL state (blending)
Definition: glvertex_api.h:404
lgl::lglDeleteGLSLProgram
static void lglDeleteGLSLProgram(GLuint program)
delete a compiled GLSL program
Definition: glvertex_core.h:3161
lglAlphaTest
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
lglMaterialParameters
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
lgl::lglGetZWrite
static bool lglGetZWrite()
get the depth write mask
Definition: glvertex_core.h:4423
lgl::lglGetMatrixMode
lgl_matrixmode_enum lglGetMatrixMode() const
get the actual matrix mode
Definition: glvertex_core.h:1987
lgl::lglMultMatrix
void lglMultMatrix(const mat4 &matrix)
multiply a specific matrix in immediate mode fashion
Definition: glvertex_core.h:2044
lglWarning
void lglWarning(std::string w)
generate a warning message
Definition: glvertex_api.h:932
lglInitializeOpenGL
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
lglGetClipPlane
bool lglGetClipPlane(unsigned int n=0)
get OpenGL state (clip plane)
Definition: glvertex_api.h:436
lgl::lglCompileGLSLProgram
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
lglDisableLighting
void lglDisableLighting(bool off)
entirely disable vertex normals
Definition: glvertex_api.h:824
lgl::lglGetLineWidth
static float lglGetLineWidth()
get the line rasterization width
Definition: glvertex_core.h:4741
getEye
vec3 getEye()
get eye point for last lookat transformation
Definition: glvertex_api.h:288
lglComplementaryInterlacingMode
void lglComplementaryInterlacingMode(lgl_interlacing_enum mode)
change OpenGL state (complementary interlacing mode)
Definition: glvertex_api.h:476
lglGetRayCastDistance
double lglGetRayCastDistance()
get distance to front-most hit point determined by ray casting
Definition: glvertex_api.h:872
lgl::lglTex
void lglTex()
reset the vbo texturing matrix
Definition: glvertex_core.h:2577
lgl::lglPlainGLSLVertexShader
static std::string lglPlainGLSLVertexShader()
get the LGL plain GLSL vertex shader
Definition: glvertex_core.h:2673
lglGetModelViewProjectionMatrix
mat4 lglGetModelViewProjectionMatrix()
get combined modelview and projection matrix
Definition: glvertex_api.h:214
lglUniformfv
unsigned int lglUniformfv(std::string uniform, const vec2f &value)
specify GLSL program uniform (vec2f)
Definition: glvertex_api.h:608
lgl_verbosity_enum
lgl_verbosity_enum
verbosity level enum
Definition: glvertex_core.h:100
lglPolygonMode
void lglPolygonMode(lgl_polygonmode_enum mode)
specify polygon mode (as defined by OpenGL 1.2)
Definition: glvertex_api.h:168
lgl::lglDisableLighting
static void lglDisableLighting(bool off)
entirely disable vertex normals
Definition: glvertex_core.h:3422
lglUniform
unsigned int lglUniform(std::string uniform)
specify GLSL program uniform (undefined)
Definition: glvertex_api.h:580
lgl::lglFog
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
lgl::lglRGBAWrite
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
lglBeginExport
void lglBeginExport(void(*callback)(LGL_VBO_TYPE *vbo, void *data), void *data, mat4 m=mat4(1))
begin scene export
Definition: glvertex_api.h:884
lgl::lglGetLightVector
vec4 lglGetLightVector() const
get the light vector (in camera coordinates)
Definition: glvertex_core.h:4176
lglGetMatrix
mat4 lglGetMatrix()
get actual matrix
Definition: glvertex_api.h:194
lgl_primitive_enum
lgl_primitive_enum
graphics primitive type
Definition: glvertex_core.h:33
lglLineWidth
void lglLineWidth(float width=1.0f)
specify line width (as defined by OpenGL 1.2)
Definition: glvertex_api.h:164
lgl::lglGetGLVersion
static int lglGetGLVersion()
get the OpenGL version
Definition: glvertex_core.h:5044
lglDeleteGLSLProgram
void lglDeleteGLSLProgram(GLuint program)
delete GLSL program
Definition: glvertex_api.h:552
lgl::lglGetInterlacingMode
static lgl_interlacing_enum lglGetInterlacingMode()
get the actual interlacing mode
Definition: glvertex_core.h:4790
lgl::lglMatrixMode
void lglMatrixMode(lgl_matrixmode_enum mode=LGL_MODELVIEW)
determine the actual matrix mode
Definition: glvertex_core.h:1981
lgl::getEye
vec3 getEye() const
get eye point for last lookat transformation
Definition: glvertex_core.h:2336
lglLoadGLSLProgram
GLuint lglLoadGLSLProgram(const char *vertex_shader_file, const char *fragment_shader_file)
load GLSL program
Definition: glvertex_api.h:528
lglGetGLVersion
int lglGetGLVersion()
get OpenGL version
Definition: glvertex_api.h:892
lglResetManip
void lglResetManip()
reset the manipulator matrix
Definition: glvertex_api.h:320
lglGetActiveProgram
GLuint lglGetActiveProgram()
get active GLSL program
Definition: glvertex_api.h:572
lglGetFog
bool lglGetFog()
get OpenGL state (fog)
Definition: glvertex_api.h:448
lglGetBackFaceCulling
bool lglGetBackFaceCulling()
get OpenGL state (back-face culling)
Definition: glvertex_api.h:400
lglOrtho
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
lgl::lglAlphaTest
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
lglGetLightSourceParameters
void lglGetLightSourceParameters(vec3f &Ia, vec3f &Id, vec3f &Is, vec3f &falloff)
get light source parameters
Definition: glvertex_api.h:753
lgl::lglProjection
void lglProjection()
reset the actual projection matrix
Definition: glvertex_core.h:2354
lglClipPlane
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
lglVerbosity
void lglVerbosity(lgl_verbosity_enum v)
change verbosity level
Definition: glvertex_api.h:944
lgl::lglGetInverseModelViewMatrix
mat4 lglGetInverseModelViewMatrix() const
get the inverse of the actual modelview matrix
Definition: glvertex_core.h:2170
lglDeleteTexture
void lglDeleteTexture()
delete any texture
Definition: glvertex_api.h:784
lglColoring
void lglColoring(bool on)
enable coloring
Definition: glvertex_api.h:796
lglGetRenderer
std::string lglGetRenderer()
get OpenGL renderer
Definition: glvertex_api.h:904
lgl::lglGetTexturing
bool lglGetTexturing() const
check for texturing
Definition: glvertex_core.h:3410
lglEnd
void lglEnd()
end vertex series (as defined by OpenGL 1.2)
Definition: glvertex_api.h:54
lglIsManipApplied
bool lglIsManipApplied()
is the manipulator matrix applied?
Definition: glvertex_api.h:328
lglSupportsGLSL
GLuint lglSupportsGLSL()
get GLSL support
Definition: glvertex_api.h:484
lglSplitGLSLProgram
bool lglSplitGLSLProgram(std::string shader, std::string &vertex_shader, std::string &fragment_shader)
split GLSL program
Definition: glvertex_api.h:536
lglProjection
void lglProjection()
reset the actual projection matrix
Definition: glvertex_api.h:238
lglBasicGLSLVertexShader
std::string lglBasicGLSLVertexShader(bool colors=false, bool normals=false, bool texcoords=false)
get the LGL default vertex shader
Definition: glvertex_api.h:504
getLookAt
vec3 getLookAt()
get lookat point for last lookat transformation
Definition: glvertex_api.h:292
lgl::lglTexCoordGen
void lglTexCoordGen(lgl_texgenmode_enum mode=LGL_TEXGEN_LINEAR, double mix=0.5)
enable texture coordinate generation
Definition: glvertex_core.h:4327
lglGetManip
mat4 lglGetManip()
get the manipulator matrix
Definition: glvertex_api.h:324
lglGetFogColor
vec4f lglGetFogColor()
get OpenGL state (fog color)
Definition: glvertex_api.h:456
lglUseDefaultProgram
void lglUseDefaultProgram(bool clear=true)
use default GLSL program
Definition: glvertex_api.h:560
lgl::lglRayCast
static void lglRayCast(lgl *vbo)
cast a ray and intersect it with the transformed triangles contained in the vbo
Definition: glvertex_core.h:4963
lgl::lglGetGLSLVersionString
static std::string lglGetGLSLVersionString()
get GLSL version string
Definition: glvertex_core.h:2658
lgl::lglGetLightSourceParameters
void lglGetLightSourceParameters(vec3f &Ia, vec3f &Id, vec3f &Is, vec3f &falloff) const
get the light source parameters
Definition: glvertex_core.h:4233
lglAttribute
void lglAttribute(const vec4f &a, unsigned int n=0)
specify vertex attribute
Definition: glvertex_api.h:182
lglGetLightVector
vec4f lglGetLightVector()
get light vector (in camera coordinates)
Definition: glvertex_api.h:732
lglManip
void lglManip(bool on=true)
enable or disable the manipulator matrix
Definition: glvertex_api.h:300
lgl::lglDepthTest
static void lglDepthTest(bool on=true)
enable or disable depth testing
Definition: glvertex_core.h:4431
lglGetGLSLVersion
int lglGetGLSLVersion()
get GLSL version
Definition: glvertex_api.h:900
lgl::lglGetDepthTest
static bool lglGetDepthTest()
check whether or not depth testing is enabled
Definition: glvertex_core.h:4446
lglEndRayCast
LGL_VBO_TYPE * lglEndRayCast()
end ray casting
Definition: glvertex_api.h:868
lgl::lglClear
static void lglClear(GLuint bits=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
clear the color and depth buffer
Definition: glvertex_core.h:4384
lgl::lglUseDefaultProgram
void lglUseDefaultProgram(bool clear=true)
use the default GLSL program which simulates the fixed function OpenGL pipeline
Definition: glvertex_core.h:3202
lgl::lglViewport
static void lglViewport(int ax, int ay, int bx, int by)
set the viewport
Definition: glvertex_core.h:4367
lgl::lglGetInverseTransposeModelMatrix
mat4 lglGetInverseTransposeModelMatrix() const
get the inverse transpose of the vbo modeling matrix
Definition: glvertex_core.h:2545
vec2
2D double vector
Definition: glslmath.h:108
lglRGBAWrite
void lglRGBAWrite(bool r=true, bool g=true, bool b=true, bool a=true)
change OpenGL state (rgba write)
Definition: glvertex_api.h:372
lgl::lglPopMatrix
void lglPopMatrix()
pop the top entry of the matrix stack
Definition: glvertex_core.h:2095
lgl::getAspect
double getAspect()
get aspect parameter for last projection transformation
Definition: glvertex_core.h:2300
lglLightDirection
void lglLightDirection(vec3f light=vec3f(0, 0, 1), bool camera_light=true)
set light direction
Definition: glvertex_api.h:720
lglBeginRayCast
void lglBeginRayCast(vec3 origin, vec3 direction, double mindist=0)
begin ray casting in view coordinates
Definition: glvertex_api.h:860
lgl::lglCompileGLSLVertexShader
static GLuint lglCompileGLSLVertexShader(std::string shader)
compile GLSL vertex shader
Definition: glvertex_core.h:2847
mat2f
2x2 float matrix
Definition: glslmath.h:1408
GL
LGL API: immediate mode class definition.
Definition: glvertex_core.h:5820
getNear
double getNear()
get near parameter for last projection transformation
Definition: glvertex_api.h:262
lgl::getNear
double getNear()
get near parameter for last projection transformation
Definition: glvertex_core.h:2306
lglGetFogDensity
float lglGetFogDensity()
get OpenGL state (fog density)
Definition: glvertex_api.h:452
vec4
4D double vector
Definition: glslmath.h:713
lgl::lglGetLightParameters
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
lglViewport
void lglViewport(int ax, int ay, int bx, int by)
specify viewport (as defined by OpenGL 1.2)
Definition: glvertex_api.h:132
getFovy
double getFovy()
get fovy parameter for last projection transformation
Definition: glvertex_api.h:254
lgl::lglGetVendorName
static std::string lglGetVendorName()
get the vendor name of the graphics hardware
Definition: glvertex_core.h:5094
lgl::lglTexture3D
void lglTexture3D(GLuint texid, bool owner=false)
bind a 3D texture for the default GLSL program
Definition: glvertex_core.h:4282
lglGetVendorName
std::string lglGetVendorName()
get OpenGL vendor name
Definition: glvertex_api.h:912
lglUseProgram
void lglUseProgram(GLuint program, bool clear=true)
use GLSL program
Definition: glvertex_api.h:556
lgl::lglCombineGLSLProgram
static std::string lglCombineGLSLProgram(const std::string &vertex_shader, const std::string &fragment_shader)
combine GLSL program
Definition: glvertex_core.h:3064
lglTexturing
void lglTexturing(bool on)
enable texturing
Definition: glvertex_api.h:812
lglSampler2D
unsigned int lglSampler2D(std::string sampler, GLuint texid2D, int value=0, bool warn=true)
bind 2D sampler
Definition: glvertex_api.h:700
lgl::lglModelView
void lglModelView()
reset the actual modelview matrix
Definition: glvertex_core.h:2389
lglCloneState
void lglCloneState(const GL *gl)
clone state from vbo (coloring, lighting and texturing)
Definition: glvertex_api.h:840
lgl::lglGetTextureMatrix
mat4 lglGetTextureMatrix() const
get the actual texture matrix
Definition: glvertex_core.h:2191
lgl::lglEnableViewCulling
static void lglEnableViewCulling(int minsize=0)
enable view culling
Definition: glvertex_core.h:4991
lglView
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
lgl::lglUseProgram
void lglUseProgram(GLuint program, bool clear=true)
use a custom GLSL program
Definition: glvertex_core.h:3178
lgl::lglGetTexture2D
GLuint lglGetTexture2D() const
get the bound 2D texture
Definition: glvertex_core.h:4276
lgl::lglGetTexture3D
GLuint lglGetTexture3D() const
get the bound 3D texture
Definition: glvertex_core.h:4292
lgl::lglDeleteTexture
void lglDeleteTexture()
delete any texture map
Definition: glvertex_core.h:4320
lgl::lglError
static void lglError(std::string e)
generate an error message
Definition: glvertex_core.h:5665
lgl::lglLightVector
void lglLightVector(vec4f light=vec4f(0, 0, 1, 0), bool camera_light=true)
set the light vector
Definition: glvertex_core.h:4151
lglPopMatrix
void lglPopMatrix()
pop matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:78
lglTogglePolygonMode
void lglTogglePolygonMode()
toggle OpenGL state (polygon mode)
Definition: glvertex_api.h:464
lglModelView
void lglModelView()
reset the actual modelview matrix
Definition: glvertex_api.h:270
lglRotate
void lglRotate(double angle, const vec3 &v)
multiply with rotation matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:102
lgl::lglGetRayCastDistance
static double lglGetRayCastDistance()
get distance to front-most hit point determined by ray casting
Definition: glvertex_core.h:4985
lglColor
void lglColor(const vec4f &c)
specify vertex color attribute (as defined by OpenGL 1.2)
Definition: glvertex_api.h:30
lgl_matrixmode_enum
lgl_matrixmode_enum
matrix mode enum
Definition: glvertex_core.h:46
lglReuseProgram
void lglReuseProgram(GLuint program)
reuse GLSL program
Definition: glvertex_api.h:576
lgl::lglLightSourceParameters
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
lgl::lglEnd
void lglEnd()
end a series of vertices
Definition: glvertex_core.h:981
mat4f
4x4 float matrix
Definition: glslmath.h:2752
lglFog
void lglFog(float density=0.0f, vec4f color=vec4f(1))
specify fog (as defined by OpenGL 1.2)
Definition: glvertex_api.h:160
lglSampler3D
unsigned int lglSampler3D(std::string sampler, GLuint texid3D, int value=0, bool warn=true)
bind 3D sampler
Definition: glvertex_api.h:708
lglRotateZ
void lglRotateZ(double angle)
multiply with rotation matrix (rotation about z-axis)
Definition: glvertex_api.h:230
lglClear
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
lglMultMatrix
void lglMultMatrix(const mat4 &matrix)
multiply with matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:70
lgl::lglGetMatrix
mat4 lglGetMatrix() const
get the top entry of the matrix stack
Definition: glvertex_core.h:2123
lglFrustum
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
lglLoadIdentity
void lglLoadIdentity()
load identity matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:62
lgl::lglLoadGLSLProgram
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
lglClearColor
void lglClearColor(float w=0, float a=1)
specify clear color (as defined by OpenGL 1.2)
Definition: glvertex_api.h:136
lgl::lglOrtho
void lglOrtho(double left, double right, double bottom, double top, double nearp=-1, double farp=1)
orthographic projection
Definition: glvertex_core.h:2265
lglNormal
void lglNormal(const vec3f &n)
specify vertex normal attribute (as defined by OpenGL 1.2)
Definition: glvertex_api.h:38
lglLookAt
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
lglInterlacingMode
void lglInterlacingMode(lgl_interlacing_enum mode)
change OpenGL state (interlacing mode)
Definition: glvertex_api.h:472
lgl::lglGetFog
static bool lglGetFog()
check whether or not fogging is enabled
Definition: glvertex_core.h:4717
lgl::getFar
double getFar()
get far parameter for last projection transformation
Definition: glvertex_core.h:2312
lgl::lglGetInverseTransposeManip
static mat4 lglGetInverseTransposeManip()
get the inverse transpose of the manipulator matrix
Definition: glvertex_core.h:2519
lglGetVendor
lgl_vendor_enum lglGetVendor()
get OpenGL vendor
Definition: glvertex_api.h:908
lglSampler
unsigned int lglSampler(std::string sampler, int value=0, bool warn=true)
specify GLSL program uniform sampler
Definition: glvertex_api.h:692
lgl::lglReadRGBPixels
static unsigned char * lglReadRGBPixels(int x, int y, int width, int height)
read frame buffer
Definition: glvertex_core.h:4796
lgl_interlacing_enum
lgl_interlacing_enum
interlacing mode enum
Definition: glvertex_core.h:90
lglEndExport
void lglEndExport()
end scene export
Definition: glvertex_api.h:888
lglFatal
void lglFatal(std::string e)
generate a non-recoverable error
Definition: glvertex_api.h:936
lglRender
void lglRender(lglVBO *vbo, const GL *gl=&LGL)
render vbo (by copying the global state)
Definition: glvertex_api.h:832
lglGetInverseTransposeModelMatrix
mat4 lglGetInverseTransposeModelMatrix()
get the inverse transpose of the vbo modeling matrix
Definition: glvertex_api.h:344
lgl::lglSampler2D
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
lglTexture2D
void lglTexture2D(GLuint texid, bool owner=false)
bind 2D texture
Definition: glvertex_api.h:768
lgl::lglGetRGBAWrite
static bool lglGetRGBAWrite()
get the RGBA write mask
Definition: glvertex_core.h:4400
lglRotateX
void lglRotateX(double angle)
multiply with rotation matrix (rotation about x-axis)
Definition: glvertex_api.h:222
lglEnableViewCulling
void lglEnableViewCulling(int minsize=0)
enable view culling
Definition: glvertex_api.h:876
lgl::lglPlainGLSLFragmentShader
static std::string lglPlainGLSLFragmentShader()
get the LGL plain GLSL fragment shader
Definition: glvertex_core.h:2680
lglGetMaterialParameters
void lglGetMaterialParameters(vec3f &ka, vec3f &kd, vec3f &ks, float &exponent)
get material parameters
Definition: glvertex_api.h:763
lgl::lglColoring
void lglColoring(bool on)
enable or disable the vertex color attributes contained in vbo
Definition: glvertex_core.h:3353
lgl::lglRotate
void lglRotate(double angle, const vec3 &v)
rotate in immediate mode fashion
Definition: glvertex_core.h:2234
lgl::lglGetError
static std::string lglGetError()
get a description of the last occured error
Definition: glvertex_core.h:5107
lglGetMatrixMode
lgl_matrixmode_enum lglGetMatrixMode()
get actual matrix mode
Definition: glvertex_api.h:190
lglGetTexMatrix
mat4 lglGetTexMatrix()
get the vbo texturing matrix
Definition: glvertex_api.h:356
lgl::lglPerspective
void lglPerspective(double fovy, double aspect, double nearp, double farp)
perspective projection
Definition: glvertex_core.h:2283
lglPlainGLSLFragmentShader
std::string lglPlainGLSLFragmentShader()
get the LGL plain GLSL fragment shader
Definition: glvertex_api.h:496
lglDepthTest
void lglDepthTest(bool on=false)
change OpenGL state (depth test)
Definition: glvertex_api.h:388
vec2f
2D float vector
Definition: glslmath.h:261
lgl::lglCloneState
void lglCloneState(const lgl *vbo)
clone state from vbo (coloring, lighting and texturing)
Definition: glvertex_core.h:4341
lgl::lglPolygonMode
static void lglPolygonMode(lgl_polygonmode_enum mode)
specify the polygon mode
Definition: glvertex_core.h:4749
lgl::lglLightParameters
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
lgl::lglUniformf
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
lgl::lglScale
void lglScale(const vec4 &c)
scale in immediate mode fashion
Definition: glvertex_core.h:2202
lglGetBlending
bool lglGetBlending()
get OpenGL state (blending)
Definition: glvertex_api.h:408
getFar
double getFar()
get far parameter for last projection transformation
Definition: glvertex_api.h:266
lgl::lglUniformi
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
lglDisableTexturing
void lglDisableTexturing(bool off)
entirely disable texture coordinates
Definition: glvertex_api.h:828
vec3
3D double vector
Definition: glslmath.h:372
mat2
2x2 double matrix
Definition: glslmath.h:1130
lglLightPosition
void lglLightPosition(vec3f light=vec3f(0, 0, 0), bool camera_light=true)
set light position
Definition: glvertex_api.h:724
lgl::lglLinkGLSLProgram
static GLuint lglLinkGLSLProgram(GLuint vertex_shader_id, GLuint fragment_shader_id, GLuint custom_shader_program=0)
link GLSL program
Definition: glvertex_core.h:2939
lgl::lglZWrite
static void lglZWrite(bool on=true)
specify the depth write mask
Definition: glvertex_core.h:4408
lgl::lglManip
static void lglManip(bool on=true)
enable or disable the manipulator matrix
Definition: glvertex_core.h:2443
lglBegin
void lglBegin(lgl_primitive_enum primitive)
begin vertex series (as defined by OpenGL 1.2)
Definition: glvertex_api.h:18
mat4
4x4 double matrix
Definition: glslmath.h:2116
lglLightSourceParameters
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
lglTranslate
void lglTranslate(const vec4 &v)
multiply with translation matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:94
lgl::getFovy
double getFovy()
get fovy parameter for last projection transformation
Definition: glvertex_core.h:2294
lglBackFaceCulling
void lglBackFaceCulling(bool on=true)
change OpenGL state (back-face culling)
Definition: glvertex_api.h:396
lgl::lglLoadIdentity
void lglLoadIdentity()
load the identity matrix in immediate mode fashion
Definition: glvertex_core.h:1993
lgl::lglGetInverseTransposeModelViewMatrix
mat4 lglGetInverseTransposeModelViewMatrix() const
get the inverse transpose of the actual modelview matrix
Definition: glvertex_core.h:2177
lgl::lglGetLighting
bool lglGetLighting() const
check for lighting
Definition: glvertex_core.h:3389
lgl::lglComplementaryInterlacingMode
static void lglComplementaryInterlacingMode(lgl_interlacing_enum mode)
specify the complementary interlacing mode
Definition: glvertex_core.h:4775
lglError
void lglError(std::string e)
generate an error message
Definition: glvertex_api.h:928
glvertex_core.h
lgl::lglBackFaceCulling
static void lglBackFaceCulling(bool on=true)
enable or disable back-face culling
Definition: glvertex_core.h:4454
lglCompileGLSLVertexShader
GLuint lglCompileGLSLVertexShader(std::string shader)
compile GLSL vertex shader
Definition: glvertex_api.h:512
lglCompileGLSLFragmentShader
GLuint lglCompileGLSLFragmentShader(std::string shader)
compile GLSL fragment shader
Definition: glvertex_api.h:516
lglPlainGLSLVertexShader
std::string lglPlainGLSLVertexShader()
get the LGL plain GLSL vertex shader
Definition: glvertex_api.h:492
lglGetTexture2D
GLuint lglGetTexture2D()
get 2D texture
Definition: glvertex_api.h:772
lglModel
void lglModel(const mat4 &model)
set the vbo modeling matrix
Definition: glvertex_api.h:336
lglGetAlphaTest
bool lglGetAlphaTest()
get OpenGL state (alpha test)
Definition: glvertex_api.h:420
vec4f
4D float vector
Definition: glslmath.h:961
lgl::lglGetMaterialParameters
void lglGetMaterialParameters(vec3f &ka, vec3f &kd, vec3f &ks, float &exponent) const
get the material parameters
Definition: glvertex_core.h:4255
lgl::lglGetColoring
bool lglGetColoring() const
check for coloring
Definition: glvertex_core.h:3368
lgl::lglBeginRayCast
static void lglBeginRayCast(vec3 origin, vec3 direction, double mindist=0)
begin ray casting in view coordinates
Definition: glvertex_core.h:4952
lgl::lglSupportsGLSL
static bool lglSupportsGLSL()
check for GLSL support
Definition: glvertex_core.h:2648
lgl::lglCopyUniforms
void lglCopyUniforms(const lgl *vbo, bool warn=false)
copy uniforms from vbo
Definition: glvertex_core.h:4051
lgl::lglDisableViewCulling
static void lglDisableViewCulling()
disable view culling
Definition: glvertex_core.h:4998
lglCopyUniforms
void lglCopyUniforms(const GL *gl, bool warn=false)
copy uniforms from vbo
Definition: glvertex_api.h:848
lgl
LGL core.
Definition: glvertex_core.h:156
lglMatrixMode
void lglMatrixMode(lgl_matrixmode_enum mode=LGL_MODELVIEW)
specify matrix mode (as defined by OpenGL 1.2)
Definition: glvertex_api.h:58
lgl::lglMessage
static void lglMessage(std::string m)
generate a status message
Definition: glvertex_core.h:5658
lgl::lglGetBackFaceCulling
static bool lglGetBackFaceCulling()
check whether or not back-face culling is enabled
Definition: glvertex_core.h:4471
lgl::lglGetTexCoordGen
lgl_texgenmode_enum lglGetTexCoordGen()
check whether or not texture coordinate generation is enabled
Definition: glvertex_core.h:4335
lglGetTexture3D
GLuint lglGetTexture3D()
get 3D texture
Definition: glvertex_api.h:780
lgl_blendmode_enum
lgl_blendmode_enum
blend mode enum
Definition: glvertex_core.h:70
lgl::lglGetBlending
static bool lglGetBlending()
check whether or not blending is enabled
Definition: glvertex_core.h:4561
lgl::lglGetFogColor
static vec4f lglGetFogColor()
get the actual fog color
Definition: glvertex_core.h:4729
lgl::lglGetModelViewProjectionMatrix
mat4 lglGetModelViewProjectionMatrix() const
get the combined modelview and projection matrix
Definition: glvertex_core.h:2184
lgl::lglTranslate
void lglTranslate(const vec4 &v)
translate in immediate mode fashion
Definition: glvertex_core.h:2221
lgl::lglDeleteGLSLShader
static void lglDeleteGLSLShader(GLuint shader_id)
delete a compiled GLSL shader
Definition: glvertex_core.h:3146
lglGetAlphaTestGreater
bool lglGetAlphaTestGreater()
get OpenGL state (alpha test comparison mode)
Definition: glvertex_api.h:428
lgl::lglGetGLSLVersion
static int lglGetGLSLVersion()
get the GLSL version
Definition: glvertex_core.h:5074
lgl::lglEndExport
static void lglEndExport()
end scene export
Definition: glvertex_core.h:5038
lgl::lglBasicGLSLFragmentShader
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
lglUniformi
unsigned int lglUniformi(std::string uniform, int value)
specify GLSL program uniform (integer)
Definition: glvertex_api.h:584
lglGetAlphaTestEqual
bool lglGetAlphaTestEqual()
get OpenGL state (alpha test equality mode)
Definition: glvertex_api.h:432
lgl::lglUniformfv
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
lgl::lglVerbosity
static void lglVerbosity(lgl_verbosity_enum v)
change verbosity level
Definition: glvertex_core.h:5690
lgl::lglBlendMode
static void lglBlendMode(lgl_blendmode_enum mode=LGL_BLEND_NONE)
enable or disable blending
Definition: glvertex_core.h:4479
lgl::lglGetAlphaTestValue
static float lglGetAlphaTestValue()
get the actual alpha test comparison value
Definition: glvertex_core.h:4629
getUp
vec3 getUp()
get up vector for last lookat transformation
Definition: glvertex_api.h:296
lglGetProgram
GLuint lglGetProgram()
get actual GLSL program
Definition: glvertex_api.h:568
lglGetTexCoordGen
lgl_texgenmode_enum lglGetTexCoordGen()
check for texture coordinate generation
Definition: glvertex_api.h:792
lgl::lglRender
virtual void lglRender(const lgl *vbo=NULL)
render the series of vertices contained in vbo
Definition: glvertex_core.h:1079
lglTexture3D
void lglTexture3D(GLuint texid, bool owner=false)
bind 3D texture
Definition: glvertex_api.h:776
lglPerspective
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
lglGetProjectionMatrix
mat4 lglGetProjectionMatrix()
get actual projection matrix
Definition: glvertex_api.h:198
lgl::lglInitializeOpenGL
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
lgl::lglCompileGLSLFragmentShader
static GLuint lglCompileGLSLFragmentShader(std::string shader)
compile GLSL fragment shader
Definition: glvertex_core.h:2893
lglGetInverseTransposeManip
mat4 lglGetInverseTransposeManip()
get the inverse transpose of the manipulator matrix
Definition: glvertex_api.h:332
lglMapGL2GLSLVersion
int lglMapGL2GLSLVersion(int glversion)
map gl version to glsl version
Definition: glvertex_api.h:896
lglGetColoring
bool lglGetColoring()
check for coloring
Definition: glvertex_api.h:800
lgl::lglFatal
static void lglFatal(std::string e)
generate a non-recoverable error
Definition: glvertex_core.h:5683
lglTex
void lglTex(const mat4 &tex)
set the vbo texturing matrix
Definition: glvertex_api.h:348
lgl::lglLighting
void lglLighting(bool on)
enable or disable the vertex normal attributes contained in vbo
Definition: glvertex_core.h:3374
lglGetError
std::string lglGetError()
get error string (as defined by OpenGL 1.2)
Definition: glvertex_api.h:172
lglGetTexturing
bool lglGetTexturing()
check for texturing
Definition: glvertex_api.h:816
lglCompileGLSLProgram
GLuint lglCompileGLSLProgram(std::string vertex_shader, std::string fragment_shader)
compile GLSL program
Definition: glvertex_api.h:524
lgl::lglParallel
void lglParallel(const vec3 &p, const vec3 &n, const vec3 &d)
parallel projection
Definition: glvertex_core.h:2277
lgl::lglBeginExport
static void lglBeginExport(void(*callback)(lgl *vbo, void *data), void *data, mat4 matrix=mat4(1))
begin scene export
Definition: glvertex_core.h:5007
lgl::lglRotateZ
void lglRotateZ(double angle)
rotate about z-axis in immediate mode fashion
Definition: glvertex_core.h:2259
lgl::lglGetProjectionMatrix
mat4 lglGetProjectionMatrix() const
get the actual projection matrix
Definition: glvertex_core.h:2140
lgl::lglGetManip
static mat4 lglGetManip()
get the manipulator matrix
Definition: glvertex_core.h:2507
lgl::lglReuseProgram
void lglReuseProgram(GLuint program)
reuse a compiled GLSL program /wo clearing and updating uniforms
Definition: glvertex_core.h:3256
lglDeleteGLSLShader
void lglDeleteGLSLShader(GLuint shader_id)
delete GLSL shader
Definition: glvertex_api.h:548
lgl::lglTexture2D
void lglTexture2D(GLuint texid, bool owner=false)
bind a 2D texture for the default GLSL program
Definition: glvertex_core.h:4266
lglVBO
LGL API: vbo class definition.
Definition: glvertex_core.h:5827
lglReplaceDefaultProgram
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
lgl::lglPushMatrix
void lglPushMatrix()
push the top entry of the matrix stack
Definition: glvertex_core.h:2069
lgl::lglLineWidth
static void lglLineWidth(float width=1.0f)
specify the line rasterization width
Definition: glvertex_core.h:4735
lglGetBlendMode
lgl_blendmode_enum lglGetBlendMode()
get OpenGL state (blend mode)
Definition: glvertex_api.h:412
mat3
3x3 double matrix
Definition: glslmath.h:1544
lglTexCoord
void lglTexCoord(const vec4f &t)
specify vertex texture coordinate attribute (as defined by OpenGL 1.2)
Definition: glvertex_api.h:46
lgl::lglClipPlane
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
lglPlainGLSLProgram
std::string lglPlainGLSLProgram()
get the combined LGL plain GLSL program
Definition: glvertex_api.h:500
lglParallel
void lglParallel(const vec3 &p, const vec3 &n, const vec3 &d)
multiply with parallel projection matrix
Definition: glvertex_api.h:234
lgl::lglUniform
unsigned int lglUniform(std::string uniform, bool warn=true)
specify a uniform for the actual compiled GLSL program (undefined)
Definition: glvertex_core.h:3434
lgl::lglPlainGLSLProgram
static std::string lglPlainGLSLProgram()
get the combined LGL plain GLSL program
Definition: glvertex_core.h:2687
lgl::lglGetBlendMode
static lgl_blendmode_enum lglGetBlendMode()
get the actual blending mode
Definition: glvertex_core.h:4569
lgl_texgenmode_enum
lgl_texgenmode_enum
texgen mode enum
Definition: glvertex_core.h:56
lgl::lglGetRenderer
static std::string lglGetRenderer()
get the OpenGL renderer
Definition: glvertex_core.h:5080
lglLightVector
void lglLightVector(vec4f light=vec4f(0, 0, 1, 0), bool camera_light=true)
set light vector
Definition: glvertex_api.h:728
lgl::lglGetColor
vec4 lglGetColor() const
get the actual color attribute
Definition: glvertex_core.h:844
lgl::lglFrustum
void lglFrustum(double left, double right, double bottom, double top, double nearp, double farp)
frustum projection
Definition: glvertex_core.h:2271
lgl::lglGetFogDensity
static float lglGetFogDensity()
get the actual fog density
Definition: glvertex_core.h:4723
lgl::lglBegin
void lglBegin(lgl_primitive_enum primitive)
begin a series of vertices for a particular graphics primitive
Definition: glvertex_core.h:917
lgl::getUp
vec3 getUp() const
get up vector for last lookat transformation
Definition: glvertex_core.h:2348
lgl::lglGetPolygonMode
static lgl_polygonmode_enum lglGetPolygonMode()
get the actual polygon mode
Definition: glvertex_core.h:4763
lglZWrite
void lglZWrite(bool on=true)
change OpenGL state (depth write)
Definition: glvertex_api.h:380
lglLoadMatrix
void lglLoadMatrix(const mat4 &matrix)
load matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:66
lglGetInterlacingMode
lgl_interlacing_enum lglGetInterlacingMode()
get OpenGL state (interlacing mode)
Definition: glvertex_api.h:480
lglGetClipPlaneEquation
vec4 lglGetClipPlaneEquation(unsigned int n=0)
get OpenGL state (clip plane equation)
Definition: glvertex_api.h:440
lglPushMatrix
void lglPushMatrix()
push matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:74
lgl::lglResetManip
static void lglResetManip()
reset the manipulator matrix
Definition: glvertex_core.h:2499
lgl::lglRotateX
void lglRotateX(double angle)
rotate about x-axis in immediate mode fashion
Definition: glvertex_core.h:2247
lgl::lglView
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
scale
mat4 scale(const mat4 &m, const vec4 &c)
inline scale
Definition: glslmath.h:2591
lglDisableViewCulling
void lglDisableViewCulling()
disable view culling
Definition: glvertex_api.h:880
lglGetTextureMatrix
mat4 lglGetTextureMatrix()
get texture matrix
Definition: glvertex_api.h:218
lglGetAlphaTestValue
float lglGetAlphaTestValue()
get OpenGL state (alpha test value)
Definition: glvertex_api.h:424
lgl::lglGetVendor
static lgl_vendor_enum lglGetVendor()
get the OpenGL vendor
Definition: glvertex_core.h:5087
lgl::lglModel
void lglModel()
reset the vbo modeling matrix
Definition: glvertex_core.h:2525
mat3f
3x3 float matrix
Definition: glslmath.h:1939
lglDisableColoring
void lglDisableColoring(bool off)
entirely disable vertex colors
Definition: glvertex_api.h:820
lglPrintUniforms
void lglPrintUniforms()
print GLSL uniforms
Definition: glvertex_api.h:716
lglLight
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
lgl::lglGetModelMatrix
mat4 lglGetModelMatrix() const
get the vbo modeling matrix
Definition: glvertex_core.h:2539
getAspect
double getAspect()
get aspect parameter for last projection transformation
Definition: glvertex_api.h:258
lglScale
void lglScale(const vec4 &c)
multiply with scale matrix (as defined by OpenGL 1.2)
Definition: glvertex_api.h:82
lglGetZWrite
bool lglGetZWrite()
get OpenGL state (depth write)
Definition: glvertex_api.h:384
lgl::lglGetTexMatrix
mat4 lglGetTexMatrix() const
get the vbo texturing matrix
Definition: glvertex_core.h:2597
lglGetDepthTest
bool lglGetDepthTest()
get OpenGL state (depth test)
Definition: glvertex_api.h:392
lgl::lglIsManipApplied
static bool lglIsManipApplied()
is the manipulator matrix applied?
Definition: glvertex_core.h:2513
lglGetRGBAWrite
bool lglGetRGBAWrite()
get OpenGL state (rgba write)
Definition: glvertex_api.h:376
lglLighting
void lglLighting(bool on)
enable lighting
Definition: glvertex_api.h:804
lglGetInverseTransposeModelViewMatrix
mat4 lglGetInverseTransposeModelViewMatrix()
get inverse transpose of modelview matrix
Definition: glvertex_api.h:210
lglGetLineWidth
float lglGetLineWidth()
get OpenGL state (line width)
Definition: glvertex_api.h:460
lgl::lglDisableColoring
static void lglDisableColoring(bool off)
entirely disable vertex colors
Definition: glvertex_core.h:3416
lgl::lglGetActiveProgram
GLuint lglGetActiveProgram() const
get the actual GLSL program in use
Definition: glvertex_core.h:3282
lgl::lglGetAlphaTestEqual
static bool lglGetAlphaTestEqual()
get the actual alpha test equality mode
Definition: glvertex_core.h:4641
lgl::lglSampler
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
lgl::lglLoadMatrix
void lglLoadMatrix(const mat4 &matrix)
load a specific matrix in immediate mode fashion
Definition: glvertex_core.h:2019
lgl::lglGetAlphaTest
static bool lglGetAlphaTest()
check whether or not alpha testing is enabled
Definition: glvertex_core.h:4613
lgl::lglSampler3D
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
lgl::lglEndRayCast
static lgl * lglEndRayCast()
end ray casting
Definition: glvertex_core.h:4978
lgl::getLookAt
vec3 getLookAt() const
get lookat point for last lookat transformation
Definition: glvertex_core.h:2342
lglRotateY
void lglRotateY(double angle)
multiply with rotation matrix (rotation about y-axis)
Definition: glvertex_api.h:226
lglVertex
void lglVertex(const vec4 &v)
specify vertex (as defined by OpenGL 1.2)
Definition: glvertex_api.h:22
lglCombineGLSLProgram
std::string lglCombineGLSLProgram(const std::string &vertex_shader, const std::string &fragment_shader)
combine GLSL program
Definition: glvertex_api.h:532
lgl::lglTexturing
void lglTexturing(bool on)
enable or disable the vertex texture coordinate attributes contained in vbo
Definition: glvertex_core.h:3395
lgl::lglLookAt
void lglLookAt(const vec3 &eye, const vec3 &at, const vec3 &up=vec3(0, 1, 0))
lookat transformation
Definition: glvertex_core.h:2318
lglGetInverseModelViewMatrix
mat4 lglGetInverseModelViewMatrix()
get inverse of modelview matrix
Definition: glvertex_api.h:206
lgl::lglGetAlphaTestGreater
static bool lglGetAlphaTestGreater()
get the actual alpha test comparison mode
Definition: glvertex_core.h:4635
lglRayCast
void lglRayCast(lglVBO *vbo)
cast a ray and intersect it with the transformed triangles contained in the vbo
Definition: glvertex_api.h:864
lgl::lglDisableTexturing
static void lglDisableTexturing(bool off)
entirely disable texture coordinates
Definition: glvertex_core.h:3428
lgl::lglSplitGLSLProgram
static bool lglSplitGLSLProgram(std::string shader, std::string &vertex_shader, std::string &fragment_shader)
split GLSL program
Definition: glvertex_core.h:3070
lgl::lglGetClipPlaneEquation
static vec4 lglGetClipPlaneEquation(unsigned int n=0)
get the actual clip plane equation
Definition: glvertex_core.h:4691
lglGetModelMatrix
mat4 lglGetModelMatrix()
get the vbo modeling matrix
Definition: glvertex_api.h:340
lglGetLightParameters
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
lgl::lglWarning
static void lglWarning(std::string w)
generate a warning message
Definition: glvertex_core.h:5674
lgl::lglGetClipPlane
static bool lglGetClipPlane(unsigned int n=0)
check whether or not a clip plane is enabled
Definition: glvertex_core.h:4682
lgl::lglReplaceDefaultProgram
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
lglGetColor
vec4 lglGetColor()
get actual color
Definition: glvertex_api.h:178
lgl::lglInterlacingMode
static void lglInterlacingMode(lgl_interlacing_enum mode)
specify the interlacing mode
Definition: glvertex_core.h:4769
lglGetLighting
bool lglGetLighting()
check for lighting
Definition: glvertex_api.h:808
lglGetPolygonMode
lgl_polygonmode_enum lglGetPolygonMode()
get OpenGL state (polygon mode)
Definition: glvertex_api.h:468
lglGetGLSLVersionString
std::string lglGetGLSLVersionString()
get GLSL version string
Definition: glvertex_api.h:488
lgl::lglLightDirection
void lglLightDirection(vec3f light=vec3f(0, 0, 1), bool camera_light=true)
set the light direction
Definition: glvertex_core.h:4139
lglUniformf
unsigned int lglUniformf(std::string uniform, double value)
specify GLSL program uniform (float)
Definition: glvertex_api.h:592
lglTexCoordGen
void lglTexCoordGen(lgl_texgenmode_enum mode=LGL_TEXGEN_LINEAR)
enable texture coordinate generation
Definition: glvertex_api.h:788
lgl::lglRotateY
void lglRotateY(double angle)
rotate about y-axis in immediate mode fashion
Definition: glvertex_core.h:2253
lglLightParameters
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
lglLinkGLSLProgram
GLuint lglLinkGLSLProgram(GLuint vertex_shader_id, GLuint fragment_shader_id, GLuint custom_shader_program=0)
link GLSL program
Definition: glvertex_api.h:520
lgl::lglGetWarning
static std::string lglGetWarning()
get a description of the last occured warning
Definition: glvertex_core.h:5131
lgl::lglBasicGLSLVertexShader
static std::string lglBasicGLSLVertexShader(bool colors=false, bool normals=false, bool texcoords=false)
get the LGL default vertex shader
Definition: glvertex_core.h:2693
lgl::lglPrintUniforms
void lglPrintUniforms()
print GLSL uniforms
Definition: glvertex_core.h:4078
lgl::lglMapGL2GLSLVersion
static int lglMapGL2GLSLVersion(int glversion)
map gl version to glsl version
Definition: glvertex_core.h:5050
lgl::lglGetProgram
GLuint lglGetProgram() const
get the actual custom GLSL program in use
Definition: glvertex_core.h:3242
lgl::lglLight
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
lglGetModelViewMatrix
mat4 lglGetModelViewMatrix()
get actual modelview matrix
Definition: glvertex_api.h:202
lgl::lglGetModelViewMatrix
mat4 lglGetModelViewMatrix() const
get the actual modelview matrix
Definition: glvertex_core.h:2151