Merge remote-tracking branch 'offical/master'

# Conflicts:
#	vendor/raylib/raylib.odin
This commit is contained in:
ed
2024-03-05 20:24:08 -05:00
44 changed files with 1982 additions and 1143 deletions
+61
View File
@@ -0,0 +1,61 @@
//+build linux
package egl
NativeDisplayType :: distinct rawptr
NativeWindowType :: distinct rawptr
Display :: distinct rawptr
Surface :: distinct rawptr
Config :: distinct rawptr
Context :: distinct rawptr
NO_DISPLAY :: Display(uintptr(0))
NO_CONTEXT :: Context(uintptr(0))
NO_SURFACE :: Surface(uintptr(0))
CONTEXT_OPENGL_CORE_PROFILE_BIT :: 0x00000001
WINDOW_BIT :: 0x0004
OPENGL_BIT :: 0x0008
BLUE_SIZE :: 0x3022
GREEN_SIZE :: 0x3023
RED_SIZE :: 0x3024
DEPTH_SIZE :: 0x3025
STENCIL_SIZE :: 0x3026
SURFACE_TYPE :: 0x3033
NONE :: 0x3038
COLOR_BUFFER_TYPE :: 0x303F
RENDERABLE_TYPE :: 0x3040
CONFORMANT :: 0x3042
BACK_BUFFER :: 0x3084
RENDER_BUFFER :: 0x3086
GL_COLORSPACE_SRGB :: 0x3089
GL_COLORSPACE_LINEAR :: 0x308A
RGB_BUFFER :: 0x308E
GL_COLORSPACE :: 0x309D
CONTEXT_MAJOR_VERSION :: 0x3098
CONTEXT_MINOR_VERSION :: 0x30FB
CONTEXT_OPENGL_PROFILE_MASK :: 0x30FD
OPENGL_API :: 0x30A2
foreign import egl "system:EGL"
@(default_calling_convention="c", link_prefix="egl")
foreign egl {
GetDisplay :: proc(display: NativeDisplayType) -> Display ---
Initialize :: proc(display: Display, major: ^i32, minor: ^i32) -> i32 ---
BindAPI :: proc(api: u32) -> i32 ---
ChooseConfig :: proc(display: Display, attrib_list: ^i32, configs: ^Context, config_size: i32, num_config: ^i32) -> i32 ---
CreateWindowSurface :: proc(display: Display, config: Config, native_window: NativeWindowType, attrib_list: ^i32) -> Surface ---
CreateContext :: proc(display: Display, config: Config, share_context: Context, attrib_list: ^i32) -> Context ---
MakeCurrent :: proc(display: Display, draw: Surface, read: Surface, ctx: Context) -> i32 ---
SwapInterval :: proc(display: Display, interval: i32) -> i32 ---
SwapBuffers :: proc(display: Display, surface: Surface) -> i32 ---
GetProcAddress :: proc(name: cstring) -> rawptr ---
}
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
(^rawptr)(p)^ = GetProcAddress(name)
}
+3 -2
View File
@@ -149,8 +149,9 @@ WaitEvents :: glfw.WaitEvents
WaitEventsTimeout :: glfw.WaitEventsTimeout
PostEmptyEvent :: glfw.PostEmptyEvent
GetInputMode :: glfw.GetInputMode
SetInputMode :: glfw.SetInputMode
RawMouseMotionSupported :: glfw.RawMouseMotionSupported
GetInputMode :: glfw.GetInputMode
SetInputMode :: glfw.SetInputMode
GetMouseButton :: glfw.GetMouseButton
GetCursorPos :: proc "c" (window: WindowHandle) -> (xpos, ypos: f64) {
+7 -7
View File
@@ -95,7 +95,7 @@ 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)
when ODIN_OS == .Windows {
when RAYLIB_SHARED {
@@ -318,11 +318,11 @@ GlyphInfo :: struct {
// Font type, includes texture and charSet array data
Font :: struct {
baseSize: c.int, // Base size (default chars height)
charsCount: c.int, // Number of characters
charsPadding: c.int, // Padding around the chars
glyphCount: c.int, // Number of characters
glyphPadding: c.int, // Padding around the chars
texture: Texture2D, // Characters texture atlas
recs: [^]Rectangle, // Characters rectangles in texture
glyphs: [^]GlyphInfo, // Characters info data
glyphs: [^]GlyphInfo, // Characters info data
}
// Camera type, defines a camera position/orientation in 3d space
@@ -404,7 +404,7 @@ BoneInfo :: struct {
}
// Model type
Model :: struct {
Model :: struct #align(align_of(uintptr)) {
transform: Matrix, // Local transform matrix
meshCount: c.int, // Number of meshes
@@ -425,6 +425,7 @@ ModelAnimation :: struct {
frameCount: c.int, // Number of animation frames
bones: [^]BoneInfo, // Bones information (skeleton)
framePoses: [^][^]Transform, // Poses array by frame
name: [32]byte, // Animation name
}
// Ray type (useful for raycast)
@@ -490,7 +491,6 @@ VrDeviceInfo :: struct {
vResolution: c.int, // Vertical resolution in pixels
hScreenSize: f32, // Horizontal size in meters
vScreenSize: f32, // Vertical size in meters
vScreenCenter: f32, // Screen center in meters
eyeToScreenDistance: f32, // Distance between eye and display in meters
lensSeparationDistance: f32, // Lens separation distance in meters
interpupillaryDistance: f32, // IPD (distance between pupils) in meters
@@ -499,7 +499,7 @@ VrDeviceInfo :: struct {
}
// VR Stereo rendering configuration for simulator
VrStereoConfig :: struct {
VrStereoConfig :: struct #align(4) {
projection: [2]Matrix, // VR projection matrices (per eye)
viewOffset: [2]Matrix, // VR view offset matrices (per eye)
leftLensCenter: [2]f32, // VR left lens center
+2 -2
View File
@@ -88,8 +88,8 @@ foreign lib {
RWwrite :: proc(ctx: ^RWops, size: c.size_t, num: c.size_t) -> c.size_t ---
RWclose :: proc(ctx: ^RWops) -> c.int ---
LoadFile_RW :: proc(src: ^RWops, datasize: c.size_t, freesrc: bool) -> rawptr ---
LoadFile :: proc(file: rawptr, datasize: c.size_t) -> rawptr ---
LoadFile_RW :: proc(src: ^RWops, datasize: ^c.size_t, freesrc: bool) -> rawptr ---
LoadFile :: proc(file: rawptr, datasize: ^c.size_t) -> rawptr ---
ReadU8 :: proc(src: ^RWops) -> u8 ---
ReadLE16 :: proc(src: ^RWops) -> u16 ---