diff --git a/examples/audio/audio_multichannel_sound/audio_multichannel_sound.go b/examples/audio/audio_multichannel_sound/audio_multichannel_sound.go deleted file mode 100644 index 345afcc..0000000 --- a/examples/audio/audio_multichannel_sound/audio_multichannel_sound.go +++ /dev/null @@ -1,66 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/gen2brain/raylib-go/raylib" -) - -func main() { - // Initialization - //-------------------------------------------------------------------------------------- - screenWidth := int32(800) - screenHeight := int32(450) - - rl.InitWindow(screenWidth, screenHeight, "raylib [audio] example - Multichannel sound playing") - - rl.InitAudioDevice() // Initialize audio device - - fxWav := rl.LoadSound("sound.wav") // Load WAV audio file - fxOgg := rl.LoadSound("target.ogg") // Load OGG audio file - - rl.SetSoundVolume(fxWav, 0.2) - - rl.SetTargetFPS(60) // Set our game to run at 60 frames-per-second - //-------------------------------------------------------------------------------------- - - // Main game loop - for !rl.WindowShouldClose() { // Detect window close button or ESC key - // Update - //---------------------------------------------------------------------------------- - if rl.IsKeyPressed(rl.KeyEnter) { - rl.PlaySoundMulti(fxWav) - } // Play a new wav sound instance - if rl.IsKeyPressed(rl.KeySpace) { - rl.PlaySoundMulti(fxOgg) - } // Play a new ogg sound instance - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - rl.BeginDrawing() - - rl.ClearBackground(rl.RayWhite) - - rl.DrawText("MULTICHANNEL SOUND PLAYING", 20, 20, 20, rl.Gray) - rl.DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, rl.LightGray) - rl.DrawText("Press ENTER to play new wav instance!", 200, 180, 20, rl.LightGray) - - rl.DrawText(fmt.Sprintf("CONCURRENT SOUNDS PLAYING: %02d", rl.GetSoundsPlaying()), 220, 280, 20, rl.Red) - - rl.EndDrawing() - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - rl.StopSoundMulti() // We must stop the buffer pool before unloading - - rl.UnloadSound(fxWav) // Unload sound data - rl.UnloadSound(fxOgg) // Unload sound data - - rl.CloseAudioDevice() // Close audio device - - rl.CloseWindow() // Close window and OpenGL context - //-------------------------------------------------------------------------------------- -} diff --git a/examples/audio/audio_multichannel_sound/sound.wav b/examples/audio/audio_multichannel_sound/sound.wav deleted file mode 100644 index b5d01c9..0000000 Binary files a/examples/audio/audio_multichannel_sound/sound.wav and /dev/null differ diff --git a/examples/audio/audio_multichannel_sound/target.ogg b/examples/audio/audio_multichannel_sound/target.ogg deleted file mode 100644 index 2b73e1c..0000000 Binary files a/examples/audio/audio_multichannel_sound/target.ogg and /dev/null differ diff --git a/examples/core/3d_camera_first_person/main.go b/examples/core/3d_camera_first_person/main.go index 5b6d5b3..7b42f47 100644 --- a/examples/core/3d_camera_first_person/main.go +++ b/examples/core/3d_camera_first_person/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) const ( @@ -29,12 +29,10 @@ func main() { colors[i] = rl.NewColor(uint8(rl.GetRandomValue(20, 255)), uint8(rl.GetRandomValue(10, 55)), 30, 255) } - rl.SetCameraMode(camera, rl.CameraFirstPerson) // Set a first person camera mode - rl.SetTargetFPS(60) for !rl.WindowShouldClose() { - rl.UpdateCamera(&camera) // Update camera + rl.UpdateCamera(&camera, rl.CameraFirstPerson) // Update camera with first person mode rl.BeginDrawing() diff --git a/examples/core/3d_camera_free/main.go b/examples/core/3d_camera_free/main.go index 6dd86d7..dd48372 100644 --- a/examples/core/3d_camera_free/main.go +++ b/examples/core/3d_camera_free/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -16,12 +16,10 @@ func main() { cubePosition := rl.NewVector3(0.0, 0.0, 0.0) - rl.SetCameraMode(camera, rl.CameraFree) // Set a 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 if rl.IsKeyDown(rl.KeyZ) { camera.Target = rl.NewVector3(0.0, 0.0, 0.0) diff --git a/examples/core/3d_picking/main.go b/examples/core/3d_picking/main.go index 3a2b6ce..9b00382 100644 --- a/examples/core/3d_picking/main.go +++ b/examples/core/3d_picking/main.go @@ -23,12 +23,10 @@ func main() { var ray rl.Ray var collision rl.RayCollision - rl.SetCameraMode(camera, rl.CameraFree) // Set a 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 if rl.IsMouseButtonPressed(rl.MouseLeftButton) { if !collision.Hit { diff --git a/examples/core/world_screen/main.go b/examples/core/world_screen/main.go index e7aa921..fee789d 100644 --- a/examples/core/world_screen/main.go +++ b/examples/core/world_screen/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -19,12 +19,10 @@ func main() { cubePosition := rl.NewVector3(0.0, 0.0, 0.0) cubeScreenPosition := rl.Vector2{} - rl.SetCameraMode(camera, rl.CameraFree) // Set a 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 // Calculate cube screen space position (with a little offset to be in top) cubeScreenPosition = rl.GetWorldToScreen(rl.NewVector3(cubePosition.X, cubePosition.Y+2.5, cubePosition.Z), camera) diff --git a/examples/go.mod b/examples/go.mod index 0929d18..254e9b2 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -3,8 +3,8 @@ module examples go 1.19 require ( - github.com/gen2brain/raylib-go/physics v0.0.0-20230307111832-5dcd22c1f844 - github.com/gen2brain/raylib-go/raylib v0.0.0-20230307112435-42e75c98a85b + github.com/gen2brain/raylib-go/physics v0.0.0-20230413172235-a62b332ffc4a + github.com/gen2brain/raylib-go/raylib v0.0.0-20230413172235-a62b332ffc4a github.com/jakecoffman/cp v1.2.1 github.com/neguse/go-box2d-lite v0.0.0-20170921151050-5d8ed9b7272b ) diff --git a/examples/go.sum b/examples/go.sum index 722ec8e..d618d70 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -1,7 +1,7 @@ -github.com/gen2brain/raylib-go/physics v0.0.0-20230307111832-5dcd22c1f844 h1:Ujsq26uwt3Ee1Liif/A+61hUPEOeeRc24zZORP52Fko= -github.com/gen2brain/raylib-go/physics v0.0.0-20230307111832-5dcd22c1f844/go.mod h1:Vf/TIMnolPj/pEnPQObb/cL481gg/La8CgwibfA9gx4= -github.com/gen2brain/raylib-go/raylib v0.0.0-20230307112435-42e75c98a85b h1:YK1HMLMb37bDpjetVdsQYJ+J+40gavgbt+XP5FK3MKw= -github.com/gen2brain/raylib-go/raylib v0.0.0-20230307112435-42e75c98a85b/go.mod h1:+NbsqGlEQqGqrsgJFF5Yj2dkvn0ML2SQb8RqM2hJsPU= +github.com/gen2brain/raylib-go/physics v0.0.0-20230413172235-a62b332ffc4a h1:YiVRz76RzAgEl4UDxXK51PZp4a46ocSF3MN5RPDiKs8= +github.com/gen2brain/raylib-go/physics v0.0.0-20230413172235-a62b332ffc4a/go.mod h1:Vf/TIMnolPj/pEnPQObb/cL481gg/La8CgwibfA9gx4= +github.com/gen2brain/raylib-go/raylib v0.0.0-20230413172235-a62b332ffc4a h1:Ia3FYwv7nxvb55YZCKfiXfgLwrrQv3fbjvnSwnOAl14= +github.com/gen2brain/raylib-go/raylib v0.0.0-20230413172235-a62b332ffc4a/go.mod h1:AwtGA3aTtYdezNxEVbfchaLw/z+CuRDh2Mlxy0FbBro= github.com/jakecoffman/cp v1.2.1 h1:zkhc2Gpo9l4NLUZfeG3j33+3bQD7MkqPa+n5PdX+5mI= github.com/jakecoffman/cp v1.2.1/go.mod h1:JjY/Fp6d8E1CHnu74gWNnU0+b9VzEdUVPoJxg2PsTQg= github.com/neguse/go-box2d-lite v0.0.0-20170921151050-5d8ed9b7272b h1:+67TGbwfgeB5o03Rx+ZBW44zAQ+wUujcwdRA0p9CbJI= diff --git a/examples/models/billboard/main.go b/examples/models/billboard/main.go index c177938..627cb83 100644 --- a/examples/models/billboard/main.go +++ b/examples/models/billboard/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -20,12 +20,10 @@ func main() { bill := rl.LoadTexture("billboard.png") // Our texture billboard billPosition := rl.NewVector3(0.0, 2.0, 0.0) // Position where draw billboard - rl.SetCameraMode(camera, rl.CameraOrbital) // Set an orbital camera mode - rl.SetTargetFPS(60) for !rl.WindowShouldClose() { - rl.UpdateCamera(&camera) // Update camera + rl.UpdateCamera(&camera, rl.CameraOrbital) // Update camera with orbital camera mode rl.BeginDrawing() diff --git a/examples/models/cubicmap/main.go b/examples/models/cubicmap/main.go index bad513f..5014ac7 100644 --- a/examples/models/cubicmap/main.go +++ b/examples/models/cubicmap/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -30,14 +30,12 @@ func main() { rl.UnloadImage(image) // Unload cubicmap image from RAM, already uploaded to VRAM - rl.SetCameraMode(camera, rl.CameraOrbital) // Set an orbital camera mode - rl.SetTargetFPS(60) for !rl.WindowShouldClose() { // Update - rl.UpdateCamera(&camera) // Update camera + rl.UpdateCamera(&camera, rl.CameraOrbital) // Update camera with orbital camera mode // Draw diff --git a/examples/models/first_person_maze/main.go b/examples/models/first_person_maze/main.go index dafad58..339275d 100644 --- a/examples/models/first_person_maze/main.go +++ b/examples/models/first_person_maze/main.go @@ -46,8 +46,6 @@ func main() { mapPosition := rl.NewVector3(-16.0, 0.0, -8.0) // Set model position - rl.SetCameraMode(camera, rl.CameraFirstPerson) // Set camera mode - rl.SetTargetFPS(60) // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -57,7 +55,7 @@ func main() { //---------------------------------------------------------------------------------- oldCamPos := camera.Position // Store old camera position - rl.UpdateCamera(&camera) // Update camera + rl.UpdateCamera(&camera, rl.CameraFirstPerson) // Update camera with first person mode // Check player collision (we simplify to 2D collision detection) playerPos := rl.NewVector2(camera.Position.X, camera.Position.Z) diff --git a/examples/models/heightmap/main.go b/examples/models/heightmap/main.go index 3e7f9b9..1e9e5e7 100644 --- a/examples/models/heightmap/main.go +++ b/examples/models/heightmap/main.go @@ -3,7 +3,7 @@ package main import ( //"fmt" - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -30,14 +30,12 @@ func main() { rl.UnloadImage(image) // Unload heightmap image from RAM, already uploaded to VRAM - rl.SetCameraMode(camera, rl.CameraOrbital) // Set an orbital camera mode - rl.SetTargetFPS(60) for !rl.WindowShouldClose() { // Update - rl.UpdateCamera(&camera) // Update camera + rl.UpdateCamera(&camera, rl.CameraOrbital) // Update camera with orbital camera mode // Draw diff --git a/examples/shaders/custom_uniform/main.go b/examples/shaders/custom_uniform/main.go index 78da4a5..6a03b61 100644 --- a/examples/shaders/custom_uniform/main.go +++ b/examples/shaders/custom_uniform/main.go @@ -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() diff --git a/examples/shaders/mesh_instancing/main.go b/examples/shaders/mesh_instancing/main.go index a61c3f7..ead9762 100644 --- a/examples/shaders/mesh_instancing/main.go +++ b/examples/shaders/mesh_instancing/main.go @@ -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 diff --git a/examples/shaders/model_shader/main.go b/examples/shaders/model_shader/main.go index ad8a80e..2dc72b4 100644 --- a/examples/shaders/model_shader/main.go +++ b/examples/shaders/model_shader/main.go @@ -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() diff --git a/examples/shaders/postprocessing/main.go b/examples/shaders/postprocessing/main.go index 0f379ae..8ca9f87 100644 --- a/examples/shaders/postprocessing/main.go +++ b/examples/shaders/postprocessing/main.go @@ -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++