79 lines
3.7 KiB
Plaintext
79 lines
3.7 KiB
Plaintext
|
|
#include "gl2ps_def.h"
|
|
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
|
|
inline tools_GLboolean tools_dummy_glIsEnabled (tools_GLenum) {return TOOLS_GL_FALSE;}
|
|
inline void tools_dummy_glBegin (tools_GLenum) {}
|
|
inline void tools_dummy_glEnd () {}
|
|
inline void tools_dummy_glGetFloatv (tools_GLenum,tools_GLfloat*) {}
|
|
inline void tools_dummy_glVertex3f (tools_GLfloat,tools_GLfloat,tools_GLfloat) {}
|
|
inline void tools_dummy_glGetBooleanv (tools_GLenum,tools_GLboolean*) {}
|
|
inline void tools_dummy_glGetIntegerv (tools_GLenum,tools_GLint*) {}
|
|
inline tools_GLint tools_dummy_glRenderMode (tools_GLenum) {return 0;}
|
|
inline void tools_dummy_glFeedbackBuffer (tools_GLsizei,tools_GLenum,tools_GLfloat*) {}
|
|
inline void tools_dummy_glPassThrough (tools_GLfloat ) {}
|
|
|
|
inline tools_gl2ps_gl_funcs_t& tools_gl2ps_get_s_funcs() {
|
|
static tools_gl2ps_gl_funcs_t s_gl_funcs = {
|
|
tools_dummy_glIsEnabled,
|
|
tools_dummy_glBegin,
|
|
tools_dummy_glEnd,
|
|
tools_dummy_glGetFloatv,
|
|
tools_dummy_glVertex3f,
|
|
tools_dummy_glGetBooleanv,
|
|
tools_dummy_glGetIntegerv,
|
|
tools_dummy_glRenderMode,
|
|
tools_dummy_glFeedbackBuffer,
|
|
tools_dummy_glPassThrough
|
|
};
|
|
return s_gl_funcs;
|
|
}
|
|
|
|
TOOLS_GL2PSDLL_API void tools_gl2ps_set_gl_funcs(tools_gl2ps_gl_funcs_t* a_funcs) {
|
|
tools_gl2ps_gl_funcs_t& s_gl_funcs = tools_gl2ps_get_s_funcs();
|
|
s_gl_funcs.m_glIsEnabled = a_funcs->m_glIsEnabled;
|
|
s_gl_funcs.m_glBegin = a_funcs->m_glBegin;
|
|
s_gl_funcs.m_glEnd = a_funcs->m_glEnd;
|
|
s_gl_funcs.m_glGetFloatv = a_funcs->m_glGetFloatv;
|
|
s_gl_funcs.m_glVertex3f = a_funcs->m_glVertex3f;
|
|
s_gl_funcs.m_glGetBooleanv = a_funcs->m_glGetBooleanv;
|
|
s_gl_funcs.m_glGetIntegerv = a_funcs->m_glGetIntegerv;
|
|
s_gl_funcs.m_glRenderMode = a_funcs->m_glRenderMode;
|
|
s_gl_funcs.m_glFeedbackBuffer = a_funcs->m_glFeedbackBuffer;
|
|
s_gl_funcs.m_glPassThrough = a_funcs->m_glPassThrough;
|
|
}
|
|
|
|
TOOLS_GL2PSDLL_API void tools_gl2ps_reset_gl_funcs() {
|
|
tools_gl2ps_gl_funcs_t& s_gl_funcs = tools_gl2ps_get_s_funcs();
|
|
s_gl_funcs.m_glIsEnabled = tools_dummy_glIsEnabled;
|
|
s_gl_funcs.m_glBegin = tools_dummy_glBegin;
|
|
s_gl_funcs.m_glEnd = tools_dummy_glEnd;
|
|
s_gl_funcs.m_glGetFloatv = tools_dummy_glGetFloatv;
|
|
s_gl_funcs.m_glVertex3f = tools_dummy_glVertex3f;
|
|
s_gl_funcs.m_glGetBooleanv = tools_dummy_glGetBooleanv;
|
|
s_gl_funcs.m_glGetIntegerv = tools_dummy_glGetIntegerv;
|
|
s_gl_funcs.m_glRenderMode = tools_dummy_glRenderMode;
|
|
s_gl_funcs.m_glFeedbackBuffer = tools_dummy_glFeedbackBuffer;
|
|
s_gl_funcs.m_glPassThrough = tools_dummy_glPassThrough;
|
|
}
|
|
|
|
#define tools_glIsEnabled (*(tools_gl2ps_get_s_funcs().m_glIsEnabled))
|
|
#define tools_glBegin (*(tools_gl2ps_get_s_funcs().m_glBegin))
|
|
#define tools_glEnd (*(tools_gl2ps_get_s_funcs().m_glEnd))
|
|
#define tools_glGetFloatv (*(tools_gl2ps_get_s_funcs().m_glGetFloatv))
|
|
#define tools_glVertex3f (*(tools_gl2ps_get_s_funcs().m_glVertex3f))
|
|
#define tools_glGetBooleanv (*(tools_gl2ps_get_s_funcs().m_glGetBooleanv))
|
|
#define tools_glGetIntegerv (*(tools_gl2ps_get_s_funcs().m_glGetIntegerv))
|
|
#define tools_glRenderMode (*(tools_gl2ps_get_s_funcs().m_glRenderMode))
|
|
#define tools_glFeedbackBuffer (*(tools_gl2ps_get_s_funcs().m_glFeedbackBuffer))
|
|
#define tools_glPassThrough (*(tools_gl2ps_get_s_funcs().m_glPassThrough))
|
|
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|