Fix examples

This commit is contained in:
Milan Nikolic 2018-10-09 12:36:54 +02:00
parent 70aa6f5da5
commit f61497c79d
7 changed files with 141 additions and 122 deletions

View file

@ -32,7 +32,6 @@ func main() {
rl.UpdateCamera(&camera) // Update camera
if rl.IsMouseButtonPressed(rl.MouseLeftButton) {
// NOTE: This function is NOT WORKING properly!
ray = rl.GetMouseRay(rl.GetMousePosition(), camera)
// Check collision between ray and box

View file

@ -35,10 +35,10 @@ func main() {
rl.DrawRectangle(0, int32(85+40*i), screenWidth, 40, rl.Fade(rl.LightGray, 0.3))
}
rl.DrawText(droppedFiles[i], 120, int32(100), 10, rl.Gray)
rl.DrawText(droppedFiles[i], 120, int32(100+i*40), 10, rl.Gray)
}
rl.DrawText("Drop new files...", 100, int32(150), 20, rl.DarkGray)
rl.DrawText("Drop new files...", 100, int32(150+count*40), 20, rl.DarkGray)
}
rl.EndDrawing()

View file

@ -26,7 +26,7 @@ func main() {
rl.DrawRectangle(screenWidth/2-40, boxPositionY, 80, 80, rl.Maroon)
rl.DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, rl.Gray)
rl.DrawText("Use mouse wheel to move the square up and down!", 10, 10, 20, rl.Gray)
rl.DrawText(fmt.Sprintf("Box position Y: %d", boxPositionY), 10, 40, 20, rl.LightGray)
rl.EndDrawing()

View file

@ -5,15 +5,11 @@ import (
)
func main() {
screenWidth := int32(1080)
screenHeight := int32(600)
// NOTE: screenWidth/screenHeight should match VR device aspect ratio
rl.InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator")
hmd := rl.GetVrDeviceInfo(rl.HmdOculusRiftCv1) // Oculus Rift CV1
rl.InitWindow(int32(hmd.HScreenSize), int32(hmd.VScreenSize), "raylib [core] example - vr simulator")
// NOTE: default device (simulator)
rl.InitVrSimulator(rl.GetVrDeviceInfo(rl.HmdOculusRiftCv1)) // Init VR device (Oculus Rift CV1)
rl.InitVrSimulator(hmd) // Init VR device
camera := rl.Camera{}
camera.Position = rl.NewVector3(5.0, 2.0, 5.0) // Camera position