mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Merge remote-tracking branch 'offical/master'
# Conflicts: # vendor/raylib/raygui.odin # vendor/raylib/raylib.odin
This commit is contained in:
Vendored
+6
-1
@@ -2,7 +2,8 @@ package raylib
|
||||
|
||||
import "core:c"
|
||||
|
||||
RAYGUI_SHARED :: #config(RAYGUI_SHARED, true)
|
||||
RAYGUI_SHARED :: #config(RAYGUI_SHARED, false)
|
||||
RAYGUI_WASM_LIB :: #config(RAYGUI_WASM_LIB, "wasm/libraygui.a")
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
foreign import lib {
|
||||
@@ -22,6 +23,10 @@ when ODIN_OS == .Windows {
|
||||
"macos/libraygui.dylib" when RAYGUI_SHARED else "macos/libraygui.a",
|
||||
}
|
||||
}
|
||||
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
||||
foreign import lib {
|
||||
RAYGUI_WASM_LIB,
|
||||
}
|
||||
} else {
|
||||
foreign import lib "system:raygui"
|
||||
}
|
||||
|
||||
Vendored
+34
-1
@@ -99,7 +99,8 @@ MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
|
||||
|
||||
#assert(size_of(rune) == size_of(c.int))
|
||||
|
||||
RAYLIB_SHARED :: #config(RAYLIB_SHARED, true)
|
||||
RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)
|
||||
RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "wasm/libraylib.a")
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
@(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt"))
|
||||
@@ -127,6 +128,10 @@ when ODIN_OS == .Windows {
|
||||
"system:OpenGL.framework",
|
||||
"system:IOKit.framework",
|
||||
}
|
||||
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
||||
foreign import lib {
|
||||
RAYLIB_WASM_LIB,
|
||||
}
|
||||
} else {
|
||||
foreign import lib "system:raylib"
|
||||
}
|
||||
@@ -845,6 +850,17 @@ Gesture :: enum c.uint {
|
||||
}
|
||||
Gestures :: distinct bit_set[Gesture; c.uint]
|
||||
|
||||
// Camera speed values
|
||||
CAMERA_MOVE_SPEED :: 5.4
|
||||
CAMERA_ROTATION_SPEED :: 0.03
|
||||
CAMERA_PAN_SPEED :: 0.2
|
||||
|
||||
// Camera mouse movement sensitivity
|
||||
CAMERA_MOUSE_MOVE_SENSITIVITY :: 0.003
|
||||
|
||||
// Camera orbital speed in CAMERA_ORBITAL mode
|
||||
CAMERA_ORBITAL_SPEED :: 0.5
|
||||
|
||||
// Camera system modes
|
||||
CameraMode :: enum c.int {
|
||||
CUSTOM = 0, // Camera custom, controlled by user (UpdateCamera() does nothing)
|
||||
@@ -1181,6 +1197,23 @@ foreign lib {
|
||||
UpdateCamera :: proc(camera: ^Camera, mode: CameraMode) --- // Set camera mode (multiple camera modes available)
|
||||
UpdateCameraPro :: proc(camera: ^Camera, movement: Vector3, rotation: Vector3, zoom: f32) --- // Update camera movement/rotation
|
||||
|
||||
GetCameraForward :: proc(camera: ^Camera) -> Vector3 --- // returns the camera's forward vector (normalized)
|
||||
GetCameraUp :: proc(camera: ^Camera) -> Vector3 --- // returns the camera's up vector (normalized) - might not be perpendicular to forward vector
|
||||
GetCameraRight :: proc(camera: ^Camera) -> Vector3 --- // returns the camera's right vector (normalized)
|
||||
|
||||
// Camera Movement/Rotation. Angle is provided in radians
|
||||
|
||||
CameraMoveForward :: proc(camera: ^Camera, distance: f32, moveInWorldPlane: bool) --- // move the camera in its forward direction
|
||||
CameraMoveUp :: proc(camera: ^Camera, distance: f32) --- // move camera in its up direction
|
||||
CameraMoveRight :: proc(camera: ^Camera, distance: f32, delta: f32) --- // move camera in it's current right direction
|
||||
CameraMoveToTarget :: proc(camera: ^Camera, delta: f32) --- // moves the camera position closer/farther to/from the camera target
|
||||
CameraYaw :: proc(camera: ^Camera, angle: f32, rotateAroundTarget: bool) --- // rotates the camera around its up vector (left and right)
|
||||
CameraPitch :: proc(camera: ^Camera, angle: f32, lockView: bool, rotateAroundTarget: bool, rotateUp: bool) --- // rotates the camera around its right vector (up and down)
|
||||
CameraRoll :: proc(camera: ^Camera, angle: f32) --- // rotates the camera around its forward vector (left and right)
|
||||
|
||||
GetCameraViewMatrix :: proc(camera: ^Camera) -> Matrix --- // returns the camera view matrix
|
||||
GetCameraProjectionMatrix :: proc(camera: ^Camera, aspect: f32) -> Matrix --- // returns the camera projection matrix
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Basic Shapes Drawing Functions (Module: shapes)
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+1
-1
@@ -523,7 +523,7 @@ Vector3Unproject :: proc "c" (source: Vector3, projection: Matrix, view: Matrix)
|
||||
|
||||
quat: Quaternion
|
||||
quat.x = source.x
|
||||
quat.y = source.z
|
||||
quat.y = source.y
|
||||
quat.z = source.z
|
||||
quat.w = 1
|
||||
|
||||
|
||||
Vendored
+8
-5
@@ -113,6 +113,7 @@ import rl "../."
|
||||
VERSION :: "5.0"
|
||||
|
||||
RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)
|
||||
RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "../wasm/libraylib.a")
|
||||
|
||||
// Note: We pull in the full raylib library. If you want a truly stand-alone rlgl, then:
|
||||
// - Compile a separate rlgl library and use that in the foreign import blocks below.
|
||||
@@ -134,18 +135,20 @@ when ODIN_OS == .Windows {
|
||||
// multiple copies of raylib.so, but since these bindings are for
|
||||
// particular version of the library, I better specify it. Ideally,
|
||||
// though, it's best specified in terms of major (.so.4)
|
||||
"../linux/libraylib.so.500" when RAYLIB_SHARED else "../linux/libraylib.a",
|
||||
"../linux/libraylib.so.550" when RAYLIB_SHARED else "../linux/libraylib.a",
|
||||
"system:dl",
|
||||
"system:pthread",
|
||||
}
|
||||
} else when ODIN_OS == .Darwin {
|
||||
foreign import lib {
|
||||
"../macos" +
|
||||
("-arm64" when ODIN_ARCH == .arm64 else "") +
|
||||
"/libraylib" + (".500.dylib" when RAYLIB_SHARED else ".a"),
|
||||
"../macos/libraylib.550.dylib" when RAYLIB_SHARED else "../macos/libraylib.a",
|
||||
"system:Cocoa.framework",
|
||||
"system:OpenGL.framework",
|
||||
"system:IOKit.framework",
|
||||
}
|
||||
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
||||
foreign import lib {
|
||||
RAYLIB_WASM_LIB,
|
||||
}
|
||||
} else {
|
||||
foreign import lib "system:raylib"
|
||||
@@ -511,7 +514,7 @@ foreign lib {
|
||||
UpdateVertexBufferElements :: proc(id: c.uint, data: rawptr, dataSize: c.int, offset: c.int) --- // Update vertex buffer elements with new data
|
||||
UnloadVertexArray :: proc(vaoId: c.uint) ---
|
||||
UnloadVertexBuffer :: proc(vboId: c.uint) ---
|
||||
SetVertexAttribute :: proc(index: c.uint, compSize: c.int, type: c.int, normalized: bool, stride: c.int, pointer: rawptr) ---
|
||||
SetVertexAttribute :: proc(index: c.uint, compSize: c.int, type: c.int, normalized: bool, stride: c.int, offset: c.int) ---
|
||||
SetVertexAttributeDivisor :: proc(index: c.uint, divisor: c.int) ---
|
||||
SetVertexAttributeDefault :: proc(locIndex: c.int, value: rawptr, attribType: c.int, count: c.int) --- // Set vertex attribute default value
|
||||
DrawVertexArray :: proc(offset: c.int, count: c.int) ---
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user