From 8a704614aafb973817c30e08ca96d66504fba5e2 Mon Sep 17 00:00:00 2001 From: David Lannan Date: Wed, 30 Oct 2024 01:00:03 +1030 Subject: [PATCH] Minor fixes. --- ffi/sokol/hmm.lua | 28 +++++++++++++++++++++++++++- tools/shc_compile.lua | 3 +-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/ffi/sokol/hmm.lua b/ffi/sokol/hmm.lua index 3f94798..eea4d20 100644 --- a/ffi/sokol/hmm.lua +++ b/ffi/sokol/hmm.lua @@ -18,6 +18,11 @@ ffi.cdef[[ typedef union hmm_vec2 { + struct + { + float x, y; + }; + struct { float X, Y; @@ -43,6 +48,11 @@ typedef union hmm_vec2 typedef union hmm_vec3 { + struct + { + float x, y, z; + }; + struct { float X, Y, Z; @@ -96,6 +106,10 @@ typedef union hmm_vec4 { float X, Y, Z; }; + struct + { + float x, y, z; + }; }; float W; @@ -109,6 +123,10 @@ typedef union hmm_vec4 { float R, G, B; }; + struct + { + float x, y, z; + }; }; float A; @@ -155,9 +173,17 @@ typedef union hmm_quaternion { float X, Y, Z; }; + struct + { + float x, y, z; + }; }; - float W; + union + { + float W; + float w; + }; }; float Elements[4]; diff --git a/tools/shc_compile.lua b/tools/shc_compile.lua index ba10fb5..d9b5597 100644 --- a/tools/shc_compile.lua +++ b/tools/shc_compile.lua @@ -75,7 +75,7 @@ sh_compiler.process_shader = function( filename, shader_src, program_name ) ffi_str = ffi_str..typedefs ffi_str = ffi_str.."]]\n\n" end -print(ffi_str) + -- Make a sg_shader_desc -- get vs_source @@ -132,7 +132,6 @@ sh_compiler.compile = function( glslfile, program_name ) local command = exec..' -i '..glslfile.." -o "..sh_compiler.target_tmp command = command.." -l "..sh_compiler.target_lang.." -f "..sh_compiler.target_output - print(command) local runner = io.popen(command, "r") -- Read in the results, then the files