Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation errors #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ 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) {
var tess *Tesselator = (*Tesselator)(tessPtr)
if tess == nil || tess.beginData == nil {
return
}
tess.beginData(gl.GLenum(tessType), tess.polyData)
tess.beginData(uint32(tessType), tess.polyData)
}

// ===========================================================================
Expand Down Expand Up @@ -51,15 +50,15 @@ 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) {
var tess *Tesselator = (*Tesselator)(tessPtr)
if tess == nil || tess.errorData == nil {
return
}
tess.errorData(gl.GLenum(errorNumber), tess.polyData)
tess.errorData(uint32(errorNumber), tess.polyData)
}

// ===========================================================================
Expand Down
4 changes: 1 addition & 3 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions glu.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"errors"
"reflect"
"unsafe"

"github.com/go-gl/gl"
)

func ptr(v interface{}) unsafe.Pointer {
Expand All @@ -45,15 +43,15 @@ 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")
}
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),
Expand Down
3 changes: 1 addition & 2 deletions tesselator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package glu
// #include <GL/glu.h>
// #endif
import "C"
import "github.com/go-gl/gl"
import "unsafe"

// Opaque object used for book keeping on the go side.
Expand Down Expand Up @@ -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))
}
1 change: 0 additions & 1 deletion tesselator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package glu

import (
"github.com/go-gl/gl"
"testing"
)

Expand Down