From ccc22a8f5fc8cd2d1bd8b32f85a866bc0efe1819 Mon Sep 17 00:00:00 2001 From: Tomek Date: Mon, 1 Aug 2011 14:43:01 +0000 Subject: [PATCH] [GB.OPENGL] * NEW: Nurbs functions * NEW: Basic quadratic shapes (sphere, cylinder, cone, disk) git-svn-id: svn://localhost/gambas/trunk@3960 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.opengl/src/glu/GLU.c | 32 ++++++++++++++++++++++++++++++-- gb.opengl/src/glu/Makefile.am | 5 +++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/gb.opengl/src/glu/GLU.c b/gb.opengl/src/glu/GLU.c index 704095d45..5ae64cb35 100644 --- a/gb.opengl/src/glu/GLU.c +++ b/gb.opengl/src/glu/GLU.c @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ @@ -27,6 +26,8 @@ #include "GLUcoordTransf.h" #include "GLUtextureImage.h" +#include "GLUquadratic.h" +#include "GLUnurb.h" BEGIN_METHOD(GLUERRORSTRING, GB_INTEGER code) @@ -55,6 +56,33 @@ GB_DESC Cglu[] = GB_STATIC_METHOD("Build2DMipmaps", "i", GLUBUILD2DMIPMAPS, "(Image)Image;"), /* Quadratics - see GLUquadratic.h */ + GB_STATIC_METHOD("NewQuadric", "p", GLUNEWQUADRIC, NULL), + GB_STATIC_METHOD("QuadricNormals", NULL, GLUQUADRICNORMALS, "(Quad)p(Normal)i"), + GB_STATIC_METHOD("QuadricTexture", NULL, GLUQUADRICTEXTURE, "(Quad)p(Texture)b"), + GB_STATIC_METHOD("DeleteQuadric", NULL, GLUDELETEQUADRIC, "(Quad)p"), + GB_STATIC_METHOD("Sphere", NULL, GLUSPHERE, "(Quad)p(Radius)f(Slices)i(Stacks)i"), + GB_STATIC_METHOD("Cylinder", NULL, GLUCYLINDER, "(Quad)p(Base)f(Top)f(Height)f(Slices)i(Stacks)i"), + GB_STATIC_METHOD("Disk", NULL, GLUDISK, "(Quad)p(Inner)f(Outer)f(Slices)i(Loops)i"), + GB_STATIC_METHOD("PartialDisk", NULL, GLUPARTIALDISK, "(Quad)p(Inner)f(Outer)f(Slices)i(Loops)i(Start)f(Sweep)f"), + + /* NURBS - SEE GLUnurbs.h */ + GB_STATIC_METHOD("BeginCurve", NULL, GLUBEGINCURVE, "(nurb)p"), + GB_STATIC_METHOD("BeginSurface", NULL, GLUBEGINSURFACE, "(nurb)p"), + GB_STATIC_METHOD("BeginTrim", NULL, GLUBEGINTRIM, "(nurb)p"), + GB_STATIC_METHOD("DeleteNurbsRenderer", NULL, GLUDELETENURBSRENDERER, "(nurb)p"), + GB_STATIC_METHOD("EndCurve", NULL, GLUENDCURVE, "(nurb)p"), + GB_STATIC_METHOD("EndSurface", NULL, GLUENDSURFACE, "(nurb)p"), + GB_STATIC_METHOD("EndTrim", NULL, GLUENDTRIM, "(nurb)p"), + /*GB_STATIC_METHOD(GLUGETNURBSPROPERTY); + GB_STATIC_METHOD(GLULOADSAMPLINGMATRICES); + GB_STATIC_METHOD(GLUNURBSCALLBACK); + GB_STATIC_METHOD(GLUNURBSCALLBACKDATA); + GB_STATIC_METHOD(GLUNURBSCALLBACKDATAEXT);*/ + GB_STATIC_METHOD("NurbsCurve", NULL, GLUNURBSCURVE, "(nurb)p(knotCount)i(knots)Single[];(stride)i(control)Single[];(order)i(type)i"), + GB_STATIC_METHOD("NurbsProperty", NULL, GLUNURBSPROPERTY, "(nurb)p(property)i(value)f"), + GB_STATIC_METHOD("NurbsSurface", NULL, GLUNURBSSURFACE, "(nurb)p(sKnotCount)i(sKnots)Single[];(tKnotCount)i(tKnots)Single[];(sStride)i(tStride)i(sOrder)i(tOrder)i(type)i(control)Single[]"), + GB_STATIC_METHOD("NewNurbsRenderer","p", GLUNEWNURBSRENDERER, NULL), + //GB_STATIC_METHOD("PwlCurve", NULL, GLUPWLCURVE, "(nurb)p(count)i(stride)i(type)f(data)Float[]"), /********************/ diff --git a/gb.opengl/src/glu/Makefile.am b/gb.opengl/src/glu/Makefile.am index 929094c82..25e15162e 100644 --- a/gb.opengl/src/glu/Makefile.am +++ b/gb.opengl/src/glu/Makefile.am @@ -11,5 +11,6 @@ gb_opengl_glu_la_SOURCES = \ main.h main.c \ GLU.h GLU.c \ GLUcoordTransf.h GLUcoordTransf.c \ - GLUtextureImage.h GLUtextureImage.c - + GLUtextureImage.h GLUtextureImage.c \ + GLUquadratics.h GLUquadratic.c \ + GLUnurb.h GLUnurb.c