Fix examples
This commit is contained in:
parent
70aa6f5da5
commit
f61497c79d
7 changed files with 141 additions and 122 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue