From 1f29aec69c02f6f5eb3a8de6158b90efaaaf7cde Mon Sep 17 00:00:00 2001 From: Josh Mandle Date: Tue, 6 Oct 2015 20:03:08 +0200 Subject: [PATCH] Fixed compilation errors --- callback.go | 9 ++++----- constants.go | 4 +--- glu.go | 6 ++---- tesselator.go | 3 +-- tesselator_test.go | 1 - 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/callback.go b/callback.go index bef4fb5..da35fb5 100644 --- a/callback.go +++ b/callback.go @@ -6,12 +6,11 @@ package glu //#include "callback.h" import "C" -import "github.com/go-gl/gl" import "unsafe" // =========================================================================== -type TessBeginHandler func(tessType gl.GLenum, polygonData interface{}) +type TessBeginHandler func(tessType uint32, polygonData interface{}) //export goTessBeginData func goTessBeginData(tessType C.GLenum, tessPtr unsafe.Pointer) { @@ -19,7 +18,7 @@ func goTessBeginData(tessType C.GLenum, tessPtr unsafe.Pointer) { if tess == nil || tess.beginData == nil { return } - tess.beginData(gl.GLenum(tessType), tess.polyData) + tess.beginData(uint32(tessType), tess.polyData) } // =========================================================================== @@ -51,7 +50,7 @@ func goTessEndData(tessPtr unsafe.Pointer) { // =========================================================================== -type TessErrorHandler func(errorNumber gl.GLenum, polygonData interface{}) +type TessErrorHandler func(errorNumber uint32, polygonData interface{}) //export goTessErrorData func goTessErrorData(errorNumber C.GLenum, tessPtr unsafe.Pointer) { @@ -59,7 +58,7 @@ func goTessErrorData(errorNumber C.GLenum, tessPtr unsafe.Pointer) { if tess == nil || tess.errorData == nil { return } - tess.errorData(gl.GLenum(errorNumber), tess.polyData) + tess.errorData(uint32(errorNumber), tess.polyData) } // =========================================================================== diff --git a/constants.go b/constants.go index 6ae5cae..c79ac8b 100644 --- a/constants.go +++ b/constants.go @@ -4,11 +4,9 @@ package glu -import "github.com/go-gl/gl" - const ( // TessCallback - TESS_BEGIN_DATA gl.GLenum = 100106 + TESS_BEGIN_DATA uint32 = 100106 TESS_VERTEX_DATA = 100107 TESS_END_DATA = 100108 TESS_ERROR_DATA = 100109 diff --git a/glu.go b/glu.go index 54b226b..1bf1a81 100644 --- a/glu.go +++ b/glu.go @@ -18,8 +18,6 @@ import ( "errors" "reflect" "unsafe" - - "github.com/go-gl/gl" ) func ptr(v interface{}) unsafe.Pointer { @@ -45,7 +43,7 @@ func ptr(v interface{}) unsafe.Pointer { return unsafe.Pointer(et.UnsafeAddr()) } -func ErrorString(error gl.GLenum) (string, error) { +func ErrorString(error uint32) (string, error) { e := unsafe.Pointer(C.gluErrorString(C.GLenum(error))) if e == nil { return "", errors.New("Invalid GL error code") @@ -53,7 +51,7 @@ func ErrorString(error gl.GLenum) (string, error) { return C.GoString((*C.char)(e)), nil } -func Build2DMipmaps(target gl.GLenum, internalFormat int, width, height int, format, typ gl.GLenum, data interface{}) int { +func Build2DMipmaps(target uint32, internalFormat int, width, height int, format, typ uint32, data interface{}) int { return int(C.gluBuild2DMipmaps( C.GLenum(target), C.GLint(internalFormat), diff --git a/tesselator.go b/tesselator.go index 270245e..af84a8f 100644 --- a/tesselator.go +++ b/tesselator.go @@ -10,7 +10,6 @@ package glu // #include // #endif import "C" -import "github.com/go-gl/gl" import "unsafe" // Opaque object used for book keeping on the go side. @@ -108,6 +107,6 @@ func (tess *Tesselator) Normal(valueX, valueY, valueZ float64) { } // Set a property of the tesselator. -func (tess *Tesselator) Property(which gl.GLenum, data float64) { +func (tess *Tesselator) Property(which uint32, data float64) { C.gluTessProperty(tess.tess, C.GLenum(which), C.GLdouble(data)) } diff --git a/tesselator_test.go b/tesselator_test.go index c643f9b..548e61d 100644 --- a/tesselator_test.go +++ b/tesselator_test.go @@ -5,7 +5,6 @@ package glu import ( - "github.com/go-gl/gl" "testing" )