From 5d9fdd53134e84a9f0750efa32bd9d6e8e4f35cc Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:42:27 +0100 Subject: [PATCH] rlgl: rlSetClipPlanes, rlGetCullDistanceNear and rlGetCullDistanceFar added --- raylib/rlgl_cgo.go | 17 +++++++++++++++++ raylib/rlgl_purego.go | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/raylib/rlgl_cgo.go b/raylib/rlgl_cgo.go index c0801a7..3e4bf5f 100644 --- a/raylib/rlgl_cgo.go +++ b/raylib/rlgl_cgo.go @@ -127,6 +127,23 @@ func Viewport(x int32, y int32, width int32, height int32) { C.rlViewport(cx, cy, cwidth, cheight) } +// SetClipPlanes - Set clip planes distances +func SetClipPlanes(nearPlane, farPlane float64) { + C.rlSetClipPlanes(C.double(nearPlane), C.double(farPlane)) +} + +// GetCullDistanceNear - Get cull plane distance near +func GetCullDistanceNear() float64 { + ret := C.rlGetCullDistanceNear() + return float64(ret) +} + +// GetCullDistanceFar - Get cull plane distance far +func GetCullDistanceFar() float64 { + ret := C.rlGetCullDistanceFar() + return float64(ret) +} + // Begin - Initialize drawing mode (how to organize vertex) func Begin(mode int32) { cmode := C.int(mode) diff --git a/raylib/rlgl_purego.go b/raylib/rlgl_purego.go index 27e5deb..2f35033 100644 --- a/raylib/rlgl_purego.go +++ b/raylib/rlgl_purego.go @@ -20,6 +20,9 @@ var rlMultMatrixf func(matf *float32) var rlFrustum func(left float64, right float64, bottom float64, top float64, znear float64, zfar float64) var rlOrtho func(left float64, right float64, bottom float64, top float64, znear float64, zfar float64) var rlViewport func(x int32, y int32, width int32, height int32) +var rlSetClipPlanes func(float64, float64) +var rlGetCullDistanceNear func() float64 +var rlGetCullDistanceFar func() float64 var rlBegin func(mode int32) var rlEnd func() var rlVertex2i func(x int32, y int32) @@ -143,6 +146,9 @@ func initRlglPurego() { purego.RegisterLibFunc(&rlFrustum, raylibDll, "rlFrustum") purego.RegisterLibFunc(&rlOrtho, raylibDll, "rlOrtho") purego.RegisterLibFunc(&rlViewport, raylibDll, "rlViewport") + purego.RegisterLibFunc(&rlSetClipPlanes, raylibDll, "rlSetClipPlanes") + purego.RegisterLibFunc(&rlGetCullDistanceNear, raylibDll, "rlGetCullDistanceNear") + purego.RegisterLibFunc(&rlGetCullDistanceFar, raylibDll, "rlGetCullDistanceFar") purego.RegisterLibFunc(&rlBegin, raylibDll, "rlBegin") purego.RegisterLibFunc(&rlEnd, raylibDll, "rlEnd") purego.RegisterLibFunc(&rlVertex2i, raylibDll, "rlVertex2i") @@ -321,6 +327,21 @@ func Viewport(x int32, y int32, width int32, height int32) { rlViewport(x, y, width, height) } +// SetClipPlanes - Set clip planes distances +func SetClipPlanes(nearPlane, farPlane float64) { + rlSetClipPlanes(nearPlane, farPlane) +} + +// GetCullDistanceNear - Get cull plane distance near +func GetCullDistanceNear() float64 { + return rlGetCullDistanceNear() +} + +// GetCullDistanceFar - Get cull plane distance far +func GetCullDistanceFar() float64 { + return rlGetCullDistanceFar() +} + // Begin - Initialize drawing mode (how to organize vertex) func Begin(mode int32) { rlBegin(mode)