Update examples
This commit is contained in:
parent
a62b332ffc
commit
363905fef0
17 changed files with 27 additions and 114 deletions
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -39,9 +39,6 @@ func main() {
|
|||
// Create a RenderTexture2D to be used for render to texture
|
||||
target := rl.LoadRenderTexture(screenWidth, screenHeight)
|
||||
|
||||
// Setup orbital camera
|
||||
rl.SetCameraMode(camera, rl.CameraOrbital) // Set an orbital camera mode
|
||||
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
for !rl.WindowShouldClose() {
|
||||
|
@ -55,7 +52,7 @@ func main() {
|
|||
// Send new value to the shader to be used on drawing
|
||||
rl.SetShaderValue(shader, swirlCenterLoc, swirlCenter, rl.ShaderUniformVec2)
|
||||
|
||||
rl.UpdateCamera(&camera) // Update camera
|
||||
rl.UpdateCamera(&camera, rl.CameraOrbital) // Update camera with orbital camera mode
|
||||
|
||||
rl.BeginDrawing()
|
||||
|
||||
|
|
|
@ -75,8 +75,6 @@ func main() {
|
|||
mmap := material.GetMap(rl.MapDiffuse)
|
||||
mmap.Color = rl.Red
|
||||
|
||||
rl.SetCameraMode(camera, rl.CameraOrbital)
|
||||
|
||||
rl.SetTargetFPS(int32(fps))
|
||||
for !rl.WindowShouldClose() {
|
||||
// Update
|
||||
|
@ -187,7 +185,7 @@ func main() {
|
|||
transforms[i] = rl.MatrixMultiply(transforms[i], rl.MatrixTranslate(0.0, y, 0.0))
|
||||
}
|
||||
|
||||
rl.UpdateCamera(&camera) // Update camera
|
||||
rl.UpdateCamera(&camera, rl.CameraOrbital) // Update camera with orbital camera mode
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -29,12 +29,10 @@ func main() {
|
|||
|
||||
position := rl.NewVector3(0.0, 0.0, 0.0) // Set model position
|
||||
|
||||
rl.SetCameraMode(camera, rl.CameraFree) // Set free camera mode
|
||||
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
for !rl.WindowShouldClose() {
|
||||
rl.UpdateCamera(&camera) // Update camera
|
||||
rl.UpdateCamera(&camera, rl.CameraFree) // Update camera with free camera mode
|
||||
|
||||
rl.BeginDrawing()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
const MaxPostproShaders = 12
|
||||
|
@ -77,12 +77,10 @@ func main() {
|
|||
// Create a RenderTexture2D to be used for render to texture
|
||||
target := rl.LoadRenderTexture(screenWidth, screenHeight)
|
||||
|
||||
rl.SetCameraMode(camera, rl.CameraOrbital) // Set free camera mode
|
||||
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
for !rl.WindowShouldClose() {
|
||||
rl.UpdateCamera(&camera) // Update camera
|
||||
rl.UpdateCamera(&camera, rl.CameraOrbital) // Update camera with orbital camera mode
|
||||
|
||||
if rl.IsKeyPressed(rl.KeyRight) {
|
||||
currentShader++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue