From 15b72119eb611fefc15ffa54e5c7a3455e04d93b Mon Sep 17 00:00:00 2001 From: Mikkel Hjortshoej Date: Wed, 21 Mar 2018 19:30:27 +0100 Subject: [PATCH 1/3] Added more function to windows.odin --- core/sys/windows.odin | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/sys/windows.odin b/core/sys/windows.odin index d8269667d..6b6d0c56e 100644 --- a/core/sys/windows.odin +++ b/core/sys/windows.odin @@ -557,6 +557,11 @@ foreign kernel32 { inherit_handle: Bool, creation_flags: u32, environment: rawptr, current_direcotry: cstring, startup_info: ^Startup_Info, process_information: ^Process_Information) -> Bool ---; + @(link_name="CreateProcessW") create_process_w :: proc(application_name, command_line: Wstring, + process_attributes, thread_attributes: ^Security_Attributes, + inherit_handle: Bool, creation_flags: u32, environment: rawptr, + current_direcotry: cstring, startup_info: ^Startup_Info, + process_information: ^Process_Information) -> Bool ---; @(link_name="GetExitCodeProcess") get_exit_code_process :: proc(process: Handle, exit: ^u32) -> Bool ---; @(link_name="ExitProcess") exit_process :: proc(exit_code: u32) ---; @(link_name="GetModuleHandleA") get_module_handle_a :: proc(module_name: cstring) -> Hinstance ---; @@ -784,7 +789,12 @@ foreign user32 { @(link_name="SetForegroundWindow") set_foreground_window :: proc(h: Hwnd) -> Bool ---; @(link_name="SetFocus") set_focus :: proc(h: Hwnd) -> Hwnd ---; - @(link_name="LoadCursorA") load_cursor_a :: proc(instance: Hinstance, cursor_name: cstring) -> Hcursor ---; + + @(link_name="LoadImageA") load_image_a :: proc(instance: Hinstance, name: cstring, type_: u32, x_desired, y_desired : i32, load : u32) -> Handle ---; + @(link_name="LoadIconA") load_icon_a :: proc(instance: Hinstance, icon_name: cstring) -> Hicon ---; + @(link_name="DestroyIcon") destroy_icon :: proc(icon: Hicon) -> Bool ---; + + @(link_name="LoadCursorA") load_cursor_a :: proc(instance: Hinstance, cursor_name: cstring) -> Hcursor ---; @(link_name="GetCursor") get_cursor :: proc() -> Hcursor ---; @(link_name="SetCursor") set_cursor :: proc(cursor: Hcursor) -> Hcursor ---; From 2de62910fcb6f5b65f5c650728ce11527dbcace3 Mon Sep 17 00:00:00 2001 From: Mikkel Hjortshoej Date: Wed, 21 Mar 2018 19:30:27 +0100 Subject: [PATCH 2/3] Added more function to windows.odin --- core/sys/windows.odin | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/sys/windows.odin b/core/sys/windows.odin index d8269667d..6b6d0c56e 100644 --- a/core/sys/windows.odin +++ b/core/sys/windows.odin @@ -557,6 +557,11 @@ foreign kernel32 { inherit_handle: Bool, creation_flags: u32, environment: rawptr, current_direcotry: cstring, startup_info: ^Startup_Info, process_information: ^Process_Information) -> Bool ---; + @(link_name="CreateProcessW") create_process_w :: proc(application_name, command_line: Wstring, + process_attributes, thread_attributes: ^Security_Attributes, + inherit_handle: Bool, creation_flags: u32, environment: rawptr, + current_direcotry: cstring, startup_info: ^Startup_Info, + process_information: ^Process_Information) -> Bool ---; @(link_name="GetExitCodeProcess") get_exit_code_process :: proc(process: Handle, exit: ^u32) -> Bool ---; @(link_name="ExitProcess") exit_process :: proc(exit_code: u32) ---; @(link_name="GetModuleHandleA") get_module_handle_a :: proc(module_name: cstring) -> Hinstance ---; @@ -784,7 +789,12 @@ foreign user32 { @(link_name="SetForegroundWindow") set_foreground_window :: proc(h: Hwnd) -> Bool ---; @(link_name="SetFocus") set_focus :: proc(h: Hwnd) -> Hwnd ---; - @(link_name="LoadCursorA") load_cursor_a :: proc(instance: Hinstance, cursor_name: cstring) -> Hcursor ---; + + @(link_name="LoadImageA") load_image_a :: proc(instance: Hinstance, name: cstring, type_: u32, x_desired, y_desired : i32, load : u32) -> Handle ---; + @(link_name="LoadIconA") load_icon_a :: proc(instance: Hinstance, icon_name: cstring) -> Hicon ---; + @(link_name="DestroyIcon") destroy_icon :: proc(icon: Hicon) -> Bool ---; + + @(link_name="LoadCursorA") load_cursor_a :: proc(instance: Hinstance, cursor_name: cstring) -> Hcursor ---; @(link_name="GetCursor") get_cursor :: proc() -> Hcursor ---; @(link_name="SetCursor") set_cursor :: proc(cursor: Hcursor) -> Hcursor ---; From 7382f52dc90e240843a08002bb54850a9d22be87 Mon Sep 17 00:00:00 2001 From: Lipid Date: Wed, 2 May 2018 18:01:15 +0200 Subject: [PATCH 3/3] Fix copy-and-forget in math.odin --- core/math.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/math.odin b/core/math.odin index f5d4e7946..8bc288185 100644 --- a/core/math.odin +++ b/core/math.odin @@ -413,8 +413,8 @@ axis_angle :: proc(axis: Vec3, angle_radians: f32) -> Quat { euler_angles :: proc(pitch, yaw, roll: f32) -> Quat { p := axis_angle(Vec3{1, 0, 0}, pitch); - y := axis_angle(Vec3{0, 1, 0}, pitch); - r := axis_angle(Vec3{0, 0, 1}, pitch); + y := axis_angle(Vec3{0, 1, 0}, yaw); + r := axis_angle(Vec3{0, 0, 1}, roll); return mul(mul(y, p), r); }