g4tools  5.4.0
gl2ps_begin.icc
Go to the documentation of this file.
1 
2 #include "gl2ps_def.h"
3 
4 /*----------------------------------------------------------*/
5 /*----------------------------------------------------------*/
6 /*----------------------------------------------------------*/
7 
8 inline tools_GLboolean tools_dummy_glIsEnabled (tools_GLenum) {return TOOLS_GL_FALSE;}
9 inline void tools_dummy_glBegin (tools_GLenum) {}
10 inline void tools_dummy_glEnd () {}
11 inline void tools_dummy_glGetFloatv (tools_GLenum,tools_GLfloat*) {}
12 inline void tools_dummy_glVertex3f (tools_GLfloat,tools_GLfloat,tools_GLfloat) {}
13 inline void tools_dummy_glGetBooleanv (tools_GLenum,tools_GLboolean*) {}
14 inline void tools_dummy_glGetIntegerv (tools_GLenum,tools_GLint*) {}
15 inline tools_GLint tools_dummy_glRenderMode (tools_GLenum) {return 0;}
16 inline void tools_dummy_glFeedbackBuffer (tools_GLsizei,tools_GLenum,tools_GLfloat*) {}
17 inline void tools_dummy_glPassThrough (tools_GLfloat ) {}
18 
19 inline tools_gl2ps_gl_funcs_t& tools_gl2ps_get_s_funcs() {
20  static tools_gl2ps_gl_funcs_t s_gl_funcs = {
21  tools_dummy_glIsEnabled,
22  tools_dummy_glBegin,
23  tools_dummy_glEnd,
24  tools_dummy_glGetFloatv,
25  tools_dummy_glVertex3f,
26  tools_dummy_glGetBooleanv,
27  tools_dummy_glGetIntegerv,
28  tools_dummy_glRenderMode,
29  tools_dummy_glFeedbackBuffer,
30  tools_dummy_glPassThrough
31  };
32  return s_gl_funcs;
33 }
34 
35 TOOLS_GL2PSDLL_API void tools_gl2ps_set_gl_funcs(tools_gl2ps_gl_funcs_t* a_funcs) {
36  tools_gl2ps_gl_funcs_t& s_gl_funcs = tools_gl2ps_get_s_funcs();
37  s_gl_funcs.m_glIsEnabled = a_funcs->m_glIsEnabled;
38  s_gl_funcs.m_glBegin = a_funcs->m_glBegin;
39  s_gl_funcs.m_glEnd = a_funcs->m_glEnd;
40  s_gl_funcs.m_glGetFloatv = a_funcs->m_glGetFloatv;
41  s_gl_funcs.m_glVertex3f = a_funcs->m_glVertex3f;
42  s_gl_funcs.m_glGetBooleanv = a_funcs->m_glGetBooleanv;
43  s_gl_funcs.m_glGetIntegerv = a_funcs->m_glGetIntegerv;
44  s_gl_funcs.m_glRenderMode = a_funcs->m_glRenderMode;
45  s_gl_funcs.m_glFeedbackBuffer = a_funcs->m_glFeedbackBuffer;
46  s_gl_funcs.m_glPassThrough = a_funcs->m_glPassThrough;
47 }
48 
49 TOOLS_GL2PSDLL_API void tools_gl2ps_reset_gl_funcs() {
50  tools_gl2ps_gl_funcs_t& s_gl_funcs = tools_gl2ps_get_s_funcs();
51  s_gl_funcs.m_glIsEnabled = tools_dummy_glIsEnabled;
52  s_gl_funcs.m_glBegin = tools_dummy_glBegin;
53  s_gl_funcs.m_glEnd = tools_dummy_glEnd;
54  s_gl_funcs.m_glGetFloatv = tools_dummy_glGetFloatv;
55  s_gl_funcs.m_glVertex3f = tools_dummy_glVertex3f;
56  s_gl_funcs.m_glGetBooleanv = tools_dummy_glGetBooleanv;
57  s_gl_funcs.m_glGetIntegerv = tools_dummy_glGetIntegerv;
58  s_gl_funcs.m_glRenderMode = tools_dummy_glRenderMode;
59  s_gl_funcs.m_glFeedbackBuffer = tools_dummy_glFeedbackBuffer;
60  s_gl_funcs.m_glPassThrough = tools_dummy_glPassThrough;
61 }
62 
63 #define tools_glIsEnabled (*(tools_gl2ps_get_s_funcs().m_glIsEnabled))
64 #define tools_glBegin (*(tools_gl2ps_get_s_funcs().m_glBegin))
65 #define tools_glEnd (*(tools_gl2ps_get_s_funcs().m_glEnd))
66 #define tools_glGetFloatv (*(tools_gl2ps_get_s_funcs().m_glGetFloatv))
67 #define tools_glVertex3f (*(tools_gl2ps_get_s_funcs().m_glVertex3f))
68 #define tools_glGetBooleanv (*(tools_gl2ps_get_s_funcs().m_glGetBooleanv))
69 #define tools_glGetIntegerv (*(tools_gl2ps_get_s_funcs().m_glGetIntegerv))
70 #define tools_glRenderMode (*(tools_gl2ps_get_s_funcs().m_glRenderMode))
71 #define tools_glFeedbackBuffer (*(tools_gl2ps_get_s_funcs().m_glFeedbackBuffer))
72 #define tools_glPassThrough (*(tools_gl2ps_get_s_funcs().m_glPassThrough))
73 
74 /*----------------------------------------------------------*/
75 /*----------------------------------------------------------*/
76 /*----------------------------------------------------------*/
77 #include <stdlib.h>
78 #include <stdio.h>