Commit b5f506b5 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Potential segfault fix on windows

parent 519064d0
......@@ -150,7 +150,7 @@ private:
typedef void (CALLBACK * FunctionPointerType)();
// Static Combine callback for tesselation
static void TesselationCombineCallback(GLdouble coords[3],GLdouble * data[4], GLfloat weights[4],GLdouble **dataOut)
static void CALLBACK TesselationCombineCallback(GLdouble coords[3],GLdouble * data[4], GLfloat weights[4],GLdouble **dataOut)
{
GLdouble * vertex = new GLdouble[3];
vertex[0] = coords[0];
......@@ -160,11 +160,30 @@ private:
}
// Static error callback fir tesselation
static void TesselationErrorCallback(GLenum errorCode)
static void CALLBACK TesselationErrorCallback(GLenum errorCode)
{
const GLubyte * estring = gluErrorString(errorCode);
itkGenericExceptionMacro(<<"Glu Tesselation error: "<<estring);
}
// Static begin callback for tesselation
static void CALLBACK BeginCallback(GLenum prim)
{
glBegin(prim);
}
// Static end callback for tesselation
static void CALLBACK EndCallback()
{
glEnd();
}
// static vertex callback for tesselation
static void CALLBACK VertexCallback(void * data)
{
glVertex3dv((GLdouble*)data);
}
/// Pointer to the vector data to render
VectorDataPointerType m_VectorData;
......
......@@ -44,10 +44,10 @@ VectorDataGlComponent<TVectorData>
m_GluTesselator = gluNewTess();
// Setting up the tesselator callbacks
gluTessCallback(m_GluTesselator,GLU_TESS_BEGIN, (FunctionPointerType) glBegin);
gluTessCallback(m_GluTesselator,GLU_TESS_END, (FunctionPointerType) glEnd);
gluTessCallback(m_GluTesselator,GLU_TESS_BEGIN, (FunctionPointerType) BeginCallback);
gluTessCallback(m_GluTesselator,GLU_TESS_END, (FunctionPointerType) EndCallback);
gluTessCallback(m_GluTesselator,GLU_TESS_ERROR, (FunctionPointerType) TesselationErrorCallback);
gluTessCallback(m_GluTesselator,GLU_TESS_VERTEX, (FunctionPointerType) glVertex3dv);
gluTessCallback(m_GluTesselator,GLU_TESS_VERTEX, (FunctionPointerType) VertexCallback);
gluTessCallback(m_GluTesselator,GLU_TESS_COMBINE,(FunctionPointerType) TesselationCombineCallback);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment