Skip to content

Commit

Permalink
fix: xmake use c99
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed May 29, 2024
1 parent 975a8ad commit 413fb14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/1-7-transformations/1-scale-rotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ void frame(void) {
sfetch_dowork();
HMM_Mat4 rotate = HMM_Rotate_RH(HMM_AngleDeg(90.0f), HMM_V3(0.0f, 0.0f, 1.0f));
HMM_Mat4 scale = HMM_Scale(HMM_V3(0.5f, 0.5f, 0.5f));
HMM_Mat4 trans = HMM_Mul(rotate, scale);
HMM_Mat4 trans = HMM_MulM4(rotate, scale);


sg_begin_pass(&(sg_pass){ .action = state.pass_action, .swapchain = sglue_swapchain() });
sg_apply_pipeline(state.pip);
Expand Down
17 changes: 11 additions & 6 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,29 @@ add_requires("stb", "sokol", "handmade_math", "sokol-shdc")
add_requires("imgui 1.x", {configs={backend="none"}})

if is_plat("windows") then
add_cflags("/TC", {tools = {"clang_cl", "cl"}})
add_cxxflags("/EHsc", {tools = {"clang_cl", "cl"}})
add_defines("UNICODE", "_UNICODE")
add_defines("SOKOL_WIN32_FORCE_MAIN")
add_cxflags("/utf-8")
elseif is_plat("mingw") then
end

if is_plat("mingw") then
add_ldflags("-static")
end
add_languages("c++20")

add_includedirs("libs/sokol")
set_encodings("utf-8")
set_languages("c99")

if is_plat("windows", "mingw") then
-- add_defines("SOKOL_GLCORE33")
add_defines("SOKOL_D3D11")
add_defines("SOKOL_GLCORE")
-- add_defines("SOKOL_D3D11")
elseif is_plat("macosx") then
add_defines("SOKOL_METAL")
elseif is_plat("wasm") then
add_defines("SOKOL_GLES3")
else
add_defines("SOKOL_GLCORE33")
add_defines("SOKOL_GLCORE")
end

local function split(input, delimiter)
Expand Down

0 comments on commit 413fb14

Please sign in to comment.