Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Tessellation combine callback

Help
sf_user00
2006-08-05
2013-04-17
  • sf_user00
    sf_user00
    2006-08-05

    I'm trying to use tessellation, setting a combine callback with

    (1) GL.gluTessCallback(tassellatore, GL.GLU_TESS_COMBINE, new GLUtessCombineProc(CB_COMBINE));

    where the callback function is

    Even if the parameters match with the ones of the related delegate, why the application in line (1) throws an exception like "Array size control parameter must be an integral type"?

    To work around this issue, I tried to use the other callback type, GLUtessCombineProc2, with a callback function like

    private void CB_COMBINE(RDouble coordinate, RPVoid datiVertici, RFloat pesi, RPVoid output)
    {
    }

    I know "output" must contain data for the vertex obtained by the automatic combining, but *how* do I have to set data into it?

    Thanks in advance :)

     
    • Clinton Mclean
      Clinton Mclean
      2008-01-26

      Hi,

      Did you have any success with this?

      I'm also trying tessellation with CsGL in C# and am getting a System.NullReferenceException. It's doing this with the simple callbacks like GLU_TESS_BEGIN.

      Here's the code:

      //The callback function
      void beginCallBack(uint type)
      {
           GL.glBegin(type);
      }

      // Create a new tessellation object
      tobj = new CsGL.OpenGL.GLUtesselator();

      // Set callback function
      GL.gluTessCallback(tobj, GL.GLU_TESS_BEGIN, new CsGL.OpenGL.GLUtessBeginProc(beginCallBack));

      Here's where it gives the System.NullReferenceException.

      Do you have an idea of where it's going wrong. Can you send me your code to just assign the callback?

      Thanks
      Clinton Mclean