This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi,
using an advice by Andre Bleau a year ago, I got the two tessellation examples (tess.c and tesswind.c) from OpenGL working. However, the example below, slightly different from tess.c doesn't work. I get a segmentation fault, but I have no idea how to solve the problem.
I would appreciate any help as this is
a reduced case of a larger program which works well on linux,
and that I'd love to port on cygwin. I suspect this problem is related with tessellation, but I am not sure.
Thanks in advance,
Denis
$ gcc -g -o mytess mytess.c -lopengl32 -lglu32 -lglut32
First thing: the proper order for linking is -lglut32 -lglu32 -lopengl32 , as documented in /usr/share/doc/opengl-1.1.0/README.txt Order is important; you were just lucky this time.
-> ------------------------------------------------------------------------
$mytess.exe Ok here Segmentation fault (core dumped)
...
// adapted from tess.c
#include <GL/glut.h> #include <stdlib.h> #include <stdio.h>
#ifndef CALLBACK #define CALLBACK __attribute__ ((__stdcall__)) #endif
...
void CALLBACK vertexCallback(GLvoid *vertex) { const GLdouble *pointer;
pointer = (GLdouble *) vertex; glColor3dv(pointer+3); glVertex3dv(vertex); }
...
void tess_properties(GLUtesselator *tobj) { gluTessProperty (tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE); gluTessCallback(tobj, GLU_TESS_VERTEX,(_GLUfuncptr)glVertex3dv); gluTessCallback(tobj, GLU_TESS_BEGIN,(_GLUfuncptr)beginCallback); gluTessCallback(tobj, GLU_TESS_END,(_GLUfuncptr)endCallback); gluTessCallback(tobj, GLU_TESS_ERROR,(_GLUfuncptr)errorCallback); gluTessCallback(tobj, GLU_TESS_COMBINE, (_GLUfuncptr)combineCallback); gluTessCallback(tobj, GLU_TESS_VERTEX_DATA,(_GLUfuncptr)&vertexCallback); }
...
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |