luboslenco 7 tháng trước cách đây
mục cha
commit
47bc985b42
100 tập tin đã thay đổi với 391 bổ sung4270 xóa
  1. 1 1
      .github/workflows/linux_vulkan.yml
  2. 1 1
      .github/workflows/macos_metal.yml
  3. 1 1
      .github/workflows/windows_direct3d12.yml
  4. 0 341
      armorcore/project.js
  5. 0 5
      armorcore/readme.md
  6. 0 5
      armorcore/sources/backends/metal/kinc/backend/g5.h
  7. 0 4
      armorcore/sources/backends/webgpu/kinc/backend/g5.h
  8. 0 739
      armorcore/sources/iron_ui_ext.c
  9. 0 24
      armorcore/sources/iron_ui_ext.h
  10. 0 3
      armorcore/sources/iron_vec3.h
  11. 0 3
      armorcore/sources/kinc/a2.c
  12. 0 90
      armorcore/sources/kinc/a2.h
  13. 0 8
      armorcore/sources/kinc/atomic.h
  14. 0 25
      armorcore/sources/kinc/color.h
  15. 0 62
      armorcore/sources/kinc/core.h
  16. 0 28
      armorcore/sources/kinc/display.h
  17. 0 95
      armorcore/sources/kinc/error.h
  18. 0 82
      armorcore/sources/kinc/filewriter.h
  19. 0 77
      armorcore/sources/kinc/g2.h
  20. 0 126
      armorcore/sources/kinc/g2_ext.c
  21. 0 7
      armorcore/sources/kinc/g2_ext.h
  22. 0 218
      armorcore/sources/kinc/g5.h
  23. 0 166
      armorcore/sources/kinc/g5_buffer.c.h
  24. 0 83
      armorcore/sources/kinc/g5_buffer.h
  25. 0 53
      armorcore/sources/kinc/g5_commandlist.h
  26. 0 14
      armorcore/sources/kinc/g5_compute.h
  27. 0 116
      armorcore/sources/kinc/g5_pipeline.c.h
  28. 0 143
      armorcore/sources/kinc/g5_pipeline.h
  29. 0 38
      armorcore/sources/kinc/g5_raytrace.h
  30. 0 64
      armorcore/sources/kinc/g5_texture.h
  31. 0 87
      armorcore/sources/kinc/gamepad.h
  32. 0 38
      armorcore/sources/kinc/http.h
  33. 0 257
      armorcore/sources/kinc/keyboard.h
  34. 0 177
      armorcore/sources/kinc/mouse.h
  35. 0 101
      armorcore/sources/kinc/pen.h
  36. 0 14
      armorcore/sources/kinc/quaternion.h
  37. 0 71
      armorcore/sources/kinc/random.h
  38. 0 24
      armorcore/sources/kinc/rootunit.c
  39. 0 586
      armorcore/sources/kinc/socket.h
  40. 0 60
      armorcore/sources/kinc/surface.h
  41. 0 20
      armorcore/sources/kinc/thread.h
  42. 0 25
      armorcore/sources/kinc/vector.h
  43. 0 99
      armorcore/sources/kinc/window.h
  44. 0 19
      armorcore/sources/libs/miniClib/license.txt
  45. 0 11
      armorcore/tools/wasm/README.md
  46. 3 3
      armorforge/sources/tab_scene.ts
  47. 3 3
      armorlab/readme.md
  48. 1 1
      armorpaint/plugins/proc_xatlas/xatlas.cpp
  49. 5 5
      armorpaint/readme.md
  50. 1 1
      armorsculpt/sources/tab_layers.ts
  51. 0 0
      base/make
  52. 0 0
      base/make.bat
  53. 1 2
      base/plugins/phys_jolt/phys_jolt.cpp
  54. 339 5
      base/project.js
  55. 5 0
      base/readme.md
  56. 0 0
      base/shaders/draw/draw_colored.frag.glsl
  57. 0 0
      base/shaders/draw/draw_colored.vert.glsl
  58. 0 0
      base/shaders/draw/draw_image.frag.glsl
  59. 0 0
      base/shaders/draw/draw_image.vert.glsl
  60. 0 0
      base/shaders/draw/draw_text.frag.glsl
  61. 0 0
      base/shaders/draw/draw_text.vert.glsl
  62. 0 0
      base/sources/.clang-format
  63. 0 0
      base/sources/backends/android/android_native_app_glue.c
  64. 0 0
      base/sources/backends/android/android_native_app_glue.h
  65. 0 0
      base/sources/backends/android/java/arm/AndroidHttpRequest.java
  66. 0 0
      base/sources/backends/android/java/tech/kinc/KincActivity.kt
  67. 0 0
      base/sources/backends/android/java/tech/kinc/KincMoviePlayer.kt
  68. 0 0
      base/sources/backends/android/java/tech/kinc/KincMovieTexture.kt
  69. 0 0
      base/sources/backends/android/kinc/backend/android.h
  70. 1 1
      base/sources/backends/android/kinc/backend/android_file_dialog.c
  71. 0 0
      base/sources/backends/android/kinc/backend/android_file_dialog.h
  72. 1 1
      base/sources/backends/android/kinc/backend/android_http_request.c
  73. 0 0
      base/sources/backends/android/kinc/backend/android_http_request.h
  74. 0 0
      base/sources/backends/android/kinc/backend/androidunit.c
  75. 0 0
      base/sources/backends/android/kinc/backend/audio.c.h
  76. 2 2
      base/sources/backends/android/kinc/backend/display.c.h
  77. 8 15
      base/sources/backends/android/kinc/backend/system.c.h
  78. 5 5
      base/sources/backends/android/kinc/backend/video.c.h
  79. 1 1
      base/sources/backends/android/kinc/backend/video.h
  80. 2 3
      base/sources/backends/android/kinc/backend/window.c.h
  81. 0 0
      base/sources/backends/apple/kinc/backend/appleunit.m
  82. 1 1
      base/sources/backends/apple/kinc/backend/http.m.h
  83. 1 1
      base/sources/backends/apple/kinc/backend/system.m.h
  84. 1 2
      base/sources/backends/apple/kinc/backend/thread.m.h
  85. 1 1
      base/sources/backends/apple/kinc/backend/video.h
  86. 6 6
      base/sources/backends/apple/kinc/backend/video.m.h
  87. 0 0
      base/sources/backends/data/android/app/CMakeLists.txt
  88. 0 0
      base/sources/backends/data/android/app/build.gradle.kts
  89. 0 0
      base/sources/backends/data/android/app/proguard-rules.pro
  90. 0 0
      base/sources/backends/data/android/build.gradle.kts
  91. 0 0
      base/sources/backends/data/android/gradle.properties
  92. 0 0
      base/sources/backends/data/android/gradle/wrapper/gradle-wrapper.jar
  93. 0 0
      base/sources/backends/data/android/gradle/wrapper/gradle-wrapper.properties
  94. 0 0
      base/sources/backends/data/android/gradlew
  95. 0 0
      base/sources/backends/data/android/gradlew.bat
  96. 0 0
      base/sources/backends/data/android/main/AndroidManifest.xml
  97. 0 0
      base/sources/backends/data/android/main/res/values/strings.xml
  98. 0 0
      base/sources/backends/data/android/settings.gradle.kts
  99. 0 0
      base/sources/backends/data/wasm/JS-Sources/audio-thread.js
  100. 0 0
      base/sources/backends/data/wasm/JS-Sources/index.html

+ 1 - 1
.github/workflows/linux_vulkan.yml

@@ -22,4 +22,4 @@ jobs:
     - name: Compile
       run: |
         cd armorpaint
-        ../armorcore/make --graphics vulkan --compile
+        ../base/make --graphics vulkan --compile

+ 1 - 1
.github/workflows/macos_metal.yml

@@ -18,4 +18,4 @@ jobs:
     - name: Compile
       run: |
         cd armorpaint
-        ../armorcore/make --graphics metal --compile
+        ../base/make --graphics metal --compile

+ 1 - 1
.github/workflows/windows_direct3d12.yml

@@ -18,4 +18,4 @@ jobs:
     - name: Compile
       run: |
         cd armorpaint
-        ../armorcore/make --graphics direct3d12 --compile
+        ../base/make --graphics direct3d12 --compile

+ 0 - 341
armorcore/project.js

@@ -1,341 +0,0 @@
-
-let project = new Project(flags.name);
-
-{
-	project.add_cfiles("sources/kinc/*");
-	project.add_include_dir("sources");
-
-	function add_backend(name) {
-		project.add_cfiles("sources/backends/" + name + "/**");
-		project.add_include_dir("sources/backends/" + name);
-	}
-
-	if (platform === "windows") {
-		add_backend("windows");
-		project.add_lib("dxguid");
-		project.add_lib("dsound");
-		project.add_lib("dinput8");
-		project.add_define("_CRT_SECURE_NO_WARNINGS");
-		project.add_define("_WINSOCK_DEPRECATED_NO_WARNINGS");
-		project.add_lib("ws2_32");
-		project.add_lib("Winhttp");
-		project.add_lib("wbemuuid");
-
-		if (graphics === "direct3d12" || graphics === "default") {
-			add_backend("direct3d12");
-			project.add_define("KINC_DIRECT3D12");
-			project.add_lib("dxgi");
-			project.add_lib("d3d12");
-		}
-		else {
-			throw new Error("Graphics API " + graphics + " is not available for Windows.");
-		}
-	}
-	else if (platform === "macos") {
-		add_backend("apple");
-		add_backend("macos");
-		add_backend("posix");
-		if (graphics === "metal" || graphics === "default") {
-			add_backend("metal");
-			project.add_define("KINC_METAL");
-			project.add_lib("Metal");
-			project.add_lib("MetalKit");
-		}
-		else {
-			throw new Error("Graphics API " + graphics + " is not available for macOS.");
-		}
-		project.add_lib("IOKit");
-		project.add_lib("Cocoa");
-		project.add_lib("AppKit");
-		project.add_lib("CoreAudio");
-		project.add_lib("CoreData");
-		project.add_lib("CoreMedia");
-		project.add_lib("CoreVideo");
-		project.add_lib("AVFoundation");
-		project.add_lib("Foundation");
-	}
-	else if (platform === "ios") {
-		add_backend("apple");
-		add_backend("ios");
-		add_backend("posix");
-		if (graphics === "metal" || graphics === "default") {
-			add_backend("metal");
-			project.add_define("KINC_METAL");
-			project.add_lib("Metal");
-		}
-		else {
-			throw new Error("Graphics API " + graphics + " is not available for iOS.");
-		}
-		project.add_lib("UIKit");
-		project.add_lib("Foundation");
-		project.add_lib("CoreGraphics");
-		project.add_lib("QuartzCore");
-		project.add_lib("CoreAudio");
-		project.add_lib("AudioToolbox");
-		project.add_lib("CoreMotion");
-		project.add_lib("AVFoundation");
-		project.add_lib("CoreFoundation");
-		project.add_lib("CoreVideo");
-		project.add_lib("CoreMedia");
-	}
-	else if (platform === "android") {
-		project.add_define("KINC_ANDROID");
-		add_backend("android");
-		add_backend("posix");
-		if (graphics === "vulkan") {
-			add_backend("vulkan" || graphics === "default");
-			project.add_define("KINC_VULKAN");
-			project.add_define("VK_USE_PLATFORM_ANDROID_KHR");
-			project.add_lib("vulkan");
-			project.add_define("KINC_ANDROID_API=24");
-		}
-		else {
-			throw new Error("Graphics API " + graphics + " is not available for Android.");
-		}
-		project.add_lib("log");
-		project.add_lib("android");
-		project.add_lib("EGL");
-		project.add_lib("GLESv3");
-		project.add_lib("OpenSLES");
-		project.add_lib("OpenMAXAL");
-	}
-	else if (platform === "wasm") {
-		project.add_define("KINC_WASM");
-		add_backend("wasm");
-		project.add_include_dir("miniClib");
-		project.add_cfiles("sources/libs/miniClib/**");
-		if (graphics === "webgpu") {
-			add_backend("webgpu" || graphics === "default");
-			project.add_define("KINC_WEBGPU");
-		}
-		else {
-			throw new Error("Graphics API " + graphics + " is not available for Wasm.");
-		}
-	}
-	else if (platform === "linux") {
-		add_backend("linux");
-		add_backend("posix");
-		project.add_lib("asound");
-		project.add_lib("dl");
-		project.add_lib("udev");
-
-		// try {
-		// 	if (!fs_exists("build")) {
-		// 		fs_mkdir("build");
-		// 	}
-		// 	if (!fs_exists(path_join("build", "wayland"))) {
-		// 		fs_mkdir(path_join("build", "wayland"));
-		// 	}
-		// 	const waylandDir = path_join("build", "wayland", "wayland-generated");
-		// 	if (!fs_exists(waylandDir)) {
-		// 		fs_mkdir(waylandDir);
-		// 	}
-
-		// 	let good_wayland = false;
-
-		// 	const wayland_call = os_exec("wayland-scanner", ["--version"]);
-		// 	if (wayland_call.status !== 0) {
-		// 		throw "Could not run wayland-scanner to ask for its version";
-		// 	}
-		// 	const wayland_version = wayland_call.stderr;
-
-		// 	try {
-		// 		const scanner_versions = wayland_version.split(" ")[1].split(".");
-		// 		const w_x = parseInt(scanner_versions[0]);
-		// 		const w_y = parseInt(scanner_versions[1]);
-		// 		const w_z = parseInt(scanner_versions[2]);
-
-		// 		if (w_x > 1) {
-		// 			good_wayland = true;
-		// 		}
-		// 		else if (w_x === 1) {
-		// 			if (w_y > 17) {
-		// 				good_wayland = true;
-		// 			}
-		// 			else if (w_y === 17) {
-		// 				if (w_z >= 91) {
-		// 					good_wayland = true;
-		// 				}
-		// 			}
-		// 		}
-		// 	}
-		// 	catch (err) {
-		// 		console.log("Could not parse wayland-version " + wayland_version);
-		// 	}
-
-		// 	let c_ending = ".c";
-		// 	if (good_wayland) {
-		// 		c_ending = ".c.h";
-		// 	}
-
-		// 	let chfiles = [];
-
-		// 	function wl_protocol(protocol, file) {
-		// 		chfiles.push(file);
-		// 		const backend_path = path_resolve(waylandDir);
-		// 		const protocol_path = path_resolve("/usr/share/wayland-protocols", protocol);
-		// 		if (os_exec("wayland-scanner", ["private-code", protocol_path, path_resolve(backend_path, file + c_ending)]).status !== 0) {
-		// 			throw "Failed to generate wayland protocol files for" + protocol;
-		// 		}
-		// 		if (os_exec("wayland-scanner", ["client-header", protocol_path, path_resolve(backend_path, file + ".h")]).status !== 0) {
-		// 			throw "Failed to generate wayland protocol header for" + protocol;
-		// 		}
-		// 	}
-
-		// 	if (os_exec("wayland-scanner", ["private-code", "/usr/share/wayland/wayland.xml", path_resolve(waylandDir, "wayland-protocol" + c_ending)]).status !== 0) {
-		// 		throw "Failed to generate wayland protocol files for /usr/share/wayland/wayland.xml";
-		// 	}
-		// 	if (os_exec("wayland-scanner", ["client-header", "/usr/share/wayland/wayland.xml", path_resolve(waylandDir, "wayland-protocol.h")]).status !== 0) {
-		// 		throw "Failed to generate wayland protocol header for /usr/share/wayland/wayland.xml";
-		// 	}
-		// 	wl_protocol("stable/viewporter/viewporter.xml", "wayland-viewporter");
-		// 	wl_protocol("stable/xdg-shell/xdg-shell.xml", "xdg-shell");
-		// 	wl_protocol("unstable/xdg-decoration/xdg-decoration-unstable-v1.xml", "xdg-decoration");
-		// 	wl_protocol("unstable/tablet/tablet-unstable-v2.xml", "wayland-tablet");
-		// 	wl_protocol("unstable/pointer-constraints/pointer-constraints-unstable-v1.xml", "wayland-pointer-constraint");
-		// 	wl_protocol("unstable/relative-pointer/relative-pointer-unstable-v1.xml", "wayland-relative-pointer");
-
-		// 	if (good_wayland) {
-		// 		let cfile = "#include \"wayland-protocol.c.h\"\n";
-		// 		for (const chfile of chfiles) {
-		// 			cfile += "#include \"" + chfile + ".c.h\"\n";
-		// 		}
-		// 		fs_writefile(path_resolve(waylandDir, "waylandunit.c"), cfile);
-		// 	}
-
-		// 	project.add_include_dir(path_join("build", "wayland"));
-		// 	project.add_cfiles(path_resolve(waylandDir, "**"));
-		// }
-		// catch (err) {
-		// 	console.log("Failed to include wayland-support, setting KINC_NO_WAYLAND.");
-		// 	console.log("Wayland error was: " + err);
-		// 	project.add_define("KINC_NO_WAYLAND");
-		// }
-
-		if (graphics === "vulkan" || graphics === "default") {
-			add_backend("vulkan");
-			project.add_lib("vulkan");
-			project.add_define("KINC_VULKAN");
-		}
-		else {
-			throw new Error("Graphics API " + graphics + " is not available for Linux.");
-		}
-		project.add_define("_POSIX_C_SOURCE=200112L");
-		project.add_define("_XOPEN_SOURCE=600");
-	}
-}
-
-if (fs_exists(os_cwd() + "/icon.png")) {
-	project.icon = "icon.png";
-	if (platform === "macos" && fs_exists(os_cwd() + "/icon_macos.png")) {
-		project.icon = "icon_macos.png";
-	}
-}
-
-project.add_include_dir("sources/libs");
-project.add_cfiles("sources/libs/gc.c");
-project.add_cfiles("sources/libs/dir.c");
-project.add_include_dir("sources");
-project.add_cfiles("sources/iron.c");
-project.add_define("IRON_C_PATH=\"" + os_cwd() + "/build/iron.c" + "\"");
-project.add_define("EMBED_H_PATH=\"" + os_cwd() + "/build/embed.h" + "\"");
-
-if (flags.with_audio) {
-	project.add_define("KINC_A1");
-	project.add_define("KINC_A2");
-	project.add_define("WITH_AUDIO");
-	project.add_define("arm_audio");
-	project.add_cfiles("sources/libs/stb_vorbis.c");
-}
-
-if (flags.with_eval) {
-	project.add_define("WITH_EVAL");
-	project.add_cfiles("sources/libs/quickjs/*.c");
-	if (platform === "linux") {
-		project.add_lib("m");
-		project.add_define("_GNU_SOURCE");
-		project.add_define("environ=__environ");
-		project.add_define("sighandler_t=__sighandler_t");
-	}
-	else if (platform === "windows") {
-		project.add_define("WIN32_LEAN_AND_MEAN");
-		project.add_define("_WIN32_WINNT=0x0602");
-	}
-}
-
-if (flags.with_iron) {
-	project.add_define("WITH_IRON");
-	project.add_cfiles("sources/*.c");
-}
-
-if (platform === "windows") {
-	project.add_lib("Dbghelp"); // Stack walk
-	project.add_lib("Dwmapi"); // DWMWA_USE_IMMERSIVE_DARK_MODE
-	if (flags.with_d3dcompiler) {
-		project.add_define("WITH_D3DCOMPILER");
-		project.add_lib("d3d11");
-		project.add_lib("d3dcompiler");
-	}
-}
-else if (platform === "linux") {
-	project.add_define("KINC_NO_WAYLAND"); // TODO: kinc_wayland_display_init() not implemented
-}
-else if (platform === "android") {
-	project.add_define("IDLE_SLEEP");
-	project.target_options.android.package = flags.package;
-	project.target_options.android.permissions = ["android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.INTERNET"];
-	project.target_options.android.screenOrientation = ["sensorLandscape"];
-	project.target_options.android.minSdkVersion = 30;
-	project.target_options.android.targetSdkVersion = 33;
-	project.target_options.android.versionCode = 240000;
-	project.target_options.android.versionName = "1.0 alpha";
-}
-else if (platform === "ios") {
-	project.add_define("IDLE_SLEEP");
-}
-
-if (flags.with_nfd && (platform === "windows" || platform === "linux" || platform === "macos")) {
-	project.add_define("WITH_NFD");
-	project.add_include_dir("sources/libs/nfd");
-	project.add_cfiles("sources/libs/nfd/nfd_common.c");
-
-	if (platform === "windows") {
-		project.add_cfiles("sources/libs/nfd/nfd_win.cpp");
-	}
-	else if (platform === "linux") {
-		project.add_cfiles("sources/libs/nfd/nfd_gtk.c");
-		project.add_include_dir("/usr/include/gtk-3.0");
-		project.add_include_dir("/usr/include/glib-2.0");
-		project.add_include_dir("/usr/lib/x86_64-linux-gnu/glib-2.0/include");
-		project.add_include_dir("/usr/include/pango-1.0");
-		project.add_include_dir("/usr/include/cairo");
-		project.add_include_dir("/usr/include/gdk-pixbuf-2.0");
-		project.add_include_dir("/usr/include/atk-1.0");
-		project.add_include_dir("/usr/lib64/glib-2.0/include");
-		project.add_include_dir("/usr/lib/glib-2.0/include");
-		project.add_include_dir("/usr/include/harfbuzz");
-		project.add_lib("gtk-3");
-		project.add_lib("gobject-2.0");
-		project.add_lib("glib-2.0");
-	}
-	else {
-		project.add_cfiles("sources/libs/nfd/nfd_cocoa.m");
-	}
-}
-
-if (flags.with_compress) {
-	project.add_define("WITH_COMPRESS");
-}
-
-if (flags.with_image_write) {
-	project.add_define("WITH_IMAGE_WRITE");
-}
-
-if (flags.with_video_write) {
-	project.add_define("WITH_VIDEO_WRITE");
-	project.add_cfiles("sources/libs/minimp4.c");
-	project.add_cfiles("sources/libs/minih264e.c");
-}
-
-project.flatten();
-return project;

+ 0 - 5
armorcore/readme.md

@@ -1,5 +0,0 @@
-# armorcore
-
-3D engine core for C with JS scripting. ArmorCore targets Direct3D12, Vulkan, Metal and WebGPU.
-
-Powered by [Kore](https://github.com/Kode/Kore) - low-level hardware abstraction library.

+ 0 - 5
armorcore/sources/backends/metal/kinc/backend/g5.h

@@ -1,5 +0,0 @@
-#pragma once
-
-#include <kinc/g5.h>
-#include <kinc/g5_texture.h>
-#include <kinc/matrix.h>

+ 0 - 4
armorcore/sources/backends/webgpu/kinc/backend/g5.h

@@ -1,4 +0,0 @@
-#pragma once
-
-#include <kinc/g5.h>
-#include <kinc/matrix.h>

+ 0 - 739
armorcore/sources/iron_ui_ext.c

@@ -1,739 +0,0 @@
-#include "iron_ui_ext.h"
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-#include <kinc/keyboard.h>
-#include <kinc/filereader.h>
-#include <kinc/system.h>
-#include "iron_string.h"
-
-#define MATH_PI 3.14159265358979323846
-
-static char data_path[128] = "";
-static char last_path[512];
-static ui_handle_t *wheel_selected_handle = NULL;
-static ui_handle_t *gradient_selected_handle = NULL;
-static ui_handle_t radio_handle;
-static int _ELEMENT_OFFSET = 0;
-static int _BUTTON_COL = 0;
-static int text_area_selection_start = -1;
-bool ui_text_area_line_numbers = false;
-bool ui_text_area_scroll_past_end = false;
-ui_text_coloring_t *ui_text_area_coloring = NULL;
-
-float ui_dist(float x1, float y1, float x2, float y2) {
-	float vx = x1 - x2;
-	float vy = y1 - y2;
-	return sqrtf(vx * vx + vy * vy);
-}
-
-float ui_fract(float f) {
-	return f - (int)f;
-}
-
-float ui_mix(float x, float y, float a) {
-	return x * (1.0 - a) + y * a;
-}
-
-float ui_clamp(float x, float min_val, float max_val) {
-	return fmin(fmax(x, min_val), max_val);
-}
-
-float ui_step(float edge, float x) {
-	return x < edge ? 0.0 : 1.0;
-}
-
-static const float kx = 1.0;
-static const float ky = 2.0 / 3.0;
-static const float kz = 1.0 / 3.0;
-static const float kw = 3.0;
-static float ar[] = {0.0, 0.0, 0.0};
-void ui_hsv_to_rgb(float cr, float cg, float cb, float *out) {
-	float px = fabs(ui_fract(cr + kx) * 6.0 - kw);
-	float py = fabs(ui_fract(cr + ky) * 6.0 - kw);
-	float pz = fabs(ui_fract(cr + kz) * 6.0 - kw);
-	out[0] = cb * ui_mix(kx, ui_clamp(px - kx, 0.0, 1.0), cg);
-	out[1] = cb * ui_mix(kx, ui_clamp(py - kx, 0.0, 1.0), cg);
-	out[2] = cb * ui_mix(kx, ui_clamp(pz - kx, 0.0, 1.0), cg);
-}
-
-static const float Kx = 0.0;
-static const float Ky = -1.0 / 3.0;
-static const float Kz = 2.0 / 3.0;
-static const float Kw = -1.0;
-static const float e = 1.0e-10;
-void ui_rgb_to_hsv(float cr, float cg, float cb, float *out) {
-	float px = ui_mix(cb, cg, ui_step(cb, cg));
-	float py = ui_mix(cg, cb, ui_step(cb, cg));
-	float pz = ui_mix(Kw, Kx, ui_step(cb, cg));
-	float pw = ui_mix(Kz, Ky, ui_step(cb, cg));
-	float qx = ui_mix(px, cr, ui_step(px, cr));
-	float qy = ui_mix(py, py, ui_step(px, cr));
-	float qz = ui_mix(pw, pz, ui_step(px, cr));
-	float qw = ui_mix(cr, px, ui_step(px, cr));
-	float d = qx - fmin(qw, qy);
-	out[0] = fabs(qz + (qw - qy) / (6.0 * d + e));
-	out[1] = d / (qx + e);
-	out[2] = qx;
-}
-
-float ui_float_input(ui_handle_t *handle, char *label, int align, float precision) {
-	sprintf(handle->text, "%f", round(handle->value * precision) / precision);
-	char *text = ui_text_input(handle, label, align, true, false);
-	handle->value = atof(text);
-	return handle->value;
-}
-
-void ui_init_path(ui_handle_t *handle, const char *system_id) {
-	strcpy(handle->text, strcmp(system_id, "Windows") == 0 ? "C:\\Users" : "/");
-	// %HOMEDRIVE% + %HomePath%
-	// ~
-}
-
-char *ui_file_browser(ui_handle_t *handle, bool folders_only) {
-	ui_t *current = ui_get_current();
-	const char *sep = "/";
-
-	char cmd[64];
-	strcpy(cmd, "ls ");
-	const char *system_id = kinc_system_id();
-	if (strcmp(system_id, "Windows") == 0) {
-		strcpy(cmd, "dir /b ");
-		if (folders_only) {
-			strcat(cmd, "/ad ");
-		}
-		sep = "\\";
-		handle->text = string_replace_all(handle->text, "\\\\", "\\");
-		handle->text = string_replace_all(handle->text, "\r", "");
-	}
-	if (handle->text[0] == '\0') {
-		ui_init_path(handle, system_id);
-	}
-
-	char save[256];
-	strcpy(save, kinc_internal_get_files_location());
-	strcat(save, sep);
-	strcat(save, data_path);
-	strcat(save, "dir.txt");
-	if (strcmp(handle->text, last_path) != 0) {
-		char str[512];
-		strcpy(str, cmd);
-		strcat(str, "\"");
-		strcat(str, handle->text);
-		strcat(str, "\" > \"");
-		strcat(str, save);
-		strcat(str, "\"");
-	}
-	strcpy(last_path, handle->text);
-
-	kinc_file_reader_t reader;
-	if (!kinc_file_reader_open(&reader, save, KINC_FILE_TYPE_ASSET)) {
-		return NULL;
-	}
-	int reader_size = (int)kinc_file_reader_size(&reader);
-
-	char str[2048]; // reader_size
-	kinc_file_reader_read(&reader, str, reader_size);
-	kinc_file_reader_close(&reader);
-
-	// Up directory
-	int i1 = strstr(handle->text, "/") - handle->text;
-	int i2 = strstr(handle->text, "\\") - handle->text;
-	bool nested =
-		(i1 > -1 && strlen(handle->text) - 1 > i1) ||
-		(i2 > -1 && strlen(handle->text) - 1 > i2);
-	handle->changed = false;
-	if (nested && ui_button("..", UI_ALIGN_LEFT, "")) {
-		handle->changed = current->changed = true;
-		handle->text[strrchr(handle->text, sep[0]) - handle->text] = 0;
-		// Drive root
-		if (strlen(handle->text) == 2 && handle->text[1] == ':') {
-			strcat(handle->text, sep);
-		}
-	}
-
-	// Directory contents
-	int count = ui_line_count(str);
-	for (int i = 0; i < count; ++i) {
-		char *f = ui_extract_line(str, i);
-		if (f[0] == '\0' || f[0] == '.') {
-			continue; // Skip hidden
-		}
-		if (ui_button(f, UI_ALIGN_LEFT, "")) {
-			handle->changed = current->changed = true;
-			if (handle->text[strlen(handle->text) - 1] != sep[0]) {
-				strcat(handle->text, sep);
-			}
-			strcat(handle->text, f);
-		}
-	}
-
-	return handle->text;
-}
-
-int ui_inline_radio(ui_handle_t *handle, char_ptr_array_t *texts, int align) {
-	ui_t *current = ui_get_current();
-
-	if (!ui_is_visible(UI_ELEMENT_H())) {
-		ui_end_element();
-		return handle->position;
-	}
-	float step = current->_w / texts->length;
-	int hovered = -1;
-	if (ui_get_hover(UI_ELEMENT_H())) {
-		int ix = current->input_x - current->_x - current->_window_x;
-		for (int i = 0; i < texts->length; ++i) {
-			if (ix < i * step + step) {
-				hovered = i;
-				break;
-			}
-		}
-	}
-	if (ui_get_released(UI_ELEMENT_H())) {
-		handle->position = hovered;
-		handle->changed = current->changed = true;
-	}
-	else {
-		handle->changed = false;
-	}
-
-	for (int i = 0; i < texts->length; ++i) {
-		if (handle->position == i) {
-			kinc_g2_set_color(current->ops->theme->HIGHLIGHT_COL);
-			if (!current->enabled) {
-				ui_fade_color(0.25);
-			}
-			ui_draw_rect(true, current->_x + step * i, current->_y + current->button_offset_y, step, UI_BUTTON_H());
-		}
-		else if (hovered == i) {
-			kinc_g2_set_color(current->ops->theme->BUTTON_COL);
-			if (!current->enabled) {
-				ui_fade_color(0.25);
-			}
-			ui_draw_rect(false, current->_x + step * i, current->_y + current->button_offset_y, step, UI_BUTTON_H());
-		}
-		kinc_g2_set_color(current->ops->theme->TEXT_COL); // Text
-		current->_x += step * i;
-		float _w = current->_w;
-		current->_w = (int)step;
-		ui_draw_string(texts->buffer[i], current->ops->theme->TEXT_OFFSET, 0, align, true);
-		current->_x -= step * i;
-		current->_w = _w;
-	}
-	ui_end_element();
-	return handle->position;
-}
-
-uint8_t ui_color_r(uint32_t color) {
-	return (color & 0x00ff0000) >> 16;
-}
-
-uint8_t ui_color_g(uint32_t color) {
-	return (color & 0x0000ff00) >>  8;
-}
-
-uint8_t ui_color_b(uint32_t color) {
-	return (color & 0x000000ff);
-}
-
-uint8_t ui_color_a(uint32_t color) {
-	return (color) >> 24;
-}
-
-uint32_t ui_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
-	return (a << 24) | (r << 16) | (g << 8) | b;
-}
-
-int ui_color_wheel(ui_handle_t *handle, bool alpha, float w, float h, bool color_preview, void (*picker)(void *), void *data) {
-	ui_t *current = ui_get_current();
-	if (w < 0) {
-		w = current->_w;
-	}
-	float r = ui_color_r(handle->color) / 255.0f;
-	float g = ui_color_g(handle->color) / 255.0f;
-	float b = ui_color_b(handle->color) / 255.0f;
-	ui_rgb_to_hsv(r, g, b, ar);
-	float chue = ar[0];
-	float csat = ar[1];
-	float cval = ar[2];
-	float calpha = ui_color_a(handle->color) / 255.0f;
-
-	// Wheel
-	float px = current->_x;
-	float py = current->_y;
-	bool scroll = current->current_window != NULL ? current->current_window->scroll_enabled : false;
-	if (!scroll) {
-		w -= UI_SCROLL_W();
-		px += UI_SCROLL_W() / 2.0;
-	}
-	float _x = current->_x;
-	float _y = current->_y;
-	float _w = current->_w;
-	current->_w = (int)(28.0 * UI_SCALE());
-	if (picker != NULL && ui_button("P", UI_ALIGN_CENTER, "")) {
-		(*picker)(data);
-		current->changed = false;
-		handle->changed = false;
-		return handle->color;
-	}
-	current->_x = _x;
-	current->_y = _y;
-	current->_w = _w;
-
-	uint32_t col = ui_color(round(cval * 255.0f), round(cval * 255.0f), round(cval * 255.0f), 255);
-	ui_image(current->ops->color_wheel, false, col, -1);
-
-	// Picker
-	float ph = current->_y - py;
-	float ox = px + w / 2.0;
-	float oy = py + ph / 2.0;
-	float cw = w * 0.7;
-	float cwh = cw / 2.0;
-	float cx = ox;
-	float cy = oy + csat * cwh; // Sat is distance from center
-	float grad_tx = px + 0.897 * w;
-	float grad_ty = oy - cwh;
-	float grad_w = 0.0777 * w;
-	float grad_h = cw;
-	// Rotate around origin by hue
-	float theta = chue * (MATH_PI * 2.0);
-	float cx2 = cos(theta) * (cx - ox) - sin(theta) * (cy - oy) + ox;
-	float cy2 = sin(theta) * (cx - ox) + cos(theta) * (cy - oy) + oy;
-	cx = cx2;
-	cy = cy2;
-
-	current->_x = px - (scroll ? 0 : UI_SCROLL_W() / 2.0);
-	current->_y = py;
-	ui_image(current->ops->black_white_gradient, false, 0xffffffff, -1);
-
-	kinc_g2_set_color(0xff000000);
-	kinc_g2_fill_rect(cx - 3.0 * UI_SCALE(), cy - 3.0 * UI_SCALE(), 6.0 * UI_SCALE(), 6.0 * UI_SCALE());
-	kinc_g2_set_color(0xffffffff);
-	kinc_g2_fill_rect(cx - 2.0 * UI_SCALE(), cy - 2.0 * UI_SCALE(), 4.0 * UI_SCALE(), 4.0 * UI_SCALE());
-
-	kinc_g2_set_color(0xff000000);
-	kinc_g2_fill_rect(grad_tx + grad_w / 2.0 - 3.0 * UI_SCALE(), grad_ty + (1.0 - cval) * grad_h - 3.0 * UI_SCALE(), 6.0 * UI_SCALE(), 6.0 * UI_SCALE());
-	kinc_g2_set_color(0xffffffff);
-	kinc_g2_fill_rect(grad_tx + grad_w / 2.0 - 2.0 * UI_SCALE(), grad_ty + (1.0 - cval) * grad_h - 2.0 * UI_SCALE(), 4.0 * UI_SCALE(), 4.0 * UI_SCALE());
-
-	if (alpha) {
-		ui_handle_t *alpha_handle = ui_nest(handle, 1);
-		if (alpha_handle->init) {
-			alpha_handle->value = round(calpha * 100.0) / 100.0;
-		}
-		calpha = ui_slider(alpha_handle, "Alpha", 0.0, 1.0, true, 100, true, UI_ALIGN_LEFT, true);
-		if (alpha_handle->changed) {
-			handle->changed = current->changed = true;
-		}
-	}
-	// Mouse picking for color wheel
-	float gx = ox + current->_window_x;
-	float gy = oy + current->_window_y;
-	if (current->input_started && ui_input_in_rect(gx - cwh, gy - cwh, cw, cw)) {
-		wheel_selected_handle = handle;
-	}
-	if (current->input_released && wheel_selected_handle != NULL) {
-		wheel_selected_handle = NULL;
-		handle->changed = current->changed = true;
-	}
-	if (current->input_down && wheel_selected_handle == handle) {
-		csat = fmin(ui_dist(gx, gy, current->input_x, current->input_y), cwh) / cwh;
-		float angle = atan2(current->input_x - gx, current->input_y - gy);
-		if (angle < 0) {
-			angle = MATH_PI + (MATH_PI - fabs(angle));
-		}
-		angle = MATH_PI * 2.0 - angle;
-		chue = angle / (MATH_PI * 2.0);
-		handle->changed = current->changed = true;
-	}
-	// Mouse picking for cval
-	if (current->input_started && ui_input_in_rect(grad_tx + current->_window_x, grad_ty + current->_window_y, grad_w, grad_h)) {
-		gradient_selected_handle = handle;
-	}
-	if (current->input_released && gradient_selected_handle != NULL) {
-		gradient_selected_handle = NULL;
-		handle->changed = current->changed = true;
-	}
-	if (current->input_down && gradient_selected_handle == handle) {
-		cval = fmax(0.01, fmin(1.0, 1.0 - (current->input_y - grad_ty - current->_window_y) / grad_h));
-		handle->changed = current->changed = true;
-	}
-	// Save as rgb
-	ui_hsv_to_rgb(chue, csat, cval, ar);
-	handle->color = ui_color(round(ar[0] * 255.0), round(ar[1] * 255.0), round(ar[2] * 255.0), round(calpha * 255.0));
-
-	if (color_preview) {
-		ui_text("", UI_ALIGN_RIGHT, handle->color);
-	}
-
-	char *strings[] = {"RGB", "HSV", "Hex"};
-	char_ptr_array_t car;
-	car.buffer = strings;
-	car.length = 3;
-	int pos = ui_inline_radio(&radio_handle, &car, UI_ALIGN_LEFT);
-
-	ui_handle_t *h0 = ui_nest(ui_nest(handle, 0), 0);
-	ui_handle_t *h1 = ui_nest(ui_nest(handle, 0), 1);
-	ui_handle_t *h2 = ui_nest(ui_nest(handle, 0), 2);
-	if (pos == 0) {
-		h0->value = ui_color_r(handle->color) / 255.0f;
-		float r = ui_slider(h0, "R", 0, 1, true, 100, true, UI_ALIGN_LEFT, true);
-		h1->value = ui_color_g(handle->color) / 255.0f;
-		float g = ui_slider(h1, "G", 0, 1, true, 100, true, UI_ALIGN_LEFT, true);
-		h2->value = ui_color_b(handle->color) / 255.0f;
-		float b = ui_slider(h2, "B", 0, 1, true, 100, true, UI_ALIGN_LEFT, true);
-		handle->color = ui_color(r * 255.0, g * 255.0, b * 255.0, 255.0);
-	}
-	else if (pos == 1) {
-		ui_rgb_to_hsv(ui_color_r(handle->color) / 255.0f, ui_color_g(handle->color) / 255.0f, ui_color_b(handle->color) / 255.0f, ar);
-		h0->value = ar[0];
-		h1->value = ar[1];
-		h2->value = ar[2];
-		float chue = ui_slider(h0, "H", 0, 1, true, 100, true, UI_ALIGN_LEFT, true);
-		float csat = ui_slider(h1, "S", 0, 1, true, 100, true, UI_ALIGN_LEFT, true);
-		float cval = ui_slider(h2, "V", 0, 1, true, 100, true, UI_ALIGN_LEFT, true);
-		ui_hsv_to_rgb(chue, csat, cval, ar);
-		handle->color = ui_color(ar[0] * 255.0, ar[1] * 255.0, ar[2] * 255.0, 255.0);
-	}
-	else if (pos == 2) {
-		char tmp[16];
-		handle->text = tmp;
-		sprintf(handle->text, "%x", handle->color);
-		char *hex_code = ui_text_input(handle, "#", UI_ALIGN_LEFT, true, false);
-		if (strlen(hex_code) >= 1 && hex_code[0] == '#') { // Allow # at the beginning
-			hex_code = strcpy(hex_code, hex_code + 1);
-		}
-		if (strlen(hex_code) == 3) { // 3 digit CSS style values like fa0 --> ffaa00
-			hex_code[5] = hex_code[2];
-			hex_code[4] = hex_code[2];
-			hex_code[3] = hex_code[1];
-			hex_code[2] = hex_code[1];
-			hex_code[1] = hex_code[0];
-			hex_code[6] = '\0';
-		}
-		if (strlen(hex_code) == 4) { // 4 digit CSS style values
-			hex_code[7] = hex_code[3];
-			hex_code[6] = hex_code[3];
-			hex_code[5] = hex_code[2];
-			hex_code[4] = hex_code[2];
-			hex_code[3] = hex_code[1];
-			hex_code[2] = hex_code[1];
-			hex_code[1] = hex_code[0];
-			hex_code[8] = '\0';
-		}
-		if (strlen(hex_code) == 6) { // Make the alpha channel optional
-			hex_code[7] = hex_code[5];
-			hex_code[6] = hex_code[4];
-			hex_code[5] = hex_code[3];
-			hex_code[4] = hex_code[2];
-			hex_code[3] = hex_code[1];
-			hex_code[2] = hex_code[0];
-			hex_code[0] = 'f';
-			hex_code[1] = 'f';
-		}
-		#ifdef _WIN32
-		handle->color = _strtoi64(hex_code, NULL, 16);
-		#else
-		handle->color = strtol(hex_code, NULL, 16);
-		#endif
-	}
-	if (h0->changed || h1->changed || h2->changed) {
-		handle->changed = current->changed = true;
-	}
-
-	// Do not close if user clicks
-	if (current->input_released && ui_input_in_rect(current->_window_x + px, current->_window_y + py, w, h < 0 ? (current->_y - py) : h) && current->input_released) {
-		current->changed = true;
-	}
-
-	return handle->color;
-}
-
-static void scroll_align(ui_t *current, ui_handle_t *handle) {
-	// Scroll down
-	if ((handle->position + 1) * UI_ELEMENT_H() + current->current_window->scroll_offset > current->_h - current->window_header_h) {
-		current->current_window->scroll_offset -= UI_ELEMENT_H();
-	}
-	// Scroll up
-	else if ((handle->position + 1) * UI_ELEMENT_H() + current->current_window->scroll_offset < current->window_header_h) {
-		current->current_window->scroll_offset += UI_ELEMENT_H();
-	}
-}
-
-static char *right_align_number(char *s, int number, int length) {
-	sprintf(s, "%d", number);
-	while (strlen(s) < length) {
-		for (int i = strlen(s) + 1; i > 0; --i) {
-			s[i] = s[i - 1];
-		}
-		s[0] = ' ';
-	}
-	return s;
-}
-
-static void handle_line_select(ui_t *current, ui_handle_t *handle) {
-	if (current->is_shift_down) {
-		current->highlight_anchor = 0;
-		if (text_area_selection_start == -1) {
-			text_area_selection_start = handle->position;
-		}
-	}
-	else text_area_selection_start = -1;
-}
-
-static int ui_word_count(char *str) {
-	if (str == NULL || str[0] == '\0') {
-		return 0;
-	}
-	int i = 0;
-	int count = 1;
-	while (str[i] != '\0') {
-		if (str[i] == ' ' || str[i] == '\n') {
-			count++;
-		}
-		i++;
-	}
-	return count;
-}
-
-static char temp[128];
-
-static char *ui_extract_word(char *str, int word) {
-	int pos = 0;
-	int len = strlen(str);
-	int word_i = 0;
-	for (int i = 0; i < len; ++i) {
-		if (str[i] == ' ' || str[i] == '\n') {
-			word_i++;
-			continue;
-		}
-		if (word_i < word) {
-			continue;
-		}
-		if (word_i > word) {
-			break;
-		}
-		temp[pos++] = str[i];
-	}
-	temp[pos] = 0;
-	return temp;
-}
-
-static int ui_line_pos(char *str, int line) {
-	int i = 0;
-	int current_line = 0;
-	while (str[i] != '\0' && current_line < line) {
-		if (str[i] == '\n') {
-			current_line++;
-		}
-		i++;
-	}
-	return i;
-}
-
-char *ui_text_area(ui_handle_t *handle, int align, bool editable, char *label, bool word_wrap) {
-	ui_t *current = ui_get_current();
-	handle->text = string_replace_all(handle->text, "\t", "    ");
-	bool selected = current->text_selected_handle == handle; // Text being edited
-
-	char lines[4096];
-	strcpy(lines, handle->text);
-	int line_count = ui_line_count(lines);
-	bool show_label = (line_count == 1 && lines[0] == '\0');
-	bool key_pressed = selected && current->is_key_pressed;
-	current->highlight_on_select = false;
-	current->tab_switch_enabled = false;
-
-	if (word_wrap && handle->text[0] != '\0') {
-		bool cursor_set = false;
-		int cursor_pos = current->cursor_x;
-		for (int i = 0; i < handle->position; ++i) {
-			cursor_pos += strlen(ui_extract_line(lines, i)) + 1; // + '\n'
-		}
-		int word_count = ui_word_count(lines);
-		char line[1024];
-		line[0] = '\0';
-		char new_lines[4096];
-		new_lines[0] = '\0';
-		for (int i = 0; i < word_count; ++i) {
-			char *w = ui_extract_word(lines, i);
-			float spacew = kinc_g2_string_width(current->ops->font->font_, current->font_size, " ");
-			float wordw = spacew + kinc_g2_string_width(current->ops->font->font_, current->font_size, w);
-			float linew = wordw + kinc_g2_string_width(current->ops->font->font_, current->font_size, line);
-			if (linew > current->_w - 10 && linew > wordw) {
-				if (new_lines[0] != '\0') {
-					strcat(new_lines, "\n");
-				}
-				strcat(new_lines, line);
-				line[0] = '\0';
-			}
-
-			if (line[0] == '\0') {
-				strcpy(line, w);
-			}
-			else {
-				strcat(line, " ");
-				strcat(line, w);
-			}
-
-			int new_line_count = new_lines[0] == '\0' ? 0 : ui_line_count(new_lines);
-			int lines_len = new_line_count;
-			for (int i = 0; i < new_line_count; ++i) {
-				lines_len += strlen(ui_extract_line(new_lines, i));
-			}
-
-			if (selected && !cursor_set && cursor_pos <= lines_len + strlen(line)) {
-				cursor_set = true;
-				handle->position = new_line_count;
-				current->cursor_x = current->highlight_anchor = cursor_pos - lines_len;
-			}
-		}
-		if (new_lines[0] != '\0') {
-			strcat(new_lines, "\n");
-		}
-		strcat(new_lines, line);
-		if (selected) {
-			strcpy(handle->text, ui_extract_line(new_lines, handle->position));
-			strcpy(current->text_selected, handle->text);
-		}
-		strcpy(lines, new_lines);
-	}
-	int cursor_start_x = current->cursor_x;
-
-	if (ui_text_area_line_numbers) {
-		float _y = current->_y;
-		int _TEXT_COL = current->ops->theme->TEXT_COL;
-		current->ops->theme->TEXT_COL = current->ops->theme->HOVER_COL;
-		int max_length = ceil(log(line_count + 0.5) / log(10)); // Express log_10 with natural log
-		char s[64];
-		for (int i = 0; i < line_count; ++i) {
-			ui_text(right_align_number(&s[0], i + 1, max_length), UI_ALIGN_LEFT, 0x00000000);
-			current->_y -= UI_ELEMENT_OFFSET();
-		}
-		current->ops->theme->TEXT_COL = _TEXT_COL;
-		current->_y = _y;
-
-		sprintf(s, "%d", line_count);
-		float numbers_w = (strlen(s) * 16 + 4) * UI_SCALE();
-		current->_x += numbers_w;
-		current->_w -= numbers_w - UI_SCROLL_W();
-	}
-
-	kinc_g2_set_color(current->ops->theme->SEPARATOR_COL); // Background
-	ui_draw_rect(true, current->_x + current->button_offset_y, current->_y + current->button_offset_y, current->_w - current->button_offset_y * 2, line_count * UI_ELEMENT_H() - current->button_offset_y * 2);
-
-	ui_text_coloring_t *_text_coloring = current->text_coloring;
-	current->text_coloring = ui_text_area_coloring;
-
-	if (current->input_started) {
-		text_area_selection_start = -1;
-	}
-
-	for (int i = 0; i < line_count; ++i) { // Draw lines
-		char *line = ui_extract_line(lines, i);
-		// Text input
-		if ((!selected && ui_get_hover(UI_ELEMENT_H())) || (selected && i == handle->position)) {
-			handle->position = i; // Set active line
-			strcpy(handle->text, line);
-			current->submit_text_handle = NULL;
-			ui_text_input(handle, show_label ? label : "", align, editable, false);
-			if (key_pressed && current->key_code != KINC_KEY_RETURN && current->key_code != KINC_KEY_ESCAPE) { // Edit text
-				int line_pos = ui_line_pos(lines, i);
-				ui_remove_chars_at(lines, line_pos, strlen(line));
-				strcpy(line, current->text_selected);
-				ui_insert_chars_at(lines, line_pos, line);
-			}
-		}
-		// Text
-		else {
-			if (show_label) {
-				int TEXT_COL = current->ops->theme->TEXT_COL;
-				current->ops->theme->TEXT_COL = current->ops->theme->LABEL_COL;
-				ui_text(label, UI_ALIGN_RIGHT, 0x00000000);
-				current->ops->theme->TEXT_COL = TEXT_COL;
-			}
-			else {
-				// Multi-line selection highlight
-				if (text_area_selection_start > -1 &&
-					(i >= text_area_selection_start && i < handle->position) ||
-					(i <= text_area_selection_start && i > handle->position)) {
-					int line_height = UI_ELEMENT_H();
-					int cursor_height = line_height - current->button_offset_y * 3.0;
-					int linew = kinc_g2_string_width(current->ops->font->font_, current->font_size, line);
-					kinc_g2_set_color(current->ops->theme->ACCENT_COL);
-					kinc_g2_fill_rect(current->_x + UI_ELEMENT_OFFSET() * 2.0, current->_y + current->button_offset_y * 1.5, linew, cursor_height);
-				}
-				ui_text(line, align, 0x00000000);
-			}
-		}
-		current->_y -= UI_ELEMENT_OFFSET();
-	}
-	current->_y += UI_ELEMENT_OFFSET();
-	current->text_coloring = _text_coloring;
-
-	if (ui_text_area_scroll_past_end) {
-		current->_y += current->_h - current->window_header_h - UI_ELEMENT_H() - UI_ELEMENT_OFFSET();
-	}
-
-	if (key_pressed) {
-		// Move cursor vertically
-		if (current->key_code == KINC_KEY_DOWN && handle->position < line_count - 1) {
-			handle_line_select(current, handle);
-			handle->position++;
-			scroll_align(current, handle);
-		}
-		if (current->key_code == KINC_KEY_UP && handle->position > 0) {
-			handle_line_select(current, handle);
-			handle->position--;
-			scroll_align(current, handle);
-		}
-		// New line
-		if (editable && current->key_code == KINC_KEY_RETURN && !word_wrap) {
-			handle->position++;
-			ui_insert_char_at(lines, ui_line_pos(lines, handle->position - 1) + current->cursor_x, '\n');
-			ui_start_text_edit(handle, UI_ALIGN_LEFT);
-			current->cursor_x = current->highlight_anchor = 0;
-			scroll_align(current, handle);
-		}
-		// Delete line
-		if (editable && current->key_code == KINC_KEY_BACKSPACE && cursor_start_x == 0 && handle->position > 0) {
-			handle->position--;
-			current->cursor_x = current->highlight_anchor = strlen(ui_extract_line(lines, handle->position));
-			ui_remove_chars_at(lines, ui_line_pos(lines, handle->position + 1) - 1, 1); // Remove '\n' of the previous line
-			scroll_align(current, handle);
-		}
-		strcpy(current->text_selected, ui_extract_line(lines, handle->position));
-	}
-
-	current->highlight_on_select = true;
-	current->tab_switch_enabled = true;
-	handle->text = string_copy(lines);
-	return handle->text;
-}
-
-float UI_MENUBAR_H() {
-	ui_t *current = ui_get_current();
-	return UI_BUTTON_H() * 1.1 + 2.0 + current->button_offset_y;
-}
-
-void ui_begin_menu() {
-	ui_t *current = ui_get_current();
-	_ELEMENT_OFFSET = current->ops->theme->ELEMENT_OFFSET;
-	_BUTTON_COL = current->ops->theme->BUTTON_COL;
-	current->ops->theme->ELEMENT_OFFSET = 0;
-	current->ops->theme->BUTTON_COL = current->ops->theme->SEPARATOR_COL;
-	kinc_g2_set_color(current->ops->theme->SEPARATOR_COL);
-	kinc_g2_fill_rect(0, 0, current->_window_w, UI_MENUBAR_H());
-}
-
-void ui_end_menu() {
-	ui_t *current = ui_get_current();
-	current->ops->theme->ELEMENT_OFFSET = _ELEMENT_OFFSET;
-	current->ops->theme->BUTTON_COL = _BUTTON_COL;
-}
-
-bool _ui_menu_button(char *text) {
-	ui_t *current = ui_get_current();
-	current->_w = kinc_g2_string_width(current->ops->font->font_, current->font_size, text) + 25.0 * UI_SCALE();
-	return ui_button(text, UI_ALIGN_CENTER, "");
-}

+ 0 - 24
armorcore/sources/iron_ui_ext.h

@@ -1,24 +0,0 @@
-#pragma once
-
-#include "iron_ui.h"
-
-float ui_float_input(ui_handle_t *handle, char *label, int align, float precision);
-char *ui_file_browser(ui_handle_t *handle, bool folders_only);
-int ui_inline_radio(ui_handle_t *handle, char_ptr_array_t *texts, int align);
-int ui_color_wheel(ui_handle_t *handle, bool alpha, float w, float h, bool color_preview, void (*picker)(void *), void *data);
-char *ui_text_area(ui_handle_t *handle, int align, bool editable, char *label, bool word_wrap);
-void ui_begin_menu();
-void ui_end_menu();
-bool _ui_menu_button(char *text);
-void ui_hsv_to_rgb(float cr, float cg, float cb, float *out);
-void ui_rgb_to_hsv(float cr, float cg, float cb, float *out);
-
-uint8_t ui_color_r(uint32_t color);
-uint8_t ui_color_g(uint32_t color);
-uint8_t ui_color_b(uint32_t color);
-uint8_t ui_color_a(uint32_t color);
-uint32_t ui_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
-
-extern bool ui_text_area_line_numbers;
-extern bool ui_text_area_scroll_past_end;
-extern ui_text_coloring_t *ui_text_area_coloring;

+ 0 - 3
armorcore/sources/iron_vec3.h

@@ -1,3 +0,0 @@
-#pragma once
-
-#include <kinc/vector.h>

+ 0 - 3
armorcore/sources/kinc/a2.c

@@ -1,3 +0,0 @@
-#define KINC_IMPLEMENTATION_AUDIO2
-
-#include "a2.h"

+ 0 - 90
armorcore/sources/kinc/a2.h

@@ -1,90 +0,0 @@
-#pragma once
-
-#ifdef KINC_A2
-
-#include <kinc/global.h>
-
-#include <stdint.h>
-
-/*! \file audio.h
-    \brief Audio2 is a low-level audio-API that allows you to directly provide a stream of audio-samples.
-*/
-
-#define KINC_A2_MAX_CHANNELS 8
-
-typedef struct kinc_a2_buffer {
-	uint8_t channel_count;
-	float *channels[KINC_A2_MAX_CHANNELS];
-	uint32_t data_size;
-	uint32_t read_location;
-	uint32_t write_location;
-} kinc_a2_buffer_t;
-
-void kinc_a2_init(void);
-void kinc_a2_set_callback(void (*kinc_a2_audio_callback)(kinc_a2_buffer_t *buffer, uint32_t samples, void *userdata), void *userdata);
-uint32_t kinc_a2_samples_per_second(void);
-void kinc_a2_set_sample_rate_callback(void (*kinc_a2_sample_rate_callback)(void *userdata), void *userdata);
-void kinc_a2_update(void);
-void kinc_a2_shutdown(void);
-
-void kinc_a2_internal_init(void);
-bool kinc_a2_internal_callback(kinc_a2_buffer_t *buffer, int samples);
-void kinc_a2_internal_sample_rate_callback(void);
-
-#ifdef KINC_IMPLEMENTATION_AUDIO2
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <kinc/mutex.h>
-#include <memory.h>
-#include <stddef.h>
-
-static kinc_mutex_t mutex;
-
-static void (*a2_callback)(kinc_a2_buffer_t *buffer, uint32_t samples, void *userdata) = NULL;
-static void *a2_userdata = NULL;
-
-void kinc_a2_set_callback(void (*kinc_a2_audio_callback)(kinc_a2_buffer_t *buffer, uint32_t samples, void *userdata), void *userdata) {
-	kinc_mutex_lock(&mutex);
-	a2_callback = kinc_a2_audio_callback;
-	a2_userdata = userdata;
-	kinc_mutex_unlock(&mutex);
-}
-
-static void (*a2_sample_rate_callback)(void *userdata) = NULL;
-static void *a2_sample_rate_userdata = NULL;
-
-void kinc_a2_set_sample_rate_callback(void (*kinc_a2_sample_rate_callback)(void *userdata), void *userdata) {
-	kinc_mutex_lock(&mutex);
-	a2_sample_rate_callback = kinc_a2_sample_rate_callback;
-	a2_sample_rate_userdata = userdata;
-	kinc_mutex_unlock(&mutex);
-}
-
-void kinc_a2_internal_init(void) {
-	kinc_mutex_init(&mutex);
-}
-
-bool kinc_a2_internal_callback(kinc_a2_buffer_t *buffer, int samples) {
-	kinc_mutex_lock(&mutex);
-	bool has_callback = a2_callback != NULL;
-	if (has_callback) {
-		a2_callback(buffer, samples, a2_userdata);
-	}
-	kinc_mutex_unlock(&mutex);
-	return has_callback;
-}
-
-void kinc_a2_internal_sample_rate_callback(void) {
-	kinc_mutex_lock(&mutex);
-	if (a2_sample_rate_callback != NULL) {
-		a2_sample_rate_callback(a2_sample_rate_userdata);
-	}
-	kinc_mutex_unlock(&mutex);
-}
-
-#endif
-
-#endif

+ 0 - 8
armorcore/sources/kinc/atomic.h

@@ -1,8 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <kinc/backend/atomic.h>
-
-/*! \file atomic.h
-    \brief Provides atomics aka interlocked operations.
-*/

+ 0 - 25
armorcore/sources/kinc/color.h

@@ -1,25 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <stdint.h>
-
-/*! \file color.h
-    \brief Provides some utility functionality for handling 32 bit ARGB color values.
-*/
-
-void kinc_color_components(uint32_t color, float *red, float *green, float *blue, float *alpha);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-void kinc_color_components(uint32_t color, float *red, float *green, float *blue, float *alpha) {
-	*alpha = ((color & 0xff000000) >> 24) / 255.0f;
-	*red = ((color & 0x00ff0000) >> 16) / 255.0f;
-	*green = ((color & 0x0000ff00) >> 8) / 255.0f;
-	*blue = (color & 0x000000ff) / 255.0f;
-}
-
-#endif

+ 0 - 62
armorcore/sources/kinc/core.h

@@ -1,62 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file core.h
-    \brief Just a few very simple additions to math.h
-   the C-lib.
-*/
-
-#define KINC_PI 3.141592654
-#define KINC_TAU 6.283185307
-
-float kinc_cot(float x);
-float kinc_round(float value);
-float kinc_abs(float value);
-float kinc_min(float a, float b);
-float kinc_max(float a, float b);
-int kinc_mini(int a, int b);
-int kinc_maxi(int a, int b);
-float kinc_clamp(float value, float minValue, float maxValue);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <math.h>
-
-float kinc_cot(float x) {
-	return cosf(x) / sinf(x);
-}
-
-float kinc_round(float value) {
-	return floorf(value + 0.5f);
-}
-
-float kinc_abs(float value) {
-	return value < 0 ? -value : value;
-}
-
-float kinc_min(float a, float b) {
-	return a > b ? b : a;
-}
-
-float kinc_max(float a, float b) {
-	return a > b ? a : b;
-}
-
-int kinc_mini(int a, int b) {
-	return a > b ? b : a;
-}
-
-int kinc_maxi(int a, int b) {
-	return a > b ? a : b;
-}
-
-float kinc_clamp(float value, float minValue, float maxValue) {
-	return kinc_max(minValue, kinc_min(maxValue, value));
-}
-
-#endif

+ 0 - 28
armorcore/sources/kinc/display.h

@@ -1,28 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-#include <stdbool.h>
-
-/*! \file display.h
-    \brief Provides information for the active displays.
-*/
-
-typedef struct kinc_display_mode {
-	int x;
-	int y;
-	int width;
-	int height;
-	int pixels_per_inch;
-	int frequency;
-	int bits_per_pixel;
-} kinc_display_mode_t;
-
-void kinc_display_init(void);
-int kinc_primary_display(void);
-int kinc_count_displays(void);
-bool kinc_display_available(int display_index);
-const char *kinc_display_name(int display_index);
-kinc_display_mode_t kinc_display_current_mode(int display_index);
-int kinc_display_count_available_modes(int display_index);
-kinc_display_mode_t kinc_display_available_mode(int display_index, int mode_index);

+ 0 - 95
armorcore/sources/kinc/error.h

@@ -1,95 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <stdarg.h>
-
-/*! \file error.h
-    \brief Contains functionality to stop the program in case of an error and create a user-visible error message.
-
-    The affirm and error functions print an error message and then exit the program. Error messages can be made
-    visible to the user (unless a console window is active this is only implemented for Windows).
-*/
-
-void kinc_affirm(bool condition);
-void kinc_affirm_args(bool condition, const char *format, va_list args);
-void kinc_error(void);
-void kinc_error_message(const char *format, ...);
-void kinc_error_args(const char *format, va_list args);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#ifndef KINC_IMPLEMENTATION_ROOT
-#undef KINC_IMPLEMENTATION
-#endif
-#include <kinc/log.h>
-#ifndef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#include <stdlib.h>
-
-#ifdef KINC_WINDOWS
-
-#include <kinc/backend/miniwindows.h>
-#include <kinc/backend/system_microsoft.h>
-#endif
-
-void kinc_affirm(bool condition) {
-	if (!condition) {
-		kinc_error();
-	}
-}
-
-void kinc_affirm_args(bool condition, const char *format, va_list args) {
-	if (!condition) {
-		kinc_error_args(format, args);
-	}
-}
-
-void kinc_error(void) {
-	kinc_error_message("Unknown error");
-}
-
-void kinc_error_message(const char *format, ...) {
-	{
-		va_list args;
-		va_start(args, format);
-		kinc_log_args(KINC_LOG_LEVEL_ERROR, format, args);
-		va_end(args);
-	}
-
-#ifdef KINC_WINDOWS
-	{
-		va_list args;
-		va_start(args, format);
-		wchar_t buffer[4096];
-		kinc_microsoft_format(format, args, buffer);
-		MessageBoxW(NULL, buffer, L"Error", 0);
-		va_end(args);
-	}
-#endif
-
-#ifndef KINC_NO_CLIB
-	exit(EXIT_FAILURE);
-#endif
-}
-
-void kinc_error_args(const char *format, va_list args) {
-	kinc_log_args(KINC_LOG_LEVEL_ERROR, format, args);
-
-#ifdef KINC_WINDOWS
-	wchar_t buffer[4096];
-	kinc_microsoft_format(format, args, buffer);
-	MessageBoxW(NULL, buffer, L"Error", 0);
-#endif
-
-#ifndef KINC_NO_CLIB
-	exit(EXIT_FAILURE);
-#endif
-}
-
-#endif

+ 0 - 82
armorcore/sources/kinc/filewriter.h

@@ -1,82 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <stdbool.h>
-
-/*! \file filewriter.h
-    \brief Provides an API very similar to fwrite and friends but uses a directory that can actually used for persistent file storage. This can later be read
-   using the kinc_file_reader-functions and KINC_FILE_TYPE_SAVE.
-*/
-
-typedef struct kinc_file_writer {
-	void *file;
-	const char *filename;
-} kinc_file_writer_t;
-
-bool kinc_file_writer_open(kinc_file_writer_t *writer, const char *filepath);
-void kinc_file_writer_write(kinc_file_writer_t *writer, void *data, int size);
-void kinc_file_writer_close(kinc_file_writer_t *writer);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include "filewriter.h"
-
-#undef KINC_IMPLEMENTATION
-#include <kinc/error.h>
-#include <kinc/log.h>
-#include <kinc/system.h>
-#define KINC_IMPLEMENTATION
-
-#include <stdio.h>
-#include <string.h>
-
-#if defined(KINC_WINDOWS)
-#include <kinc/backend/miniwindows.h>
-#endif
-
-bool kinc_file_writer_open(kinc_file_writer_t *writer, const char *filepath) {
-	writer->file = NULL;
-
-	char path[1001];
-	strcpy(path, kinc_internal_save_path());
-	strcat(path, filepath);
-
-#ifdef KINC_WINDOWS
-	wchar_t wpath[MAX_PATH];
-	MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_PATH);
-	writer->file = CreateFileW(wpath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-#else
-	writer->file = fopen(path, "wb");
-#endif
-	if (writer->file == NULL) {
-		kinc_log(KINC_LOG_LEVEL_WARNING, "Could not open file %s.", filepath);
-		return false;
-	}
-	return true;
-}
-
-void kinc_file_writer_close(kinc_file_writer_t *writer) {
-	if (writer->file != NULL) {
-#ifdef KINC_WINDOWS
-		CloseHandle(writer->file);
-#else
-		fclose((FILE *)writer->file);
-#endif
-		writer->file = NULL;
-	}
-}
-
-void kinc_file_writer_write(kinc_file_writer_t *writer, void *data, int size) {
-#ifdef KINC_WINDOWS
-	DWORD written = 0;
-	WriteFile(writer->file, data, (DWORD)size, &written, NULL);
-#else
-	fwrite(data, 1, size, (FILE *)writer->file);
-#endif
-}
-
-#endif

+ 0 - 77
armorcore/sources/kinc/g2.h

@@ -1,77 +0,0 @@
-
-// This implementation was adapted from tizilogic's krink and robdangerous' kha, licensed under zlib/libpng license
-// https://github.com/tizilogic/krink/blob/main/Sources/krink/graphics2/graphics.h
-// https://github.com/Kode/Kha/tree/main/Sources/kha/graphics2
-
-#pragma once
-
-#include <kinc/matrix.h>
-#include <kinc/g5_texture.h>
-#include <kinc/g5_pipeline.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include "iron_array.h"
-
-typedef struct image {
-	void *texture_;
-	void *render_target_;
-	int format; // tex_format_t;
-	bool readable;
-	buffer_t *pixels;
-	int width;
-	int height;
-	int depth;
-} image_t;
-
-typedef struct kinc_g2_font_image kinc_g2_font_image_t;
-
-typedef struct kinc_g2_font {
-	unsigned char *blob;
-	kinc_g2_font_image_t *images;
-	size_t m_capacity;
-	size_t m_images_len;
-	int offset;
-} kinc_g2_font_t;
-
-typedef struct g2_font {
-	kinc_g2_font_t *font_;
-	void *blob; // buffer_t
-	void *glyphs; // i32_array_t
-	int index;
-} g2_font_t;
-
-void kinc_g2_init(buffer_t *image_vert, buffer_t *image_frag, buffer_t *colored_vert, buffer_t *colored_frag, buffer_t *text_vert, buffer_t *text_frag);
-void kinc_g2_begin(void);
-void kinc_g2_draw_scaled_sub_image(image_t *img, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
-void kinc_g2_draw_scaled_sub_texture(kinc_g5_texture_t *tex, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
-void kinc_g2_draw_scaled_image(kinc_g5_texture_t *tex, float dx, float dy, float dw, float dh);
-void kinc_g2_draw_sub_image(kinc_g5_texture_t *tex, float sx, float sy, float sw, float sh, float x, float y);
-void kinc_g2_draw_image(kinc_g5_texture_t *tex, float x, float y);
-void kinc_g2_draw_scaled_sub_render_target(kinc_g5_render_target_t *rt, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
-void kinc_g2_draw_scaled_render_target(kinc_g5_render_target_t *rt, float dx, float dy, float dw, float dh);
-void kinc_g2_draw_sub_render_target(kinc_g5_render_target_t *rt, float sx, float sy, float sw, float sh, float x, float y);
-void kinc_g2_draw_render_target(kinc_g5_render_target_t *rt, float x, float y);
-void kinc_g2_fill_triangle(float x0, float y0, float x1, float y1, float x2, float y2);
-void kinc_g2_fill_rect(float x, float y, float width, float height);
-void kinc_g2_draw_rect(float x, float y, float width, float height, float strength);
-void kinc_g2_draw_line(float x0, float y0, float x1, float y1, float strength);
-void kinc_g2_draw_line_aa(float x0, float y0, float x1, float y1, float strength);
-void kinc_g2_draw_string(const char *text, float x, float y);
-void kinc_g2_end(void);
-void kinc_g2_set_color(uint32_t color);
-uint32_t kinc_g2_get_color();
-void kinc_g2_set_pipeline(kinc_g5_pipeline_t *pipeline);
-void kinc_g2_set_transform(buffer_t *matrix);
-bool kinc_g2_set_font(kinc_g2_font_t *font, int size);
-kinc_g2_font_t *kinc_g2_font_init(buffer_t *blob, int font_index);
-kinc_g2_font_t *kinc_g2_font_13(buffer_t *blob);
-bool kinc_g2_font_has_glyph(int glyph);
-void kinc_g2_font_set_glyphs(i32_array_t *glyphs);
-void kinc_g2_font_add_glyph(int glyph);
-int kinc_g2_font_count(kinc_g2_font_t *font);
-int kinc_g2_font_height(kinc_g2_font_t *font, int font_size);
-float kinc_g2_sub_string_width(kinc_g2_font_t *font, int font_size, const char *text, int start, int end);
-int kinc_g2_string_width(kinc_g2_font_t *font, int font_size, const char *text);
-void kinc_g2_set_bilinear_filter(bool bilinear);
-void kinc_g2_restore_render_target(void);
-void kinc_g2_set_render_target(kinc_g5_render_target_t *target);

+ 0 - 126
armorcore/sources/kinc/g2_ext.c

@@ -1,126 +0,0 @@
-#include "g2_ext.h"
-
-#include <math.h>
-#include "g2.h"
-#include "../../iron_vec2.h"
-
-#define MATH_PI 3.14159265358979323846
-
-void kinc_g2_fill_circle(float cx, float cy, float radius, int segments) {
-	if (segments <= 0) {
-		segments = (int)floor(10 * sqrtf(radius));
-	}
-
-	float theta = 2.0 * (float)MATH_PI / segments;
-	float c = cosf(theta);
-	float s = sinf(theta);
-
-	float x = radius;
-	float y = 0.0;
-
-	for (int n = 0; n < segments; ++n) {
-		float px = x + cx;
-		float py = y + cy;
-
-		float t = x;
-		x = c * x - s * y;
-		y = c * y + s * t;
-
-		kinc_g2_fill_triangle(px, py, x + cx, y + cy, cx, cy);
-	}
-}
-
-void kinc_g2_draw_inner_line(float x1, float y1, float x2, float y2, float strength) {
-	int side = y2 > y1 ? 1 : 0;
-	if (y2 == y1) {
-		side = x2 - x1 > 0 ? 1 : 0;
-	}
-
-	kinc_vector2_t vec;
-	if (y2 == y1) {
-		vec = vec2_create(0, -1);
-	}
-	else {
-		vec = vec2_create(1, -(x2 - x1) / (y2 - y1));
-	}
-	vec = vec2_set_len(vec, strength);
-	kinc_vector2_t p1 = {x1 + side * vec.x, y1 + side * vec.y};
-	kinc_vector2_t p2 = {x2 + side * vec.x, y2 + side * vec.y};
-	kinc_vector2_t p3 = vec2_sub(p1, vec);
-	kinc_vector2_t p4 = vec2_sub(p2, vec);
-	kinc_g2_fill_triangle(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
-	kinc_g2_fill_triangle(p3.x, p3.y, p2.x, p2.y, p4.x, p4.y);
-}
-
-void kinc_g2_draw_circle(float cx, float cy, float radius, int segments, float strength) {
-	radius += strength / 2;
-
-	if (segments <= 0) {
-		segments = (int)floor(10 * sqrtf(radius));
-	}
-
-	float theta = 2 * (float)MATH_PI / segments;
-	float c = cosf(theta);
-	float s = sinf(theta);
-
-	float x = radius;
-	float y = 0.0;
-
-	for (int n = 0; n < segments; ++n) {
-		float px = x + cx;
-		float py = y + cy;
-
-		float t = x;
-		x = c * x - s * y;
-		y = c * y + s * t;
-
-		kinc_g2_draw_inner_line(x + cx, y + cy, px, py, strength);
-	}
-}
-
-void kinc_g2_calculate_cubic_bezier_point(float t, float *x, float *y, float *out) {
-	float u = 1 - t;
-	float tt = t * t;
-	float uu = u * u;
-	float uuu = uu * u;
-	float ttt = tt * t;
-
-	// first term
-	out[0] = uuu * x[0];
-	out[1] = uuu * y[0];
-
-	// second term
-	out[0] += 3 * uu * t * x[1];
-	out[1] += 3 * uu * t * y[1];
-
-	// third term
-	out[0] += 3 * u * tt * x[2];
-	out[1] += 3 * u * tt * y[2];
-
-	// fourth term
-	out[0] += ttt * x[3];
-	out[1] += ttt * y[3];
-}
-
-/**
- * Draws a cubic bezier using 4 pairs of points. If the x and y arrays have a length bigger than 4, the additional
- * points will be ignored. With a length smaller of 4 a error will occur, there is no check for this.
- * You can construct the curves visually in Inkscape with a path using default nodes.
- * Provide x and y in the following order: startPoint, controlPoint1, controlPoint2, endPoint
- * Reference: http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/
- */
-void kinc_g2_draw_cubic_bezier(f32_array_t *xa, f32_array_t *ya, int segments, float strength) {
-	float *x = xa->buffer;
-	float *y = ya->buffer;
-	float q0[2];
-	float q1[2];
-	kinc_g2_calculate_cubic_bezier_point(0, x, y, q0);
-
-	for (int i = 1; i < (segments + 1); ++i) {
-		float t = (float)i / segments;
-		kinc_g2_calculate_cubic_bezier_point(t, x, y, q1);
-		kinc_g2_draw_line(q0[0], q0[1], q1[0], q1[1], strength);
-		q0[0] = q1[0];
-		q0[1] = q1[1];
-	}
-}

+ 0 - 7
armorcore/sources/kinc/g2_ext.h

@@ -1,7 +0,0 @@
-#pragma once
-
-#include "iron_array.h"
-
-void kinc_g2_fill_circle(float cx, float cy, float radius, int segments);
-void kinc_g2_draw_circle(float cx, float cy, float radius, int segments, float strength);
-void kinc_g2_draw_cubic_bezier(f32_array_t *x, f32_array_t *y, int segments, float strength);

+ 0 - 218
armorcore/sources/kinc/g5.h

@@ -1,218 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <kinc/matrix.h>
-#include <kinc/vector.h>
-#include <kinc/g5.h>
-#include <kinc/g5_texture.h>
-#include <kinc/backend/g5_texture.h>
-
-#define KINC_G5_CLEAR_COLOR 1
-#define KINC_G5_CLEAR_DEPTH 2
-
-bool kinc_g5_supports_raytracing(void);
-int kinc_g5_max_bound_textures(void);
-void kinc_g5_flush(void);
-void kinc_g5_begin(struct kinc_g5_render_target *renderTarget);
-void kinc_g5_end(void);
-bool kinc_g5_swap_buffers(void);
-
-void kinc_g5_internal_init(void);
-void kinc_g5_internal_init_window(int depth_buffer_bits, bool vsync);
-void kinc_g5_internal_destroy_window(void);
-void kinc_g5_internal_destroy(void);
-
-struct kinc_g5_pipeline;
-struct kinc_g5_render_target;
-struct kinc_g5_texture;
-struct kinc_g5_texture_unit;
-struct kinc_g5_constant_location;
-struct kinc_g5_index_buffer;
-
-typedef enum {
-	KINC_G4_TEXTURE_ADDRESSING_REPEAT,
-	KINC_G4_TEXTURE_ADDRESSING_MIRROR,
-	KINC_G4_TEXTURE_ADDRESSING_CLAMP,
-	KINC_G4_TEXTURE_ADDRESSING_BORDER
-} kinc_g4_texture_addressing_t;
-
-typedef enum {
-	KINC_G4_TEXTURE_DIRECTION_U,
-	KINC_G4_TEXTURE_DIRECTION_V
-} kinc_g4_texture_direction_t;
-
-typedef enum {
-	KINC_G4_TEXTURE_FILTER_POINT,
-	KINC_G4_TEXTURE_FILTER_LINEAR,
-	KINC_G4_TEXTURE_FILTER_ANISOTROPIC
-} kinc_g4_texture_filter_t;
-
-typedef enum {
-	KINC_G4_MIPMAP_FILTER_NONE,
-	KINC_G4_MIPMAP_FILTER_POINT,
-	KINC_G4_MIPMAP_FILTER_LINEAR // linear texture filter + linear mip filter -> trilinear filter
-} kinc_g4_mipmap_filter_t;
-
-typedef enum kinc_g4_usage {
-    KINC_G4_USAGE_STATIC,
-    KINC_G4_USAGE_DYNAMIC,
-    KINC_G4_USAGE_READABLE
-} kinc_g4_usage_t;
-
-void kinc_g4_begin();
-void kinc_g4_end();
-void kinc_g5_clear(unsigned flags, unsigned color, float depth);
-void kinc_g4_viewport(int x, int y, int width, int height);
-void kinc_g4_scissor(int x, int y, int width, int height);
-void kinc_g4_disable_scissor(void);
-void kinc_g5_draw_indexed_vertices(void);
-void kinc_g5_draw_indexed_vertices_from_to(int start, int count);
-void kinc_g4_set_texture_addressing(struct kinc_g5_texture_unit unit, kinc_g4_texture_direction_t dir, kinc_g4_texture_addressing_t addressing);
-void kinc_g5_set_pipeline(struct kinc_g5_pipeline *pipeline);
-void kinc_g4_set_int(struct kinc_g5_constant_location location, int value);
-void kinc_g4_set_int2(struct kinc_g5_constant_location location, int value1, int value2);
-void kinc_g4_set_int3(struct kinc_g5_constant_location location, int value1, int value2, int value3);
-void kinc_g4_set_int4(struct kinc_g5_constant_location location, int value1, int value2, int value3, int value4);
-void kinc_g4_set_ints(struct kinc_g5_constant_location location, int *values, int count);
-void kinc_g4_set_float(struct kinc_g5_constant_location location, float value);
-void kinc_g4_set_float2(struct kinc_g5_constant_location location, float value1, float value2);
-void kinc_g4_set_float3(struct kinc_g5_constant_location location, float value1, float value2, float value3);
-void kinc_g4_set_float4(struct kinc_g5_constant_location location, float value1, float value2, float value3, float value4);
-void kinc_g4_set_floats(struct kinc_g5_constant_location location, float *values, int count);
-void kinc_g4_set_bool(struct kinc_g5_constant_location location, bool value);
-void kinc_g4_set_matrix3(struct kinc_g5_constant_location location, kinc_matrix3x3_t *value);
-void kinc_g4_set_matrix4(struct kinc_g5_constant_location location, kinc_matrix4x4_t *value);
-void kinc_g4_set_texture_magnification_filter(struct kinc_g5_texture_unit unit, kinc_g4_texture_filter_t filter);
-void kinc_g4_set_texture_minification_filter(struct kinc_g5_texture_unit unit, kinc_g4_texture_filter_t filter);
-void kinc_g4_set_texture_mipmap_filter(struct kinc_g5_texture_unit unit, kinc_g4_mipmap_filter_t filter);
-void kinc_g4_restore_render_target(void);
-void kinc_g4_set_render_targets(struct kinc_g5_render_target **targets, int count);
-void kinc_g4_set_texture(struct kinc_g5_texture_unit unit, struct kinc_g5_texture *texture);
-void kinc_g4_compute(int x, int y, int z);
-void kinc_g4_set_index_buffer(struct kinc_g5_index_buffer *buffer);
-
-void kinc_g4_internal_init_window(int depth_buffer_bits, bool vsync);
-
-void kinc_g4_render_target_use_color_as_texture(struct kinc_g5_render_target *renderTarget, struct kinc_g5_texture_unit unit);
-void kinc_g4_render_target_use_depth_as_texture(struct kinc_g5_render_target *renderTarget, struct kinc_g5_texture_unit unit);
-void kinc_g5_render_target_get_pixels(struct kinc_g5_render_target *renderTarget, uint8_t *data);
-void kinc_g5_render_target_generate_mipmaps(struct kinc_g5_render_target *renderTarget, int levels);
-
-void kinc_g4_index_buffer_unlock_all(struct kinc_g5_index_buffer *buffer);
-void kinc_g4_index_buffer_unlock(struct kinc_g5_index_buffer *buffer, int count);
-
-#define KINC_G5_MAX_VERTEX_ELEMENTS 16
-
-typedef enum kinc_g5_vertex_data {
-	KINC_G5_VERTEX_DATA_NONE = 0,
-	KINC_G5_VERTEX_DATA_F32_1X = 1,
-	KINC_G5_VERTEX_DATA_F32_2X = 2,
-	KINC_G5_VERTEX_DATA_F32_3X = 3,
-	KINC_G5_VERTEX_DATA_F32_4X = 4,
-	KINC_G5_VERTEX_DATA_F32_4X4 = 5,
-	KINC_G5_VERTEX_DATA_I8_1X = 6,
-	KINC_G5_VERTEX_DATA_U8_1X = 7,
-	KINC_G5_VERTEX_DATA_I8_1X_NORMALIZED = 8,
-	KINC_G5_VERTEX_DATA_U8_1X_NORMALIZED = 9,
-	KINC_G5_VERTEX_DATA_I8_2X = 10,
-	KINC_G5_VERTEX_DATA_U8_2X = 11,
-	KINC_G5_VERTEX_DATA_I8_2X_NORMALIZED = 12,
-	KINC_G5_VERTEX_DATA_U8_2X_NORMALIZED = 13,
-	KINC_G5_VERTEX_DATA_I8_4X = 14,
-	KINC_G5_VERTEX_DATA_U8_4X = 15,
-	KINC_G5_VERTEX_DATA_I8_4X_NORMALIZED = 16,
-	KINC_G5_VERTEX_DATA_U8_4X_NORMALIZED = 17,
-	KINC_G5_VERTEX_DATA_I16_1X = 18,
-	KINC_G5_VERTEX_DATA_U16_1X = 19,
-	KINC_G5_VERTEX_DATA_I16_1X_NORMALIZED = 20,
-	KINC_G5_VERTEX_DATA_U16_1X_NORMALIZED = 21,
-	KINC_G5_VERTEX_DATA_I16_2X = 22,
-	KINC_G5_VERTEX_DATA_U16_2X = 23,
-	KINC_G5_VERTEX_DATA_I16_2X_NORMALIZED = 24,
-	KINC_G5_VERTEX_DATA_U16_2X_NORMALIZED = 25,
-	KINC_G5_VERTEX_DATA_I16_4X = 26,
-	KINC_G5_VERTEX_DATA_U16_4X = 27,
-	KINC_G5_VERTEX_DATA_I16_4X_NORMALIZED = 28,
-	KINC_G5_VERTEX_DATA_U16_4X_NORMALIZED = 29,
-	KINC_G5_VERTEX_DATA_I32_1X = 30,
-	KINC_G5_VERTEX_DATA_U32_1X = 31,
-	KINC_G5_VERTEX_DATA_I32_2X = 32,
-	KINC_G5_VERTEX_DATA_U32_2X = 33,
-	KINC_G5_VERTEX_DATA_I32_3X = 34,
-	KINC_G5_VERTEX_DATA_U32_3X = 35,
-	KINC_G5_VERTEX_DATA_I32_4X = 36,
-	KINC_G5_VERTEX_DATA_U32_4X = 37,
-} kinc_g5_vertex_data_t;
-
-typedef struct kinc_g5_vertex_element {
-	const char *name;
-	kinc_g5_vertex_data_t data;
-} kinc_g5_vertex_element_t;
-
-typedef struct kinc_g5_vertex_structure {
-	kinc_g5_vertex_element_t elements[KINC_G5_MAX_VERTEX_ELEMENTS];
-	int size;
-} kinc_g5_vertex_structure_t;
-
-static inline int kinc_g5_vertex_data_size(kinc_g5_vertex_data_t data) {
-	switch (data) {
-	default:
-	case KINC_G5_VERTEX_DATA_NONE:
-		return 0;
-	case KINC_G5_VERTEX_DATA_F32_1X:
-		return 1 * 4;
-	case KINC_G5_VERTEX_DATA_F32_2X:
-		return 2 * 4;
-	case KINC_G5_VERTEX_DATA_F32_3X:
-		return 3 * 4;
-	case KINC_G5_VERTEX_DATA_F32_4X:
-		return 4 * 4;
-	case KINC_G5_VERTEX_DATA_F32_4X4:
-		return 4 * 4 * 4;
-	case KINC_G5_VERTEX_DATA_I8_1X:
-	case KINC_G5_VERTEX_DATA_U8_1X:
-	case KINC_G5_VERTEX_DATA_I8_1X_NORMALIZED:
-	case KINC_G5_VERTEX_DATA_U8_1X_NORMALIZED:
-		return 1 * 1;
-	case KINC_G5_VERTEX_DATA_I8_2X:
-	case KINC_G5_VERTEX_DATA_U8_2X:
-	case KINC_G5_VERTEX_DATA_I8_2X_NORMALIZED:
-	case KINC_G5_VERTEX_DATA_U8_2X_NORMALIZED:
-		return 2 * 1;
-	case KINC_G5_VERTEX_DATA_I8_4X:
-	case KINC_G5_VERTEX_DATA_U8_4X:
-	case KINC_G5_VERTEX_DATA_I8_4X_NORMALIZED:
-	case KINC_G5_VERTEX_DATA_U8_4X_NORMALIZED:
-		return 4 * 1;
-	case KINC_G5_VERTEX_DATA_I16_1X:
-	case KINC_G5_VERTEX_DATA_U16_1X:
-	case KINC_G5_VERTEX_DATA_I16_1X_NORMALIZED:
-	case KINC_G5_VERTEX_DATA_U16_1X_NORMALIZED:
-		return 1 * 2;
-	case KINC_G5_VERTEX_DATA_I16_2X:
-	case KINC_G5_VERTEX_DATA_U16_2X:
-	case KINC_G5_VERTEX_DATA_I16_2X_NORMALIZED:
-	case KINC_G5_VERTEX_DATA_U16_2X_NORMALIZED:
-		return 2 * 2;
-	case KINC_G5_VERTEX_DATA_I16_4X:
-	case KINC_G5_VERTEX_DATA_U16_4X:
-	case KINC_G5_VERTEX_DATA_I16_4X_NORMALIZED:
-	case KINC_G5_VERTEX_DATA_U16_4X_NORMALIZED:
-		return 4 * 2;
-	case KINC_G5_VERTEX_DATA_I32_1X:
-	case KINC_G5_VERTEX_DATA_U32_1X:
-		return 1 * 4;
-	case KINC_G5_VERTEX_DATA_I32_2X:
-	case KINC_G5_VERTEX_DATA_U32_2X:
-		return 2 * 4;
-	case KINC_G5_VERTEX_DATA_I32_3X:
-	case KINC_G5_VERTEX_DATA_U32_3X:
-		return 3 * 4;
-	case KINC_G5_VERTEX_DATA_I32_4X:
-	case KINC_G5_VERTEX_DATA_U32_4X:
-		return 4 * 4;
-	}
-}
-
-void kinc_g5_vertex_structure_init(kinc_g5_vertex_structure_t *structure);
-void kinc_g5_vertex_structure_add(kinc_g5_vertex_structure_t *structure, const char *name, kinc_g5_vertex_data_t data);

+ 0 - 166
armorcore/sources/kinc/g5_buffer.c.h

@@ -1,166 +0,0 @@
-#include "g5_buffer.h"
-#include <kinc/g5.h>
-
-extern bool waitAfterNextDraw;
-
-void kinc_g4_vertex_buffer_init(kinc_g4_vertex_buffer_t *buffer, int count, kinc_g5_vertex_structure_t *structure, kinc_g4_usage_t usage) {
-	buffer->impl._multiple = usage == KINC_G4_USAGE_STATIC ? 1 : 2;
-	buffer->impl._currentIndex = 0;
-	buffer->impl.myCount = count;
-	for (int i = 0; i < buffer->impl._multiple; ++i) {
-		kinc_g5_vertex_buffer_init(&buffer->impl._buffer[i], count, structure, usage == KINC_G4_USAGE_STATIC);
-	}
-}
-
-void kinc_g4_vertex_buffer_destroy(kinc_g4_vertex_buffer_t *buffer) {
-	for (int i = 0; i < buffer->impl._multiple; ++i) {
-		kinc_g5_vertex_buffer_destroy(&buffer->impl._buffer[i]);
-	}
-}
-
-static void kinc_internal_prepare_lock(kinc_g4_vertex_buffer_t *buffer) {
-	++buffer->impl._currentIndex;
-	if (buffer->impl._currentIndex >= buffer->impl._multiple - 1) {
-		waitAfterNextDraw = true;
-	}
-	if (buffer->impl._currentIndex >= buffer->impl._multiple) {
-		buffer->impl._currentIndex = 0;
-	}
-}
-
-float *kinc_g4_vertex_buffer_lock_all(kinc_g4_vertex_buffer_t *buffer) {
-	kinc_internal_prepare_lock(buffer);
-	return kinc_g5_vertex_buffer_lock_all(&buffer->impl._buffer[buffer->impl._currentIndex]);
-}
-
-float *kinc_g4_vertex_buffer_lock(kinc_g4_vertex_buffer_t *buffer, int start, int count) {
-	kinc_internal_prepare_lock(buffer);
-	return kinc_g5_vertex_buffer_lock(&buffer->impl._buffer[buffer->impl._currentIndex], start, count);
-}
-
-void kinc_g4_vertex_buffer_unlock_all(kinc_g4_vertex_buffer_t *buffer) {
-	kinc_g5_vertex_buffer_unlock_all(&buffer->impl._buffer[buffer->impl._currentIndex]);
-}
-
-void kinc_g4_vertex_buffer_unlock(kinc_g4_vertex_buffer_t *buffer, int count) {
-	kinc_g5_vertex_buffer_unlock(&buffer->impl._buffer[buffer->impl._currentIndex], count);
-}
-
-int kinc_g4_vertex_buffer_count(kinc_g4_vertex_buffer_t *buffer) {
-	return buffer->impl.myCount;
-}
-
-int kinc_g4_vertex_buffer_stride(kinc_g4_vertex_buffer_t *buffer) {
-	return kinc_g5_vertex_buffer_stride(&buffer->impl._buffer[buffer->impl._currentIndex]);
-}
-
-void kinc_g5_constant_buffer_set_int(kinc_g5_constant_buffer_t *buffer, int offset, int value) {
-	int *ints = (int *)(&buffer->data[offset]);
-	ints[0] = value;
-}
-
-void kinc_g5_constant_buffer_set_int2(kinc_g5_constant_buffer_t *buffer, int offset, int value1, int value2) {
-	int *ints = (int *)(&buffer->data[offset]);
-	ints[0] = value1;
-	ints[1] = value2;
-}
-
-void kinc_g5_constant_buffer_set_int3(kinc_g5_constant_buffer_t *buffer, int offset, int value1, int value2, int value3) {
-	int *ints = (int *)(&buffer->data[offset]);
-	ints[0] = value1;
-	ints[1] = value2;
-	ints[2] = value3;
-}
-
-void kinc_g5_constant_buffer_set_int4(kinc_g5_constant_buffer_t *buffer, int offset, int value1, int value2, int value3, int value4) {
-	int *ints = (int *)(&buffer->data[offset]);
-	ints[0] = value1;
-	ints[1] = value2;
-	ints[2] = value3;
-	ints[3] = value4;
-}
-
-void kinc_g5_constant_buffer_set_ints(kinc_g5_constant_buffer_t *buffer, int offset, int *values, int count) {
-	int *ints = (int *)(&buffer->data[offset]);
-	for (int i = 0; i < count; ++i) {
-		ints[i] = values[i];
-	}
-}
-
-void kinc_g5_constant_buffer_set_float(kinc_g5_constant_buffer_t *buffer, int offset, float value) {
-	float *floats = (float *)(&buffer->data[offset]);
-	floats[0] = value;
-}
-
-void kinc_g5_constant_buffer_set_float2(kinc_g5_constant_buffer_t *buffer, int offset, float value1, float value2) {
-	float *floats = (float *)(&buffer->data[offset]);
-	floats[0] = value1;
-	floats[1] = value2;
-}
-
-void kinc_g5_constant_buffer_set_float3(kinc_g5_constant_buffer_t *buffer, int offset, float value1, float value2, float value3) {
-	float *floats = (float *)(&buffer->data[offset]);
-	floats[0] = value1;
-	floats[1] = value2;
-	floats[2] = value3;
-}
-
-void kinc_g5_constant_buffer_set_float4(kinc_g5_constant_buffer_t *buffer, int offset, float value1, float value2, float value3, float value4) {
-	float *floats = (float *)(&buffer->data[offset]);
-	floats[0] = value1;
-	floats[1] = value2;
-	floats[2] = value3;
-	floats[3] = value4;
-}
-
-void kinc_g5_constant_buffer_set_floats(kinc_g5_constant_buffer_t *buffer, int offset, float *values, int count) {
-	float *floats = (float *)(&buffer->data[offset]);
-	for (int i = 0; i < count; ++i) {
-		floats[i] = values[i];
-	}
-}
-
-void kinc_g5_constant_buffer_set_bool(kinc_g5_constant_buffer_t *buffer, int offset, bool value) {
-	int *ints = (int *)(&buffer->data[offset]);
-	ints[0] = value ? 1 : 0;
-}
-
-static void kinc_internal_set_matrix3(uint8_t *constants, int offset, kinc_matrix3x3_t *value) {
-	float *floats = (float *)(&constants[offset]);
-	for (int y = 0; y < 3; ++y) {
-		for (int x = 0; x < 3; ++x) {
-			floats[x + y * 4] = kinc_matrix3x3_get(value, x, y);
-		}
-	}
-}
-
-void kinc_g5_constant_buffer_set_matrix3(kinc_g5_constant_buffer_t *buffer, int offset, kinc_matrix3x3_t *value) {
-	if (kinc_g5_transpose_mat) {
-		kinc_matrix3x3_t m = *value;
-		kinc_matrix3x3_transpose(&m);
-		kinc_internal_set_matrix3(buffer->data, offset, &m);
-	}
-	else {
-		kinc_internal_set_matrix3(buffer->data, offset, value);
-	}
-}
-
-static void kinc_internal_set_matrix4(uint8_t *constants, int offset, kinc_matrix4x4_t *value) {
-	float *floats = (float *)(&constants[offset]);
-	for (int y = 0; y < 4; ++y) {
-		for (int x = 0; x < 4; ++x) {
-			floats[x + y * 4] = kinc_matrix4x4_get(value, x, y);
-		}
-	}
-}
-
-void kinc_g5_constant_buffer_set_matrix4(kinc_g5_constant_buffer_t *buffer, int offset, kinc_matrix4x4_t *value) {
-	if (kinc_g5_transpose_mat) {
-		kinc_matrix4x4_t m = *value;
-		kinc_matrix4x4_transpose(&m);
-		kinc_internal_set_matrix4(buffer->data, offset, &m);
-	}
-	else {
-		kinc_internal_set_matrix4(buffer->data, offset, value);
-	}
-}

+ 0 - 83
armorcore/sources/kinc/g5_buffer.h

@@ -1,83 +0,0 @@
-#pragma once
-
-#include <stdbool.h>
-#include <kinc/global.h>
-#include <kinc/matrix.h>
-#include <kinc/vector.h>
-#include <kinc/backend/g5_buffer.h>
-#include <kinc/g5.h>
-
-typedef struct kinc_g5_vertex_buffer {
-	VertexBuffer5Impl impl;
-} kinc_g5_vertex_buffer_t;
-
-typedef struct {
-	int myCount;
-	kinc_g5_vertex_buffer_t _buffer[2];
-	int _currentIndex;
-	int _multiple;
-} kinc_g4_vertex_buffer_impl_t;
-
-typedef struct kinc_g4_vertex_buffer {
-	kinc_g4_vertex_buffer_impl_t impl;
-} kinc_g4_vertex_buffer_t;
-
-void kinc_g5_vertex_buffer_init(kinc_g5_vertex_buffer_t *buffer, int count, kinc_g5_vertex_structure_t *structure, bool gpu_memory);
-void kinc_g5_vertex_buffer_destroy(kinc_g5_vertex_buffer_t *buffer);
-float *kinc_g5_vertex_buffer_lock_all(kinc_g5_vertex_buffer_t *buffer);
-float *kinc_g5_vertex_buffer_lock(kinc_g5_vertex_buffer_t *buffer, int start, int count);
-void kinc_g5_vertex_buffer_unlock_all(kinc_g5_vertex_buffer_t *buffer);
-void kinc_g5_vertex_buffer_unlock(kinc_g5_vertex_buffer_t *buffer, int count);
-int kinc_g5_vertex_buffer_count(kinc_g5_vertex_buffer_t *buffer);
-int kinc_g5_vertex_buffer_stride(kinc_g5_vertex_buffer_t *buffer);
-
-int kinc_g5_internal_vertex_buffer_set(kinc_g5_vertex_buffer_t *buffer);
-
-void kinc_g4_vertex_buffer_init(kinc_g4_vertex_buffer_t *buffer, int count, kinc_g5_vertex_structure_t *structure, kinc_g4_usage_t usage);
-void kinc_g4_vertex_buffer_destroy(kinc_g4_vertex_buffer_t *buffer);
-float *kinc_g4_vertex_buffer_lock_all(kinc_g4_vertex_buffer_t *buffer);
-float *kinc_g4_vertex_buffer_lock(kinc_g4_vertex_buffer_t *buffer, int start, int count);
-void kinc_g4_vertex_buffer_unlock_all(kinc_g4_vertex_buffer_t *buffer);
-void kinc_g4_vertex_buffer_unlock(kinc_g4_vertex_buffer_t *buffer, int count);
-int kinc_g4_vertex_buffer_count(kinc_g4_vertex_buffer_t *buffer);
-int kinc_g4_vertex_buffer_stride(kinc_g4_vertex_buffer_t *buffer);
-void kinc_g4_set_vertex_buffer(kinc_g4_vertex_buffer_t *buffer);
-
-typedef struct kinc_g5_constant_buffer {
-	uint8_t *data;
-	ConstantBuffer5Impl impl;
-} kinc_g5_constant_buffer_t;
-
-void kinc_g5_constant_buffer_init(kinc_g5_constant_buffer_t *buffer, int size);
-void kinc_g5_constant_buffer_destroy(kinc_g5_constant_buffer_t *buffer);
-void kinc_g5_constant_buffer_lock_all(kinc_g5_constant_buffer_t *buffer);
-void kinc_g5_constant_buffer_lock(kinc_g5_constant_buffer_t *buffer, int start, int count);
-void kinc_g5_constant_buffer_unlock(kinc_g5_constant_buffer_t *buffer);
-int kinc_g5_constant_buffer_size(kinc_g5_constant_buffer_t *buffer);
-void kinc_g5_constant_buffer_set_bool(kinc_g5_constant_buffer_t *buffer, int offset, bool value);
-void kinc_g5_constant_buffer_set_int(kinc_g5_constant_buffer_t *buffer, int offset, int value);
-void kinc_g5_constant_buffer_set_int2(kinc_g5_constant_buffer_t *buffer, int offset, int value1, int value2);
-void kinc_g5_constant_buffer_set_int3(kinc_g5_constant_buffer_t *buffer, int offset, int value1, int value2, int value3);
-void kinc_g5_constant_buffer_set_int4(kinc_g5_constant_buffer_t *buffer, int offset, int value1, int value2, int value3, int value4);
-void kinc_g5_constant_buffer_set_ints(kinc_g5_constant_buffer_t *buffer, int offset, int *values, int count);
-void kinc_g5_constant_buffer_set_float(kinc_g5_constant_buffer_t *buffer, int offset, float value);
-void kinc_g5_constant_buffer_set_float2(kinc_g5_constant_buffer_t *buffer, int offset, float value1, float value2);
-void kinc_g5_constant_buffer_set_float3(kinc_g5_constant_buffer_t *buffer, int offset, float value1, float value2, float value3);
-void kinc_g5_constant_buffer_set_float4(kinc_g5_constant_buffer_t *buffer, int offset, float value1, float value2, float value3, float value4);
-void kinc_g5_constant_buffer_set_floats(kinc_g5_constant_buffer_t *buffer, int offset, float *values, int count);
-void kinc_g5_constant_buffer_set_matrix3(kinc_g5_constant_buffer_t *buffer, int offset, kinc_matrix3x3_t *value);
-void kinc_g5_constant_buffer_set_matrix4(kinc_g5_constant_buffer_t *buffer, int offset, kinc_matrix4x4_t *value);
-
-extern bool kinc_g5_transpose_mat;
-
-typedef struct kinc_g5_index_buffer {
-	IndexBuffer5Impl impl;
-} kinc_g5_index_buffer_t;
-
-void kinc_g5_index_buffer_init(kinc_g5_index_buffer_t *buffer, int count, bool gpu_memory);
-void kinc_g5_index_buffer_destroy(kinc_g5_index_buffer_t *buffer);
-void *kinc_g5_index_buffer_lock_all(kinc_g5_index_buffer_t *buffer);
-void *kinc_g5_index_buffer_lock(kinc_g5_index_buffer_t *buffer, int start, int count);
-void kinc_g5_index_buffer_unlock_all(kinc_g5_index_buffer_t *buffer);
-void kinc_g5_index_buffer_unlock(kinc_g5_index_buffer_t *buffer, int count);
-int kinc_g5_index_buffer_count(kinc_g5_index_buffer_t *buffer);

+ 0 - 53
armorcore/sources/kinc/g5_commandlist.h

@@ -1,53 +0,0 @@
-#pragma once
-
-#include <stddef.h>
-#include <kinc/global.h>
-#include <kinc/g5_texture.h>
-#include <kinc/g5_pipeline.h>
-#include <kinc/backend/g5_commandlist.h>
-
-struct kinc_g5_compute_shader;
-struct kinc_g5_constant_buffer;
-struct kinc_g5_index_buffer;
-struct kinc_g5_vertex_buffer;
-struct kinc_g5_pipeline;
-struct kinc_g5_render_target;
-struct kinc_g5_texture;
-
-typedef struct kinc_g5_command_list {
-	CommandList5Impl impl;
-} kinc_g5_command_list_t;
-
-void kinc_g5_command_list_init(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_destroy(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_begin(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_end(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_clear(kinc_g5_command_list_t *list, struct kinc_g5_render_target *render_target, unsigned flags, unsigned color, float depth);
-void kinc_g5_command_list_render_target_to_framebuffer_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget);
-void kinc_g5_command_list_framebuffer_to_render_target_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget);
-void kinc_g5_command_list_texture_to_render_target_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget);
-void kinc_g5_command_list_render_target_to_texture_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget);
-void kinc_g5_command_list_draw_indexed_vertices(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_draw_indexed_vertices_from_to(kinc_g5_command_list_t *list, int start, int count);
-void kinc_g5_command_list_viewport(kinc_g5_command_list_t *list, int x, int y, int width, int height);
-void kinc_g5_command_list_scissor(kinc_g5_command_list_t *list, int x, int y, int width, int height);
-void kinc_g5_command_list_disable_scissor(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_set_pipeline(kinc_g5_command_list_t *list, struct kinc_g5_pipeline *pipeline);
-void kinc_g5_command_list_set_compute_shader(kinc_g5_command_list_t *list, struct kinc_g5_compute_shader *shader);
-void kinc_g5_command_list_set_vertex_buffer(kinc_g5_command_list_t *list, struct kinc_g5_vertex_buffer *buffer);
-void kinc_g5_command_list_set_index_buffer(kinc_g5_command_list_t *list, struct kinc_g5_index_buffer *buffer);
-void kinc_g5_command_list_set_render_targets(kinc_g5_command_list_t *list, struct kinc_g5_render_target **targets, int count);
-void kinc_g5_command_list_upload_index_buffer(kinc_g5_command_list_t *list, struct kinc_g5_index_buffer *buffer);
-void kinc_g5_command_list_upload_vertex_buffer(kinc_g5_command_list_t *list, struct kinc_g5_vertex_buffer *buffer);
-void kinc_g5_command_list_upload_texture(kinc_g5_command_list_t *list, struct kinc_g5_texture *texture);
-void kinc_g5_command_list_set_vertex_constant_buffer(kinc_g5_command_list_t *list, struct kinc_g5_constant_buffer *buffer, int offset, size_t size);
-void kinc_g5_command_list_set_fragment_constant_buffer(kinc_g5_command_list_t *list, struct kinc_g5_constant_buffer *buffer, int offset, size_t size);
-void kinc_g5_command_list_set_compute_constant_buffer(kinc_g5_command_list_t *list, struct kinc_g5_constant_buffer *buffer, int offset, size_t size);
-void kinc_g5_command_list_execute(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_wait_for_execution_to_finish(kinc_g5_command_list_t *list);
-void kinc_g5_command_list_get_render_target_pixels(kinc_g5_command_list_t *list, struct kinc_g5_render_target *render_target, uint8_t *data);
-void kinc_g5_command_list_compute(kinc_g5_command_list_t *list, int x, int y, int z);
-void kinc_g5_command_list_set_texture(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_texture_t *texture);
-void kinc_g5_command_list_set_texture_from_render_target(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_render_target_t *target);
-void kinc_g5_command_list_set_texture_from_render_target_depth(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_render_target_t *target);
-void kinc_g5_command_list_set_sampler(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_sampler_t *sampler);

+ 0 - 14
armorcore/sources/kinc/g5_compute.h

@@ -1,14 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <kinc/g5_pipeline.h>
-#include <kinc/backend/g5_compute.h>
-
-typedef struct kinc_g5_compute_shader {
-	kinc_g5_compute_shader_impl impl;
-} kinc_g5_compute_shader;
-
-void kinc_g5_compute_shader_init(kinc_g5_compute_shader *shader, void *source, int length);
-void kinc_g5_compute_shader_destroy(kinc_g5_compute_shader *shader);
-kinc_g5_constant_location_t kinc_g5_compute_shader_get_constant_location(kinc_g5_compute_shader *shader, const char *name);
-kinc_g5_texture_unit_t kinc_g5_compute_shader_get_texture_unit(kinc_g5_compute_shader *shader, const char *name);

+ 0 - 116
armorcore/sources/kinc/g5_pipeline.c.h

@@ -1,116 +0,0 @@
-#include "g5_pipeline.h"
-#include <stddef.h>
-#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define MAX_SAMPLERS_PER_STAGE 16
-
-static kinc_g5_sampler_options_t sampler_options[KINC_G5_SHADER_TYPE_COUNT][MAX_SAMPLERS_PER_STAGE];
-
-struct sampler_cache_entry {
-	kinc_g5_sampler_options_t options;
-	kinc_g5_sampler_t sampler;
-};
-
-#define MAX_SAMPLER_CACHE_SIZE 256
-static struct sampler_cache_entry sampler_cache[MAX_SAMPLER_CACHE_SIZE];
-static int sampler_cache_size = 0;
-
-void kinc_g5_internal_pipeline_init(kinc_g5_pipeline_t *pipe) {
-	pipe->input_layout = NULL;
-	pipe->vertex_shader = NULL;
-	pipe->fragment_shader = NULL;
-
-	pipe->cull_mode = KINC_G5_CULL_MODE_NEVER;
-	pipe->depth_write = false;
-	pipe->depth_mode = KINC_G5_COMPARE_MODE_ALWAYS;
-
-	pipe->blend_source = KINC_G5_BLEND_ONE;
-	pipe->blend_destination = KINC_G5_BLEND_ZERO;
-	pipe->blend_operation = KINC_G5_BLENDOP_ADD;
-	pipe->alpha_blend_source = KINC_G5_BLEND_ONE;
-	pipe->alpha_blend_destination = KINC_G5_BLEND_ZERO;
-	pipe->alpha_blend_operation = KINC_G5_BLENDOP_ADD;
-
-	for (int i = 0; i < 8; ++i) {
-		pipe->color_write_mask_red[i] = true;
-		pipe->color_write_mask_green[i] = true;
-		pipe->color_write_mask_blue[i] = true;
-		pipe->color_write_mask_alpha[i] = true;
-		pipe->color_attachment[i] = KINC_IMAGE_FORMAT_RGBA32;
-	}
-
-	pipe->color_attachment_count = 1;
-	pipe->depth_attachment_bits = 0;
-}
-
-void kinc_g5_internal_pipeline_set_defaults(kinc_g5_pipeline_t *state) {
-	state->input_layout = NULL;
-	state->vertex_shader = NULL;
-	state->fragment_shader = NULL;
-
-	state->cull_mode = KINC_G5_CULL_MODE_NEVER;
-	state->depth_write = false;
-	state->depth_mode = KINC_G5_COMPARE_MODE_ALWAYS;
-
-	state->blend_source = KINC_G5_BLEND_ONE;
-	state->blend_destination = KINC_G5_BLEND_ZERO;
-	state->blend_operation = KINC_G5_BLENDOP_ADD;
-	state->alpha_blend_source = KINC_G5_BLEND_ONE;
-	state->alpha_blend_destination = KINC_G5_BLEND_ZERO;
-	state->alpha_blend_operation = KINC_G5_BLENDOP_ADD;
-
-	for (int i = 0; i < 8; ++i) {
-		state->color_write_mask_red[i] = true;
-		state->color_write_mask_green[i] = true;
-		state->color_write_mask_blue[i] = true;
-		state->color_write_mask_alpha[i] = true;
-		state->color_attachment[i] = KINC_IMAGE_FORMAT_RGBA32;
-	}
-
-	state->color_attachment_count = 1;
-	state->depth_attachment_bits = 0;
-}
-
-void kinc_g5_sampler_options_set_defaults(kinc_g5_sampler_options_t *options) {
-	options->u_addressing = KINC_G5_TEXTURE_ADDRESSING_CLAMP;
-	options->v_addressing = KINC_G5_TEXTURE_ADDRESSING_CLAMP;
-
-	options->magnification_filter = KINC_G5_TEXTURE_FILTER_POINT;
-	options->minification_filter = KINC_G5_TEXTURE_FILTER_POINT;
-	options->mipmap_filter = KINC_G5_MIPMAP_FILTER_POINT;
-}
-
-void kinc_internal_samplers_reset(void) {
-	for (int i = 0; i < KINC_G5_SHADER_TYPE_COUNT; ++i) {
-		for (int j = 0; j < MAX_SAMPLERS_PER_STAGE; ++j) {
-			kinc_g5_sampler_options_set_defaults(&sampler_options[i][j]);
-		}
-	}
-}
-
-bool sampler_options_equals(kinc_g5_sampler_options_t *options1, kinc_g5_sampler_options_t *options2) {
-	return options1->u_addressing == options2->u_addressing &&
-		   options1->v_addressing == options2->v_addressing &&
-	       options1->minification_filter == options2->minification_filter &&
-	       options1->magnification_filter == options2->magnification_filter &&
-		   options1->mipmap_filter == options2->mipmap_filter;
-}
-
-kinc_g5_sampler_t *kinc_internal_get_current_sampler(int stage, int unit) {
-	// TODO: Please make this much faster
-	for (int i = 0; i < sampler_cache_size; ++i) {
-		if (sampler_options_equals(&sampler_cache[i].options, &sampler_options[stage][unit])) {
-			return &sampler_cache[i].sampler;
-		}
-	}
-
-	assert(sampler_cache_size < MAX_SAMPLER_CACHE_SIZE);
-	kinc_g5_sampler_t *sampler = &sampler_cache[sampler_cache_size].sampler;
-	kinc_g5_sampler_init(sampler, &sampler_options[stage][unit]);
-	sampler_cache[sampler_cache_size].options = sampler_options[stage][unit];
-	sampler_cache_size += 1;
-
-	return sampler;
-}

+ 0 - 143
armorcore/sources/kinc/g5_pipeline.h

@@ -1,143 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <kinc/g5.h>
-#include <kinc/g5_texture.h>
-#include <kinc/backend/g5_pipeline.h>
-
-typedef enum kinc_g5_shader_type {
-	KINC_G5_SHADER_TYPE_FRAGMENT,
-	KINC_G5_SHADER_TYPE_VERTEX,
-	KINC_G5_SHADER_TYPE_COMPUTE,
-	KINC_G5_SHADER_TYPE_COUNT
-} kinc_g5_shader_type_t;
-
-typedef enum {
-	KINC_G5_BLEND_ONE,
-	KINC_G5_BLEND_ZERO,
-	KINC_G5_BLEND_SOURCE_ALPHA,
-	KINC_G5_BLEND_DEST_ALPHA,
-	KINC_G5_BLEND_INV_SOURCE_ALPHA,
-	KINC_G5_BLEND_INV_DEST_ALPHA,
-	KINC_G5_BLEND_SOURCE_COLOR,
-	KINC_G5_BLEND_DEST_COLOR,
-	KINC_G5_BLEND_INV_SOURCE_COLOR,
-	KINC_G5_BLEND_INV_DEST_COLOR,
-	KINC_G5_BLEND_CONSTANT,
-	KINC_G5_BLEND_INV_CONSTANT
-} kinc_g5_blending_factor_t;
-
-typedef enum {
-	KINC_G5_BLENDOP_ADD,
-	KINC_G5_BLENDOP_SUBTRACT,
-	KINC_G5_BLENDOP_REVERSE_SUBTRACT,
-	KINC_G5_BLENDOP_MIN,
-	KINC_G5_BLENDOP_MAX
-} kinc_g5_blending_operation_t;
-
-typedef enum kinc_g5_cull_mode {
-	KINC_G5_CULL_MODE_CLOCKWISE,
-	KINC_G5_CULL_MODE_COUNTERCLOCKWISE,
-	KINC_G5_CULL_MODE_NEVER
-} kinc_g5_cull_mode_t;
-
-typedef enum kinc_g5_compare_mode {
-	KINC_G5_COMPARE_MODE_ALWAYS,
-	KINC_G5_COMPARE_MODE_NEVER,
-	KINC_G5_COMPARE_MODE_EQUAL,
-	KINC_G5_COMPARE_MODE_NOT_EQUAL,
-	KINC_G5_COMPARE_MODE_LESS,
-	KINC_G5_COMPARE_MODE_LESS_EQUAL,
-	KINC_G5_COMPARE_MODE_GREATER,
-	KINC_G5_COMPARE_MODE_GREATER_EQUAL
-} kinc_g5_compare_mode_t;
-
-typedef enum kinc_g5_texture_addressing {
-	KINC_G5_TEXTURE_ADDRESSING_REPEAT,
-	KINC_G5_TEXTURE_ADDRESSING_MIRROR,
-	KINC_G5_TEXTURE_ADDRESSING_CLAMP,
-	KINC_G5_TEXTURE_ADDRESSING_BORDER
-} kinc_g5_texture_addressing_t;
-
-typedef enum kinc_g5_texture_filter {
-	KINC_G5_TEXTURE_FILTER_POINT,
-	KINC_G5_TEXTURE_FILTER_LINEAR,
-	KINC_G5_TEXTURE_FILTER_ANISOTROPIC
-} kinc_g5_texture_filter_t;
-
-typedef enum kinc_g5_mipmap_filter {
-	KINC_G5_MIPMAP_FILTER_NONE,
-	KINC_G5_MIPMAP_FILTER_POINT,
-	KINC_G5_MIPMAP_FILTER_LINEAR // linear texture filter + linear mip filter -> trilinear filter
-} kinc_g5_mipmap_filter_t;
-
-typedef struct kinc_g5_constant_location {
-	ConstantLocation5Impl impl;
-} kinc_g5_constant_location_t;
-
-typedef struct kinc_g5_texture_unit {
-	int stages[KINC_G5_SHADER_TYPE_COUNT];
-} kinc_g5_texture_unit_t;
-
-typedef struct kinc_g5_shader {
-	Shader5Impl impl;
-} kinc_g5_shader_t;
-
-typedef struct kinc_g5_pipeline {
-	kinc_g5_vertex_structure_t *input_layout;
-	kinc_g5_shader_t *vertex_shader;
-	kinc_g5_shader_t *fragment_shader;
-
-	kinc_g5_cull_mode_t cull_mode;
-	bool depth_write;
-	kinc_g5_compare_mode_t depth_mode;
-
-	// One, Zero deactivates blending
-	kinc_g5_blending_factor_t blend_source;
-	kinc_g5_blending_factor_t blend_destination;
-	kinc_g5_blending_operation_t blend_operation;
-	kinc_g5_blending_factor_t alpha_blend_source;
-	kinc_g5_blending_factor_t alpha_blend_destination;
-	kinc_g5_blending_operation_t alpha_blend_operation;
-
-	bool color_write_mask_red[8]; // Per render target
-	bool color_write_mask_green[8];
-	bool color_write_mask_blue[8];
-	bool color_write_mask_alpha[8];
-
-	int color_attachment_count;
-	kinc_image_format_t color_attachment[8];
-	int depth_attachment_bits;
-
-	PipelineState5Impl impl;
-} kinc_g5_pipeline_t;
-
-typedef struct kinc_g5_sampler_options {
-	kinc_g5_texture_addressing_t u_addressing;
-	kinc_g5_texture_addressing_t v_addressing;
-
-	kinc_g5_texture_filter_t minification_filter;
-	kinc_g5_texture_filter_t magnification_filter;
-	kinc_g5_mipmap_filter_t mipmap_filter;
-
-} kinc_g5_sampler_options_t;
-
-typedef struct kinc_g5_sampler {
-	kinc_g5_sampler_impl_t impl;
-} kinc_g5_sampler_t;
-
-void kinc_g5_pipeline_init(kinc_g5_pipeline_t *pipeline);
-void kinc_g5_internal_pipeline_init(kinc_g5_pipeline_t *pipeline);
-void kinc_g5_pipeline_destroy(kinc_g5_pipeline_t *pipeline);
-void kinc_g5_pipeline_compile(kinc_g5_pipeline_t *pipeline);
-kinc_g5_constant_location_t kinc_g5_pipeline_get_constant_location(kinc_g5_pipeline_t *pipeline, const char *name);
-kinc_g5_texture_unit_t kinc_g5_pipeline_get_texture_unit(kinc_g5_pipeline_t *pipeline, const char *name);
-
-void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t length, kinc_g5_shader_type_t type);
-void kinc_g5_shader_destroy(kinc_g5_shader_t *shader);
-
-void kinc_g5_sampler_options_set_defaults(kinc_g5_sampler_options_t *options);
-void kinc_g5_sampler_init(kinc_g5_sampler_t *sampler, const kinc_g5_sampler_options_t *options);
-void kinc_g5_sampler_destroy(kinc_g5_sampler_t *sampler);
-
-void kinc_g5_internal_pipeline_set_defaults(kinc_g5_pipeline_t *pipeline);

+ 0 - 38
armorcore/sources/kinc/g5_raytrace.h

@@ -1,38 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <kinc/backend/g5_raytrace.h>
-
-struct kinc_g5_command_list;
-struct kinc_g5_constant_buffer;
-struct kinc_g5_index_buffer;
-struct kinc_g5_render_target;
-struct kinc_g5_texture;
-struct kinc_g5_vertex_buffer;
-
-typedef struct kinc_g5_raytrace_pipeline {
-	struct kinc_g5_constant_buffer *_constant_buffer;
-	kinc_g5_raytrace_pipeline_impl_t impl;
-} kinc_g5_raytrace_pipeline_t;
-
-typedef struct kinc_g5_raytrace_acceleration_structure {
-	kinc_g5_raytrace_acceleration_structure_impl_t impl;
-} kinc_g5_raytrace_acceleration_structure_t;
-
-bool kinc_g5_raytrace_supported(void);
-void kinc_g5_raytrace_pipeline_init(kinc_g5_raytrace_pipeline_t *pipeline, struct kinc_g5_command_list *command_list,
-    void *ray_shader, int ray_shader_size, struct kinc_g5_constant_buffer *constant_buffer);
-void kinc_g5_raytrace_pipeline_destroy(kinc_g5_raytrace_pipeline_t *pipeline);
-
-void kinc_g5_raytrace_acceleration_structure_init(kinc_g5_raytrace_acceleration_structure_t *accel);
-void kinc_g5_raytrace_acceleration_structure_add(kinc_g5_raytrace_acceleration_structure_t *accel, struct kinc_g5_vertex_buffer *vb, struct kinc_g5_index_buffer *ib, kinc_matrix4x4_t transform);
-void kinc_g5_raytrace_acceleration_structure_build(kinc_g5_raytrace_acceleration_structure_t *accel, struct kinc_g5_command_list *command_list,
-    struct kinc_g5_vertex_buffer *_vb_full, struct kinc_g5_index_buffer *_ib_full);
-void kinc_g5_raytrace_acceleration_structure_destroy(kinc_g5_raytrace_acceleration_structure_t *accel);
-
-void kinc_g5_raytrace_set_textures(struct kinc_g5_render_target *texpaint0, struct kinc_g5_render_target *texpaint1, struct kinc_g5_render_target *texpaint2,
-    struct kinc_g5_texture *texenv, struct kinc_g5_texture *texsobol, struct kinc_g5_texture *texscramble, struct kinc_g5_texture *texrank);
-void kinc_g5_raytrace_set_acceleration_structure(kinc_g5_raytrace_acceleration_structure_t *accel);
-void kinc_g5_raytrace_set_pipeline(kinc_g5_raytrace_pipeline_t *pipeline);
-void kinc_g5_raytrace_set_target(struct kinc_g5_render_target *output);
-void kinc_g5_raytrace_dispatch_rays(struct kinc_g5_command_list *command_list);

+ 0 - 64
armorcore/sources/kinc/g5_texture.h

@@ -1,64 +0,0 @@
-#pragma once
-
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <kinc/global.h>
-#include <kinc/backend/g5_texture.h>
-
-typedef enum kinc_image_compression {
-	KINC_IMAGE_COMPRESSION_NONE,
-	KINC_IMAGE_COMPRESSION_DXT5,
-	KINC_IMAGE_COMPRESSION_ASTC
-} kinc_image_compression_t;
-
-typedef enum kinc_image_format {
-	KINC_IMAGE_FORMAT_RGBA32,
-	KINC_IMAGE_FORMAT_RGBA64,
-	KINC_IMAGE_FORMAT_RGBA128,
-	KINC_IMAGE_FORMAT_R8,
-	KINC_IMAGE_FORMAT_R16,
-	KINC_IMAGE_FORMAT_R32,
-	KINC_IMAGE_FORMAT_BGRA32
-} kinc_image_format_t;
-
-typedef struct kinc_g5_texture {
-	int width;
-	int height;
-	kinc_image_format_t format;
-	kinc_image_compression_t compression;
-	void *data;
-	bool _uploaded;
-	Texture5Impl impl;
-} kinc_g5_texture_t;
-
-void kinc_g5_texture_init(kinc_g5_texture_t *texture, int width, int height, kinc_image_format_t format);
-void kinc_g5_texture_init_from_bytes(kinc_g5_texture_t *texture, void *data, int width, int height, kinc_image_format_t format);
-void kinc_g5_texture_init_non_sampled_access(kinc_g5_texture_t *texture, int width, int height, kinc_image_format_t format);
-void kinc_g5_texture_destroy(kinc_g5_texture_t *texture);
-uint8_t *kinc_g5_texture_lock(kinc_g5_texture_t *texture);
-void kinc_g5_texture_unlock(kinc_g5_texture_t *texture);
-void kinc_g5_texture_generate_mipmaps(kinc_g5_texture_t *texture, int levels);
-void kinc_g5_texture_set_mipmap(kinc_g5_texture_t *texture, kinc_g5_texture_t *mipmap, int level);
-int kinc_g5_texture_stride(kinc_g5_texture_t *texture);
-
-struct kinc_g5_texture_unit;
-
-enum kinc_internal_render_target_state {
-	KINC_INTERNAL_RENDER_TARGET_STATE_RENDER_TARGET,
-	KINC_INTERNAL_RENDER_TARGET_STATE_TEXTURE
-};
-
-typedef struct kinc_g5_render_target {
-	int width;
-	int height;
-	int framebuffer_index;
-	bool isDepthAttachment;
-	enum kinc_internal_render_target_state state;
-	RenderTarget5Impl impl;
-} kinc_g5_render_target_t;
-
-void kinc_g5_render_target_init(kinc_g5_render_target_t *target, int width, int height, kinc_image_format_t format, int depthBufferBits);
-void kinc_g5_render_target_init_framebuffer(kinc_g5_render_target_t *target, int width, int height, kinc_image_format_t format, int depthBufferBits);
-void kinc_g5_render_target_destroy(kinc_g5_render_target_t *target);
-void kinc_g5_render_target_set_depth_from(kinc_g5_render_target_t *target, kinc_g5_render_target_t *source);

+ 0 - 87
armorcore/sources/kinc/gamepad.h

@@ -1,87 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file gamepad.h
-    \brief Provides gamepad-support.
-*/
-
-#define KINC_GAMEPAD_MAX_COUNT 12
-
-void kinc_gamepad_set_connect_callback(void (*value)(int /*gamepad*/, void * /*userdata*/), void *userdata);
-void kinc_gamepad_set_disconnect_callback(void (*value)(int /*gamepad*/, void * /*userdata*/), void *userdata);
-void kinc_gamepad_set_axis_callback(void (*value)(int /*gamepad*/, int /*axis*/, float /*value*/, void * /*userdata*/), void *userdata);
-void kinc_gamepad_set_button_callback(void (*value)(int /*gamepad*/, int /*button*/, float /*value*/, void * /*userdata*/), void *userdata);
-const char *kinc_gamepad_vendor(int gamepad);
-const char *kinc_gamepad_product_name(int gamepad);
-bool kinc_gamepad_connected(int gamepad);
-void kinc_gamepad_rumble(int gamepad, float left, float right);
-
-void kinc_internal_gamepad_trigger_connect(int gamepad);
-void kinc_internal_gamepad_trigger_disconnect(int gamepad);
-void kinc_internal_gamepad_trigger_axis(int gamepad, int axis, float value);
-void kinc_internal_gamepad_trigger_button(int gamepad, int button, float value);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <memory.h>
-#include <stddef.h>
-
-static void (*gamepad_connect_callback)(int /*gamepad*/, void * /*userdata*/) = NULL;
-static void *gamepad_connect_callback_userdata = NULL;
-static void (*gamepad_disconnect_callback)(int /*gamepad*/, void * /*userdata*/) = NULL;
-static void *gamepad_disconnect_callback_userdata = NULL;
-static void (*gamepad_axis_callback)(int /*gamepad*/, int /*axis*/, float /*value*/, void * /*userdata*/) = NULL;
-static void *gamepad_axis_callback_userdata = NULL;
-static void (*gamepad_button_callback)(int /*gamepad*/, int /*button*/, float /*value*/, void * /*userdata*/) = NULL;
-static void *gamepad_button_callback_userdata = NULL;
-
-void kinc_gamepad_set_connect_callback(void (*value)(int /*gamepad*/, void * /*userdata*/), void *userdata) {
-	gamepad_connect_callback = value;
-	gamepad_connect_callback_userdata = userdata;
-}
-
-void kinc_gamepad_set_disconnect_callback(void (*value)(int /*gamepad*/, void * /*userdata*/), void *userdata) {
-	gamepad_disconnect_callback = value;
-	gamepad_disconnect_callback_userdata = userdata;
-}
-
-void kinc_gamepad_set_axis_callback(void (*value)(int /*gamepad*/, int /*axis*/, float /*value*/, void * /*userdata*/), void *userdata) {
-	gamepad_axis_callback = value;
-	gamepad_axis_callback_userdata = userdata;
-}
-
-void kinc_gamepad_set_button_callback(void (*value)(int /*gamepad*/, int /*button*/, float /*value*/, void * /*userdata*/), void *userdata) {
-	gamepad_button_callback = value;
-	gamepad_button_callback_userdata = userdata;
-}
-
-void kinc_internal_gamepad_trigger_connect(int gamepad) {
-	if (gamepad_connect_callback != NULL) {
-		gamepad_connect_callback(gamepad, gamepad_connect_callback_userdata);
-	}
-}
-
-void kinc_internal_gamepad_trigger_disconnect(int gamepad) {
-	if (gamepad_disconnect_callback != NULL) {
-		gamepad_disconnect_callback(gamepad, gamepad_disconnect_callback_userdata);
-	}
-}
-
-void kinc_internal_gamepad_trigger_axis(int gamepad, int axis, float value) {
-	if (gamepad_axis_callback != NULL) {
-		gamepad_axis_callback(gamepad, axis, value, gamepad_axis_callback_userdata);
-	}
-}
-
-void kinc_internal_gamepad_trigger_button(int gamepad, int button, float value) {
-	if (gamepad_button_callback != NULL) {
-		gamepad_button_callback(gamepad, button, value, gamepad_button_callback_userdata);
-	}
-}
-
-#endif

+ 0 - 38
armorcore/sources/kinc/http.h

@@ -1,38 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-#include <stdbool.h>
-
-/*! \file http.h
-    \brief Provides a simple http-API.
-*/
-
-#define KINC_HTTP_GET 0
-#define KINC_HTTP_POST 1
-#define KINC_HTTP_PUT 2
-#define KINC_HTTP_DELETE 3
-
-typedef void (*kinc_http_callback_t)(int error, int response, const char *body, void *callbackdata);
-
-void kinc_http_request(const char *url, const char *path, const char *data, int port, bool secure, int method, const char *header,
-                                 kinc_http_callback_t callback, void *callbackdata);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#if !defined KINC_MACOS && !defined KINC_IOS && !defined KINC_WINDOWS
-
-#include <assert.h>
-
-void kinc_http_request(const char *url, const char *path, const char *data, int port, bool secure, int method, const char *header,
-                       kinc_http_callback_t callback, void *callbackdata) {
-	assert(false); // not implemented for the current system, please send a pull-request
-}
-
-#endif
-
-#endif

+ 0 - 257
armorcore/sources/kinc/keyboard.h

@@ -1,257 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file keyboard.h
-    \brief Provides keyboard-support.
-*/
-
-#define KINC_KEY_UNKNOWN 0
-#define KINC_KEY_BACK 1 // Android
-#define KINC_KEY_CANCEL 3
-#define KINC_KEY_HELP 6
-#define KINC_KEY_BACKSPACE 8
-#define KINC_KEY_TAB 9
-#define KINC_KEY_CLEAR 12
-#define KINC_KEY_RETURN 13
-#define KINC_KEY_SHIFT 16
-#define KINC_KEY_CONTROL 17
-#define KINC_KEY_ALT 18
-#define KINC_KEY_PAUSE 19
-#define KINC_KEY_CAPS_LOCK 20
-#define KINC_KEY_KANA 21
-#define KINC_KEY_HANGUL 21
-#define KINC_KEY_EISU 22
-#define KINC_KEY_JUNJA 23
-#define KINC_KEY_FINAL 24
-#define KINC_KEY_HANJA 25
-#define KINC_KEY_KANJI 25
-#define KINC_KEY_ESCAPE 27
-#define KINC_KEY_CONVERT 28
-#define KINC_KEY_NON_CONVERT 29
-#define KINC_KEY_ACCEPT 30
-#define KINC_KEY_MODE_CHANGE 31
-#define KINC_KEY_SPACE 32
-#define KINC_KEY_PAGE_UP 33
-#define KINC_KEY_PAGE_DOWN 34
-#define KINC_KEY_END 35
-#define KINC_KEY_HOME 36
-#define KINC_KEY_LEFT 37
-#define KINC_KEY_UP 38
-#define KINC_KEY_RIGHT 39
-#define KINC_KEY_DOWN 40
-#define KINC_KEY_SELECT 41
-#define KINC_KEY_PRINT 42
-#define KINC_KEY_EXECUTE 43
-#define KINC_KEY_PRINT_SCREEN 44
-#define KINC_KEY_INSERT 45
-#define KINC_KEY_DELETE 46
-#define KINC_KEY_0 48
-#define KINC_KEY_1 49
-#define KINC_KEY_2 50
-#define KINC_KEY_3 51
-#define KINC_KEY_4 52
-#define KINC_KEY_5 53
-#define KINC_KEY_6 54
-#define KINC_KEY_7 55
-#define KINC_KEY_8 56
-#define KINC_KEY_9 57
-#define KINC_KEY_COLON 58
-#define KINC_KEY_SEMICOLON 59
-#define KINC_KEY_LESS_THAN 60
-#define KINC_KEY_EQUALS 61
-#define KINC_KEY_GREATER_THAN 62
-#define KINC_KEY_QUESTIONMARK 63
-#define KINC_KEY_AT 64
-#define KINC_KEY_A 65
-#define KINC_KEY_B 66
-#define KINC_KEY_C 67
-#define KINC_KEY_D 68
-#define KINC_KEY_E 69
-#define KINC_KEY_F 70
-#define KINC_KEY_G 71
-#define KINC_KEY_H 72
-#define KINC_KEY_I 73
-#define KINC_KEY_J 74
-#define KINC_KEY_K 75
-#define KINC_KEY_L 76
-#define KINC_KEY_M 77
-#define KINC_KEY_N 78
-#define KINC_KEY_O 79
-#define KINC_KEY_P 80
-#define KINC_KEY_Q 81
-#define KINC_KEY_R 82
-#define KINC_KEY_S 83
-#define KINC_KEY_T 84
-#define KINC_KEY_U 85
-#define KINC_KEY_V 86
-#define KINC_KEY_W 87
-#define KINC_KEY_X 88
-#define KINC_KEY_Y 89
-#define KINC_KEY_Z 90
-#define KINC_KEY_WIN 91
-#define KINC_KEY_CONTEXT_MENU 93
-#define KINC_KEY_SLEEP 95
-#define KINC_KEY_NUMPAD_0 96
-#define KINC_KEY_NUMPAD_1 97
-#define KINC_KEY_NUMPAD_2 98
-#define KINC_KEY_NUMPAD_3 99
-#define KINC_KEY_NUMPAD_4 100
-#define KINC_KEY_NUMPAD_5 101
-#define KINC_KEY_NUMPAD_6 102
-#define KINC_KEY_NUMPAD_7 103
-#define KINC_KEY_NUMPAD_8 104
-#define KINC_KEY_NUMPAD_9 105
-#define KINC_KEY_MULTIPLY 106
-#define KINC_KEY_ADD 107
-#define KINC_KEY_SEPARATOR 108
-#define KINC_KEY_SUBTRACT 109
-#define KINC_KEY_DECIMAL 110
-#define KINC_KEY_DIVIDE 111
-#define KINC_KEY_F1 112
-#define KINC_KEY_F2 113
-#define KINC_KEY_F3 114
-#define KINC_KEY_F4 115
-#define KINC_KEY_F5 116
-#define KINC_KEY_F6 117
-#define KINC_KEY_F7 118
-#define KINC_KEY_F8 119
-#define KINC_KEY_F9 120
-#define KINC_KEY_F10 121
-#define KINC_KEY_F11 122
-#define KINC_KEY_F12 123
-#define KINC_KEY_F13 124
-#define KINC_KEY_F14 125
-#define KINC_KEY_F15 126
-#define KINC_KEY_F16 127
-#define KINC_KEY_F17 128
-#define KINC_KEY_F18 129
-#define KINC_KEY_F19 130
-#define KINC_KEY_F20 131
-#define KINC_KEY_F21 132
-#define KINC_KEY_F22 133
-#define KINC_KEY_F23 134
-#define KINC_KEY_F24 135
-#define KINC_KEY_NUM_LOCK 144
-#define KINC_KEY_SCROLL_LOCK 145
-#define KINC_KEY_WIN_OEM_FJ_JISHO 146
-#define KINC_KEY_WIN_OEM_FJ_MASSHOU 147
-#define KINC_KEY_WIN_OEM_FJ_TOUROKU 148
-#define KINC_KEY_WIN_OEM_FJ_LOYA 149
-#define KINC_KEY_WIN_OEM_FJ_ROYA 150
-#define KINC_KEY_CIRCUMFLEX 160
-#define KINC_KEY_EXCLAMATION 161
-#define KINC_KEY_DOUBLE_QUOTE 162
-#define KINC_KEY_HASH 163
-#define KINC_KEY_DOLLAR 164
-#define KINC_KEY_PERCENT 165
-#define KINC_KEY_AMPERSAND 166
-#define KINC_KEY_UNDERSCORE 167
-#define KINC_KEY_OPEN_PAREN 168
-#define KINC_KEY_CLOSE_PAREN 169
-#define KINC_KEY_ASTERISK 170
-#define KINC_KEY_PLUS 171
-#define KINC_KEY_PIPE 172
-#define KINC_KEY_HYPHEN_MINUS 173
-#define KINC_KEY_OPEN_CURLY_BRACKET 174
-#define KINC_KEY_CLOSE_CURLY_BRACKET 175
-#define KINC_KEY_TILDE 176
-#define KINC_KEY_VOLUME_MUTE 181
-#define KINC_KEY_VOLUME_DOWN 182
-#define KINC_KEY_VOLUME_UP 183
-#define KINC_KEY_COMMA 188
-#define KINC_KEY_PERIOD 190
-#define KINC_KEY_SLASH 191
-#define KINC_KEY_BACK_QUOTE 192
-#define KINC_KEY_OPEN_BRACKET 219
-#define KINC_KEY_BACK_SLASH 220
-#define KINC_KEY_CLOSE_BRACKET 221
-#define KINC_KEY_QUOTE 222
-#define KINC_KEY_META 224
-#define KINC_KEY_ALT_GR 225
-#define KINC_KEY_WIN_ICO_HELP 227
-#define KINC_KEY_WIN_ICO_00 228
-#define KINC_KEY_WIN_ICO_CLEAR 230
-#define KINC_KEY_WIN_OEM_RESET 233
-#define KINC_KEY_WIN_OEM_JUMP 234
-#define KINC_KEY_WIN_OEM_PA1 235
-#define KINC_KEY_WIN_OEM_PA2 236
-#define KINC_KEY_WIN_OEM_PA3 237
-#define KINC_KEY_WIN_OEM_WSCTRL 238
-#define KINC_KEY_WIN_OEM_CUSEL 239
-#define KINC_KEY_WIN_OEM_ATTN 240
-#define KINC_KEY_WIN_OEM_FINISH 241
-#define KINC_KEY_WIN_OEM_COPY 242
-#define KINC_KEY_WIN_OEM_AUTO 243
-#define KINC_KEY_WIN_OEM_ENLW 244
-#define KINC_KEY_WIN_OEM_BACK_TAB 245
-#define KINC_KEY_ATTN 246
-#define KINC_KEY_CRSEL 247
-#define KINC_KEY_EXSEL 248
-#define KINC_KEY_EREOF 249
-#define KINC_KEY_PLAY 250
-#define KINC_KEY_ZOOM 251
-#define KINC_KEY_PA1 253
-#define KINC_KEY_WIN_OEM_CLEAR 254
-
-void kinc_keyboard_show(void);
-void kinc_keyboard_hide(void);
-bool kinc_keyboard_active(void);
-void kinc_keyboard_set_key_down_callback(void (*value)(int /*key_code*/, void * /*data*/), void *data);
-void kinc_keyboard_set_key_up_callback(void (*value)(int /*key_code*/, void * /*data*/), void *data);
-void kinc_keyboard_set_key_press_callback(void (*value)(unsigned /*character*/, void * /*data*/), void *data);
-
-void kinc_internal_keyboard_trigger_key_down(int key_code);
-void kinc_internal_keyboard_trigger_key_up(int key_code);
-void kinc_internal_keyboard_trigger_key_press(unsigned character);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <memory.h>
-#include <stddef.h>
-
-static void (*keyboard_key_down_callback)(int /*key_code*/, void * /*data*/) = NULL;
-static void *keyboard_key_down_callback_data = NULL;
-static void (*keyboard_key_up_callback)(int /*key_code*/, void * /*data*/) = NULL;
-static void *keyboard_key_up_callback_data = NULL;
-static void (*keyboard_key_press_callback)(unsigned /*character*/, void * /*data*/) = NULL;
-static void *keyboard_key_press_callback_data = NULL;
-
-void kinc_keyboard_set_key_down_callback(void (*value)(int /*key_code*/, void * /*data*/), void *data) {
-	keyboard_key_down_callback = value;
-	keyboard_key_down_callback_data = data;
-}
-
-void kinc_keyboard_set_key_up_callback(void (*value)(int /*key_code*/, void * /*data*/), void *data) {
-	keyboard_key_up_callback = value;
-	keyboard_key_up_callback_data = data;
-}
-
-void kinc_keyboard_set_key_press_callback(void (*value)(unsigned /*character*/, void * /*data*/), void *data) {
-	keyboard_key_press_callback = value;
-	keyboard_key_press_callback_data = data;
-}
-
-void kinc_internal_keyboard_trigger_key_down(int key_code) {
-	if (keyboard_key_down_callback != NULL) {
-		keyboard_key_down_callback(key_code, keyboard_key_down_callback_data);
-	}
-}
-
-void kinc_internal_keyboard_trigger_key_up(int key_code) {
-	if (keyboard_key_up_callback != NULL) {
-		keyboard_key_up_callback(key_code, keyboard_key_up_callback_data);
-	}
-}
-
-void kinc_internal_keyboard_trigger_key_press(unsigned character) {
-	if (keyboard_key_press_callback != NULL) {
-		keyboard_key_press_callback(character, keyboard_key_press_callback_data);
-	}
-}
-
-#endif

+ 0 - 177
armorcore/sources/kinc/mouse.h

@@ -1,177 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-#include <stdbool.h>
-
-/*! \file mouse.h
-    \brief Provides mouse-support.
-*/
-
-#define KINC_MOUSE_LEFT 0
-#define KINC_MOUSE_RIGHT 1
-#define KINC_MOUSE_MIDDLE 2
-// eg backward sidebutton
-#define KINC_MOUSE_EXTRA1 3
-// eg forward sidebutton
-#define KINC_MOUSE_EXTRA2 4
-
-void kinc_mouse_set_press_callback(void (*value)(int /*button*/, int /*x*/, int /*y*/, void * /*data*/), void *data);
-void kinc_mouse_set_release_callback(void (*value)(int /*button*/, int /*x*/, int /*y*/, void * /*data*/), void *data);
-void kinc_mouse_set_move_callback(void (*value)(int /*x*/, int /*y*/, int /*movement_x*/, int /*movement_y*/, void * /*data*/),
-                                            void *data);
-void kinc_mouse_set_scroll_callback(void (*value)(int /*delta*/, void * /*data*/), void *data);
-bool kinc_mouse_can_lock(void);
-bool kinc_mouse_is_locked(void);
-void kinc_mouse_lock();
-void kinc_mouse_unlock(void);
-void kinc_mouse_set_cursor(int cursor);
-void kinc_mouse_show(void);
-void kinc_mouse_hide(void);
-void kinc_mouse_set_position(int x, int y);
-void kinc_mouse_get_position(int *x, int *y);
-
-void kinc_internal_mouse_trigger_press(int button, int x, int y);
-void kinc_internal_mouse_trigger_release(int button, int x, int y);
-void kinc_internal_mouse_trigger_move(int x, int y);
-void kinc_internal_mouse_trigger_scroll(int delta);
-void kinc_internal_mouse_lock();
-void kinc_internal_mouse_unlock(void);
-void kinc_internal_mouse_window_activated();
-void kinc_internal_mouse_window_deactivated();
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#undef KINC_IMPLEMENTATION
-#include <kinc/window.h>
-#define KINC_IMPLEMENTATION
-
-#include <memory.h>
-#include <stddef.h>
-
-static void (*mouse_press_callback)(int /*button*/, int /*x*/, int /*y*/, void * /*data*/) = NULL;
-static void *mouse_press_callback_data = NULL;
-static void (*mouse_release_callback)(int /*button*/, int /*x*/, int /*y*/, void * /*data*/) = NULL;
-static void *mouse_release_callback_data = NULL;
-static void (*mouse_move_callback)(int /*x*/, int /*y*/, int /*movementX*/, int /*movementY*/, void * /*data*/) = NULL;
-static void *mouse_move_callback_data = NULL;
-static void (*mouse_scroll_callback)(int /*delta*/, void * /*data*/) = NULL;
-static void *mouse_scroll_callback_data = NULL;
-
-void kinc_mouse_set_press_callback(void (*value)(int /*button*/, int /*x*/, int /*y*/, void * /*data*/), void *data) {
-	mouse_press_callback = value;
-	mouse_press_callback_data = data;
-}
-
-void kinc_mouse_set_release_callback(void (*value)(int /*button*/, int /*x*/, int /*y*/, void * /*data*/), void *data) {
-	mouse_release_callback = value;
-	mouse_release_callback_data = data;
-}
-
-void kinc_mouse_set_move_callback(void (*value)(int /*x*/, int /*y*/, int /*movement_x*/, int /*movement_y*/, void * /*data*/), void *data) {
-	mouse_move_callback = value;
-	mouse_move_callback_data = data;
-}
-
-void kinc_mouse_set_scroll_callback(void (*value)(int /*delta*/, void * /*data*/), void *data) {
-	mouse_scroll_callback = value;
-	mouse_scroll_callback_data = data;
-}
-
-void kinc_internal_mouse_trigger_release(int button, int x, int y) {
-	if (mouse_release_callback != NULL) {
-		mouse_release_callback(button, x, y, mouse_release_callback_data);
-	}
-}
-
-void kinc_internal_mouse_trigger_scroll(int delta) {
-	if (mouse_scroll_callback != NULL) {
-		mouse_scroll_callback(delta, mouse_scroll_callback_data);
-	}
-}
-
-void kinc_internal_mouse_window_activated() {
-	if (kinc_mouse_is_locked()) {
-		kinc_internal_mouse_lock();
-	}
-}
-void kinc_internal_mouse_window_deactivated() {
-	if (kinc_mouse_is_locked()) {
-		kinc_internal_mouse_unlock();
-	}
-}
-
-static bool moved = false;
-static bool locked = false;
-static int preLockWindow = 0;
-static int preLockX = 0;
-static int preLockY = 0;
-static int centerX = 0;
-static int centerY = 0;
-static int lastX = 0;
-static int lastY = 0;
-
-void kinc_internal_mouse_trigger_press(int button, int x, int y) {
-	lastX = x;
-	lastY = y;
-	if (mouse_press_callback != NULL) {
-		mouse_press_callback(button, x, y, mouse_press_callback_data);
-	}
-}
-
-void kinc_internal_mouse_trigger_move(int x, int y) {
-	int movementX = 0;
-	int movementY = 0;
-	if (kinc_mouse_is_locked()) {
-		movementX = x - centerX;
-		movementY = y - centerY;
-		if (movementX != 0 || movementY != 0) {
-			kinc_mouse_set_position(centerX, centerY);
-			x = centerX;
-			y = centerY;
-		}
-	}
-	else if (moved) {
-		movementX = x - lastX;
-		movementY = y - lastY;
-	}
-	moved = true;
-
-	lastX = x;
-	lastY = y;
-	if (mouse_move_callback != NULL && (movementX != 0 || movementY != 0)) {
-		mouse_move_callback(x, y, movementX, movementY, mouse_move_callback_data);
-	}
-}
-
-bool kinc_mouse_is_locked(void) {
-	return locked;
-}
-
-void kinc_mouse_lock() {
-	if (!kinc_mouse_can_lock()) {
-		return;
-	}
-	locked = true;
-	kinc_internal_mouse_lock();
-	kinc_mouse_get_position(&preLockX, &preLockY);
-	centerX = kinc_window_width() / 2;
-	centerY = kinc_window_height() / 2;
-	kinc_mouse_set_position(centerX, centerY);
-}
-
-void kinc_mouse_unlock(void) {
-	if (!kinc_mouse_can_lock()) {
-		return;
-	}
-	moved = false;
-	locked = false;
-	kinc_internal_mouse_unlock();
-	kinc_mouse_set_position(preLockX, preLockY);
-}
-
-#endif

+ 0 - 101
armorcore/sources/kinc/pen.h

@@ -1,101 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file pen.h
-    \brief Provides pen-support.
-*/
-
-void kinc_pen_set_press_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/));
-void kinc_pen_set_move_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/));
-void kinc_pen_set_release_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/));
-void kinc_eraser_set_press_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/));
-void kinc_eraser_set_move_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/));
-void kinc_eraser_set_release_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/));
-
-void kinc_internal_pen_trigger_move(int x, int y, float pressure);
-void kinc_internal_pen_trigger_press(int x, int y, float pressure);
-void kinc_internal_pen_trigger_release(int x, int y, float pressure);
-
-void kinc_internal_eraser_trigger_move(int x, int y, float pressure);
-void kinc_internal_eraser_trigger_press(int x, int y, float pressure);
-void kinc_internal_eraser_trigger_release(int x, int y, float pressure);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <memory.h>
-#include <stddef.h>
-
-static void (*pen_press_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL;
-static void (*pen_move_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL;
-static void (*pen_release_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL;
-
-static void (*eraser_press_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL;
-static void (*eraser_move_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL;
-static void (*eraser_release_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL;
-
-void kinc_pen_set_press_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)) {
-	pen_press_callback = value;
-}
-
-void kinc_pen_set_move_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)) {
-	pen_move_callback = value;
-}
-
-void kinc_pen_set_release_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)) {
-	pen_release_callback = value;
-}
-
-void kinc_eraser_set_press_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)) {
-	eraser_press_callback = value;
-}
-
-void kinc_eraser_set_move_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)) {
-	eraser_move_callback = value;
-}
-
-void kinc_eraser_set_release_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)) {
-	eraser_release_callback = value;
-}
-
-void kinc_internal_pen_trigger_press(int x, int y, float pressure) {
-	if (pen_press_callback != NULL) {
-		pen_press_callback(x, y, pressure);
-	}
-}
-
-void kinc_internal_pen_trigger_move(int x, int y, float pressure) {
-	if (pen_move_callback != NULL) {
-		pen_move_callback(x, y, pressure);
-	}
-}
-
-void kinc_internal_pen_trigger_release(int x, int y, float pressure) {
-	if (pen_release_callback != NULL) {
-		pen_release_callback(x, y, pressure);
-	}
-}
-
-void kinc_internal_eraser_trigger_press(int x, int y, float pressure) {
-	if (eraser_press_callback != NULL) {
-		eraser_press_callback(x, y, pressure);
-	}
-}
-
-void kinc_internal_eraser_trigger_move(int x, int y, float pressure) {
-	if (eraser_move_callback != NULL) {
-		eraser_move_callback(x, y, pressure);
-	}
-}
-
-void kinc_internal_eraser_trigger_release(int x, int y, float pressure) {
-	if (eraser_release_callback != NULL) {
-		eraser_release_callback(x, y, pressure);
-	}
-}
-
-#endif

+ 0 - 14
armorcore/sources/kinc/quaternion.h

@@ -1,14 +0,0 @@
-#pragma once
-
-#include "core.h"
-
-/*! \file quaternion.h
-    \brief Provides a basic quaternion type.
-*/
-
-typedef struct kinc_quaternion {
-	float x;
-	float y;
-	float z;
-	float w;
-} kinc_quaternion_t;

+ 0 - 71
armorcore/sources/kinc/random.h

@@ -1,71 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file random.h
-    \brief Generates values which are kind of random.
-*/
-
-void kinc_random_init(int64_t seed);
-int64_t kinc_random_get(void);
-int64_t kinc_random_get_max(int64_t max);
-int64_t kinc_random_get_in(int64_t min, int64_t max);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <limits.h>
-#include <stdlib.h>
-
-// xoshiro256** 1.0
-
-static inline uint64_t rotl(const uint64_t x, int k) {
-	return (x << k) | (x >> (64 - k));
-}
-
-static uint64_t s[4] = {1, 2, 3, 4};
-
-uint64_t next(void) {
-	const uint64_t result = rotl(s[1] * 5, 7) * 9;
-
-	const uint64_t t = s[1] << 17;
-
-	s[2] ^= s[0];
-	s[3] ^= s[1];
-	s[1] ^= s[2];
-	s[0] ^= s[3];
-
-	s[2] ^= t;
-
-	s[3] = rotl(s[3], 45);
-
-	return result;
-}
-
-void kinc_random_init(int64_t seed) {
-	s[0] = (uint64_t)seed;
-	s[1] = 2;
-	s[2] = 3;
-	s[3] = 4;
-	s[1] = next();
-	s[2] = next();
-	s[3] = next();
-}
-
-int64_t kinc_random_get(void) {
-	return (int64_t)next();
-}
-
-int64_t kinc_random_get_max(int64_t max) {
-	return kinc_random_get() % (max + 1);
-}
-
-int64_t kinc_random_get_in(int64_t min, int64_t max) {
-	int64_t value = kinc_random_get();
-	return (value < -LLONG_MAX ? LLONG_MAX : llabs(value)) % (max + 1 - min) + min;
-}
-
-#endif

+ 0 - 24
armorcore/sources/kinc/rootunit.c

@@ -1,24 +0,0 @@
-#define KINC_IMPLEMENTATION_ROOT
-
-#include "color.h"
-#include "error.h"
-#include "log.h"
-#include "memory.h"
-#include "string.h"
-#include "system.h"
-#include "window.h"
-#include "http.h"
-// #include "socket.h"
-#include "filereader.h"
-#include "filewriter.h"
-#include "gamepad.h"
-#include "keyboard.h"
-#include "mouse.h"
-#include "pen.h"
-#include "surface.h"
-#include "core.h"
-#include "matrix.h"
-#include "random.h"
-#include "g5_pipeline.c.h"
-#include "g5_buffer.c.h"
-#include "g5.c.h"

+ 0 - 586
armorcore/sources/kinc/socket.h

@@ -1,586 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file socket.h
-    \brief Provides low-level network-communication via UDP or TCP-sockets.
-*/
-
-typedef enum kinc_socket_protocol {
-	KINC_SOCKET_PROTOCOL_UDP,
-	KINC_SOCKET_PROTOCOL_TCP
-} kinc_socket_protocol_t;
-
-typedef enum kinc_socket_family {
-	KINC_SOCKET_FAMILY_IP4,
-	KINC_SOCKET_FAMILY_IP6
-} kinc_socket_family_t;
-
-#ifdef KINC_WINDOWS
-typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
-typedef UINT_PTR SOCKET;
-#endif
-
-typedef struct kinc_socket {
-#ifdef KINC_WINDOWS
-	SOCKET handle;
-#else
-	int handle;
-#endif
-	uint32_t host;
-	uint32_t port;
-	kinc_socket_protocol_t protocol;
-	kinc_socket_family_t family;
-	bool connected;
-} kinc_socket_t;
-
-typedef struct kinc_socket_options {
-	bool non_blocking;
-	bool broadcast;
-	bool tcp_no_delay;
-} kinc_socket_options_t;
-
-void kinc_socket_options_set_defaults(kinc_socket_options_t *options);
-void kinc_socket_init(kinc_socket_t *socket);
-bool kinc_socket_set(kinc_socket_t *socket, const char *host, int port, kinc_socket_family_t family, kinc_socket_protocol_t protocol);
-void kinc_socket_destroy(kinc_socket_t *socket);
-bool kinc_socket_open(kinc_socket_t *socket, kinc_socket_options_t *options);
-bool kinc_socket_select(kinc_socket_t *socket, uint32_t waittime, bool read, bool write);
-
-/*Typically these are server actions.*/
-bool kinc_socket_bind(kinc_socket_t *socket);
-bool kinc_socket_listen(kinc_socket_t *socket, int backlog);
-bool kinc_socket_accept(kinc_socket_t *socket, kinc_socket_t *new_socket, unsigned *remote_address, unsigned *remote_port);
-
-/*Typically this is a client action.*/
-bool kinc_socket_connect(kinc_socket_t *socket);
-
-int kinc_socket_send(kinc_socket_t *socket, const uint8_t *data, int size);
-int kinc_socket_send_address(kinc_socket_t *socket, unsigned address, int port, const uint8_t *data, int size);
-int kinc_socket_send_url(kinc_socket_t *socket, const char *url, int port, const uint8_t *data, int size);
-int kinc_socket_receive(kinc_socket_t *socket, uint8_t *data, int maxSize, unsigned *from_address, unsigned *from_port);
-
-unsigned kinc_url_to_int(const char *url, int port);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#undef KINC_IMPLEMENTATION
-#include <stb_sprintf.h>
-#include <kinc/log.h>
-#define KINC_IMPLEMENTATION
-
-#include <errno.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(KINC_WINDOWS)
-
-// Windows 7
-#define WINVER 0x0601
-#define _WIN32_WINNT 0x0601
-
-#define NOATOM
-#define NOCLIPBOARD
-#define NOCOLOR
-#define NOCOMM
-#define NOCTLMGR
-#define NODEFERWINDOWPOS
-#define NODRAWTEXT
-#define NOGDI
-#define NOGDICAPMASKS
-#define NOHELP
-#define NOICONS
-#define NOKANJI
-#define NOKEYSTATES
-#define NOMB
-#define NOMCX
-#define NOMEMMGR
-#define NOMENUS
-#define NOMETAFILE
-#define NOMINMAX
-#define NOMSG
-#define NONLS
-#define NOOPENFILE
-#define NOPROFILER
-#define NORASTEROPS
-#define NOSCROLL
-#define NOSERVICE
-#define NOSHOWWINDOW
-#define NOSOUND
-#define NOSYSCOMMANDS
-#define NOSYSMETRICS
-#define NOTEXTMETRIC
-#define NOUSER
-#define NOVIRTUALKEYCODES
-#define NOWH
-#define NOWINMESSAGES
-#define NOWINOFFSETS
-#define NOWINSTYLES
-#define WIN32_LEAN_AND_MEAN
-
-#include <Ws2tcpip.h>
-#include <winsock2.h>
-#elif defined(KINC_POSIX)
-#include <arpa/inet.h> // for inet_addr()
-#include <ctype.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#endif
-
-#if defined(KINC_POSIX)
-#include <sys/select.h>
-#endif
-
-static int counter = 0;
-
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-// Important: Must be cleaned with freeaddrinfo(address) later if the result is 0 in order to prevent memory leaks
-static int resolveAddress(const char *url, int port, struct addrinfo **result) {
-	struct addrinfo hints = {0};
-	hints.ai_family = AF_INET;
-	hints.ai_socktype = SOCK_DGRAM;
-	hints.ai_protocol = IPPROTO_UDP;
-
-	char serv[6];
-	sprintf(serv, "%u", port);
-
-	return getaddrinfo(url, serv, &hints, result);
-}
-#endif
-
-bool kinc_socket_bind(kinc_socket_t *sock) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	struct sockaddr_in address;
-	address.sin_family = sock->family == KINC_SOCKET_FAMILY_IP4 ? AF_INET : AF_INET6;
-	address.sin_addr.s_addr = sock->host;
-	address.sin_port = sock->port;
-	if (bind(sock->handle, (const struct sockaddr *)&address, sizeof(struct sockaddr_in)) < 0) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Could not bind socket: %s", strerror(errno));
-		return false;
-	}
-	return true;
-#else
-	return false;
-#endif
-}
-
-void kinc_socket_options_set_defaults(kinc_socket_options_t *options) {
-	options->non_blocking = true;
-	options->broadcast = false;
-	options->tcp_no_delay = false;
-}
-
-void kinc_socket_init(kinc_socket_t *sock) {
-	sock->handle = 0;
-
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	sock->host = INADDR_ANY;
-	sock->port = htons((unsigned short)8080);
-	sock->protocol = KINC_SOCKET_PROTOCOL_TCP;
-	sock->family = KINC_SOCKET_FAMILY_IP4;
-#endif
-	sock->connected = false;
-
-#if defined(KINC_WINDOWS)
-	if (counter == 0) {
-		WSADATA WsaData;
-		WSAStartup(MAKEWORD(2, 2), &WsaData);
-	}
-#endif
-	++counter;
-}
-
-bool kinc_socket_open(kinc_socket_t *sock, struct kinc_socket_options *options) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	switch (sock->protocol) {
-	case KINC_SOCKET_PROTOCOL_UDP:
-		sock->handle = socket(sock->family == KINC_SOCKET_FAMILY_IP4 ? AF_INET : AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
-		break;
-	case KINC_SOCKET_PROTOCOL_TCP:
-		sock->handle = socket(sock->family == KINC_SOCKET_FAMILY_IP4 ? AF_INET : AF_INET6, SOCK_STREAM, IPPROTO_TCP);
-		break;
-	default:
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Unsupported socket protocol.");
-		return false;
-	}
-
-	if (sock->handle <= 0) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Could not create socket.");
-#if defined(KINC_WINDOWS)
-		int errorCode = WSAGetLastError();
-		switch (errorCode) {
-		case (WSANOTINITIALISED):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "A successful WSAStartup call must occur before using this function.");
-			break;
-		case (WSAENETDOWN):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "The network subsystem or the associated service provider has failed.");
-			break;
-		case (WSAEAFNOSUPPORT):
-			kinc_log(KINC_LOG_LEVEL_ERROR,
-			         "The specified address family is not supported.For example, an application tried to create a socket for the AF_IRDA address "
-			         "family but an infrared adapter and device driver is not installed on the local computer.");
-			break;
-		case (WSAEINPROGRESS):
-			kinc_log(KINC_LOG_LEVEL_ERROR,
-			         "A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.");
-			break;
-		case (WSAEMFILE):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "No more socket descriptors are available.");
-			break;
-		case (WSAEINVAL):
-			kinc_log(KINC_LOG_LEVEL_ERROR,
-			         "An invalid argument was supplied.This error is returned if the af parameter is set to AF_UNSPEC and the type and protocol "
-			         "parameter are unspecified.");
-			break;
-		case (WSAENOBUFS):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "No buffer space is available.The socket cannot be created.");
-			break;
-		case (WSAEPROTONOSUPPORT):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "The specified protocol is not supported.");
-			break;
-		case (WSAEPROTOTYPE):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "The specified protocol is the wrong type for this socket.");
-			break;
-		case (WSAEPROVIDERFAILEDINIT):
-			kinc_log(KINC_LOG_LEVEL_ERROR,
-			         "The service provider failed to initialize.This error is returned if a layered service provider(LSP) or namespace provider was "
-			         "improperly installed or the provider fails to operate correctly.");
-			break;
-		case (WSAESOCKTNOSUPPORT):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "The specified socket type is not supported in this address family.");
-			break;
-		case (WSAEINVALIDPROVIDER):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "The service provider returned a version other than 2.2.");
-			break;
-		case (WSAEINVALIDPROCTABLE):
-			kinc_log(KINC_LOG_LEVEL_ERROR, "The service provider returned an invalid or incomplete procedure table to the WSPStartup.");
-			break;
-		default:
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Unknown error.");
-		}
-#elif defined(KINC_POSIX)
-		kinc_log(KINC_LOG_LEVEL_ERROR, "%s", strerror(errno));
-#endif
-		return false;
-	}
-#endif
-
-	if (options) {
-		if (options->non_blocking) {
-#if defined(KINC_WINDOWS)
-			DWORD value = 1;
-			if (ioctlsocket(sock->handle, FIONBIO, &value) != 0) {
-				kinc_log(KINC_LOG_LEVEL_ERROR, "Could not set non-blocking mode.");
-				return false;
-			}
-#elif defined(KINC_POSIX)
-			int value = 1;
-			if (fcntl(sock->handle, F_SETFL, O_NONBLOCK, value) == -1) {
-				kinc_log(KINC_LOG_LEVEL_ERROR, "Could not set non-blocking mode.");
-				return false;
-			}
-#endif
-		}
-
-		if (options->broadcast) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-			int value = 1;
-			if (setsockopt(sock->handle, SOL_SOCKET, SO_BROADCAST, (const char *)&value, sizeof(value)) < 0) {
-				kinc_log(KINC_LOG_LEVEL_ERROR, "Could not set broadcast mode.");
-				return false;
-			}
-#endif
-		}
-
-		if (options->tcp_no_delay) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-			int value = 1;
-			if (setsockopt(sock->handle, IPPROTO_TCP, TCP_NODELAY, (const char *)&value, sizeof(value)) != 0) {
-				kinc_log(KINC_LOG_LEVEL_ERROR, "Could not set no-delay mode.");
-				return false;
-			}
-#endif
-		}
-	}
-
-	return true;
-}
-
-void kinc_socket_destroy(kinc_socket_t *sock) {
-#if defined(KINC_WINDOWS)
-	closesocket(sock->handle);
-#elif defined(KINC_POSIX)
-	close(sock->handle);
-#endif
-
-	memset(sock, 0, sizeof(kinc_socket_t));
-
-	--counter;
-#if defined(KINC_WINDOWS)
-	if (counter == 0) {
-		WSACleanup();
-	}
-#endif
-}
-
-bool kinc_socket_select(kinc_socket_t *sock, uint32_t waittime, bool read, bool write) {
-#if (defined(KINC_WINDOWS) || defined(KINC_POSIX))
-	fd_set r_fds, w_fds;
-	struct timeval timeout;
-
-	FD_ZERO(&r_fds);
-	FD_ZERO(&w_fds);
-
-	FD_SET(sock->handle, &r_fds);
-	FD_SET(sock->handle, &w_fds);
-
-	timeout.tv_sec = waittime;
-	timeout.tv_usec = 0;
-
-	if (select(0, &r_fds, &w_fds, NULL, &timeout) < 0) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "kinc_socket_select didn't work: %s", strerror(errno));
-		return false;
-	}
-
-	if (read && write) {
-		return FD_ISSET(sock->handle, &w_fds) && FD_ISSET(sock->handle, &r_fds);
-	}
-	else if (read) {
-		return FD_ISSET(sock->handle, &r_fds);
-	}
-	else if (write) {
-		return FD_ISSET(sock->handle, &w_fds);
-	}
-	else {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Calling kinc_socket_select with both read and write set to false is useless.");
-		return false;
-	}
-#else
-	return false;
-#endif
-}
-
-bool kinc_socket_set(kinc_socket_t *sock, const char *host, int port, kinc_socket_family_t family, kinc_socket_protocol_t protocol) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-
-	sock->family = family;
-	sock->protocol = protocol;
-	sock->port = htons((unsigned short)port);
-
-	if (host == NULL)
-		return true;
-
-	if (isdigit(host[0]) || (family == KINC_SOCKET_FAMILY_IP6 && host[4] == ':')) { // Is IPv4 or IPv6 string
-		struct in_addr addr;
-
-		if (inet_pton(sock->family == KINC_SOCKET_FAMILY_IP4 ? AF_INET : AF_INET6, host, &addr) == 0) {
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Invalid %s address: %s\n", sock->family == KINC_SOCKET_FAMILY_IP4 ? "IPv4" : "IPv6", host);
-			return false;
-		}
-		sock->host = addr.s_addr;
-		return true;
-	}
-	else {
-		struct addrinfo *address = NULL;
-		int res = resolveAddress(host, port, &address);
-		if (res != 0) {
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Could not resolve address.");
-			return false;
-		}
-#if defined(KINC_POSIX)
-		sock->host = ((struct sockaddr_in *)address->ai_addr)->sin_addr.s_addr;
-#else
-		sock->host = ((struct sockaddr_in *)address->ai_addr)->sin_addr.S_un.S_addr;
-#endif
-		freeaddrinfo(address);
-
-		return true;
-	}
-#else
-	return false;
-#endif
-}
-
-bool kinc_socket_listen(kinc_socket_t *socket, int backlog) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	int res = listen(socket->handle, backlog);
-	return (res == 0);
-#else
-	return false;
-#endif
-}
-
-bool kinc_socket_accept(kinc_socket_t *sock, kinc_socket_t *newSocket, unsigned *remoteAddress, unsigned *remotePort) {
-#if defined(KINC_WINDOWS)
-	typedef int socklen_t;
-#endif
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	struct sockaddr_in addr;
-	socklen_t addrLength = sizeof(addr);
-	newSocket->handle = accept(sock->handle, (struct sockaddr *)&addr, &addrLength);
-	if (newSocket->handle <= 0) {
-		return false;
-	}
-
-	newSocket->connected = sock->connected = true;
-	newSocket->host = addr.sin_addr.s_addr;
-	newSocket->port = addr.sin_port;
-	newSocket->family = sock->family;
-	newSocket->protocol = sock->protocol;
-	*remoteAddress = ntohl(addr.sin_addr.s_addr);
-	*remotePort = ntohs(addr.sin_port);
-	return true;
-#else
-	return false;
-#endif
-}
-
-bool kinc_socket_connect(kinc_socket_t *sock) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	struct sockaddr_in addr;
-	addr.sin_family = sock->family == KINC_SOCKET_FAMILY_IP4 ? AF_INET : AF_INET6;
-	addr.sin_addr.s_addr = sock->host;
-	addr.sin_port = sock->port;
-
-	int res = connect(sock->handle, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
-	return sock->connected = (res == 0);
-#else
-	return false;
-#endif
-}
-
-int kinc_socket_send(kinc_socket_t *sock, const uint8_t *data, int size) {
-#if defined(KINC_WINDOWS)
-	typedef int socklen_t;
-#endif
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	if (sock->protocol == KINC_SOCKET_PROTOCOL_UDP) {
-		struct sockaddr_in addr;
-		addr.sin_family = sock->family == KINC_SOCKET_FAMILY_IP4 ? AF_INET : AF_INET6;
-		addr.sin_addr.s_addr = sock->host;
-		addr.sin_port = sock->port;
-
-		size_t sent = sendto(sock->handle, (const char *)data, size, 0, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
-		if (sent != size) {
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Could not send packet.");
-			return -1;
-		}
-		return (int)sent;
-	}
-	else {
-		if (!sock->connected) {
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Call kinc_sockect_connect/bind before send/recv can be called for TCP sockets.");
-			return -1;
-		}
-
-		size_t sent = send(sock->handle, (const char *)data, size, 0);
-		if (sent != size) {
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Could not send packet.");
-		}
-		return (int)sent;
-	}
-#else
-	return 0;
-#endif
-}
-
-int kinc_socket_send_address(kinc_socket_t *sock, unsigned address, int port, const uint8_t *data, int size) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	struct sockaddr_in addr;
-	addr.sin_family = AF_INET;
-	addr.sin_addr.s_addr = htonl(address);
-	addr.sin_port = htons(port);
-
-	size_t sent = sendto(sock->handle, (const char *)data, size, 0, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
-	if (sent != size) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Could not send packet.");
-	}
-	return (int)sent;
-#else
-	return 0;
-#endif
-}
-
-int kinc_socket_send_url(kinc_socket_t *sock, const char *url, int port, const uint8_t *data, int size) {
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-	struct addrinfo *address = NULL;
-	int res = resolveAddress(url, port, &address);
-	if (res != 0) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Could not resolve address.");
-		return 0;
-	}
-
-	size_t sent = sendto(sock->handle, (const char *)data, size, 0, address->ai_addr, sizeof(struct sockaddr_in));
-	if (sent != size) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Could not send packet.");
-	}
-	freeaddrinfo(address);
-	return (int)sent;
-#else
-	return 0;
-#endif
-}
-
-int kinc_socket_receive(kinc_socket_t *sock, uint8_t *data, int maxSize, unsigned *fromAddress, unsigned *fromPort) {
-#if defined(KINC_WINDOWS)
-	typedef int socklen_t;
-	typedef int ssize_t;
-#endif
-#if defined(KINC_WINDOWS) || defined(KINC_POSIX)
-
-	if (sock->protocol == KINC_SOCKET_PROTOCOL_UDP) {
-		struct sockaddr_in from;
-		socklen_t fromLength = sizeof(from);
-		ssize_t bytes = recvfrom(sock->handle, (char *)data, maxSize, 0, (struct sockaddr *)&from, &fromLength);
-		if (bytes <= 0) {
-			return (int)bytes;
-		}
-		*fromAddress = ntohl(from.sin_addr.s_addr);
-		*fromPort = ntohs(from.sin_port);
-		return (int)bytes;
-	}
-	else {
-
-		if (!sock->connected) {
-			kinc_log(KINC_LOG_LEVEL_ERROR, "Call kinc_sockect_connect/bind before send/recv can be called for TCP sockets.");
-			return -1;
-		}
-		ssize_t bytes = recv(sock->handle, (char *)data, maxSize, 0);
-		*fromAddress = ntohl(sock->host);
-		*fromPort = ntohs(sock->port);
-		return (int)bytes;
-	}
-#else
-	return 0;
-#endif
-}
-
-unsigned kinc_url_to_int(const char *url, int port) {
-#if defined(KINC_WINDOWS)
-	struct addrinfo *address = NULL;
-	int res = resolveAddress(url, port, &address);
-	if (res != 0) {
-		kinc_log(KINC_LOG_LEVEL_ERROR, "Could not resolve address.");
-		return -1;
-	}
-
-	unsigned fromAddress = ntohl(((struct sockaddr_in *)address->ai_addr)->sin_addr.S_un.S_addr);
-	freeaddrinfo(address);
-
-	return fromAddress;
-#else
-	return 0;
-#endif
-}
-
-#endif

+ 0 - 60
armorcore/sources/kinc/surface.h

@@ -1,60 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-
-/*! \file surface.h
-    \brief Provides touch-support.
-*/
-
-void kinc_surface_set_touch_start_callback(void (*value)(int /*index*/, int /*x*/, int /*y*/));
-void kinc_surface_set_move_callback(void (*value)(int /*index*/, int /*x*/, int /*y*/));
-void kinc_surface_set_touch_end_callback(void (*value)(int /*index*/, int /*x*/, int /*y*/));
-
-void kinc_internal_surface_trigger_touch_start(int index, int x, int y);
-void kinc_internal_surface_trigger_move(int index, int x, int y);
-void kinc_internal_surface_trigger_touch_end(int index, int x, int y);
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#include <memory.h>
-#include <stddef.h>
-
-static void (*surface_touch_start_callback)(int /*index*/, int /*x*/, int /*y*/) = NULL;
-static void (*surface_move_callback)(int /*index*/, int /*x*/, int /*y*/) = NULL;
-static void (*surface_touch_end_callback)(int /*index*/, int /*x*/, int /*y*/) = NULL;
-
-void kinc_surface_set_touch_start_callback(void (*value)(int /*index*/, int /*x*/, int /*y*/)) {
-	surface_touch_start_callback = value;
-}
-
-void kinc_surface_set_move_callback(void (*value)(int /*index*/, int /*x*/, int /*y*/)) {
-	surface_move_callback = value;
-}
-
-void kinc_surface_set_touch_end_callback(void (*value)(int /*index*/, int /*x*/, int /*y*/)) {
-	surface_touch_end_callback = value;
-}
-
-void kinc_internal_surface_trigger_touch_start(int index, int x, int y) {
-	if (surface_touch_start_callback != NULL) {
-		surface_touch_start_callback(index, x, y);
-	}
-}
-
-void kinc_internal_surface_trigger_move(int index, int x, int y) {
-	if (surface_move_callback != NULL) {
-		surface_move_callback(index, x, y);
-	}
-}
-
-void kinc_internal_surface_trigger_touch_end(int index, int x, int y) {
-	if (surface_touch_end_callback != NULL) {
-		surface_touch_end_callback(index, x, y);
-	}
-}
-
-#endif

+ 0 - 20
armorcore/sources/kinc/thread.h

@@ -1,20 +0,0 @@
-#pragma once
-
-#include <kinc/global.h>
-#include <kinc/backend/thread.h>
-
-/*! \file thread.h
-    \brief Supports the creation and destruction of threads.
-*/
-
-typedef struct kinc_thread {
-	kinc_thread_impl_t impl;
-} kinc_thread_t;
-
-void kinc_threads_init(void);
-void kinc_threads_quit(void);
-void kinc_thread_init(kinc_thread_t *thread, void (*func)(void *param), void *param);
-void kinc_thread_wait_and_destroy(kinc_thread_t *thread);
-bool kinc_thread_try_to_destroy(kinc_thread_t *thread);
-void kinc_thread_set_name(const char *name);
-void kinc_thread_sleep(int milliseconds);

+ 0 - 25
armorcore/sources/kinc/vector.h

@@ -1,25 +0,0 @@
-#pragma once
-
-#include "core.h"
-
-/*! \file vector.h
-    \brief Provides basic vector types.
-*/
-
-typedef struct kinc_vector2 {
-	float x;
-	float y;
-} kinc_vector2_t;
-
-typedef struct kinc_vector3 {
-	float x;
-	float y;
-	float z;
-} kinc_vector3_t;
-
-typedef struct kinc_vector4 {
-	float x;
-	float y;
-	float z;
-	float w;
-} kinc_vector4_t;

+ 0 - 99
armorcore/sources/kinc/window.h

@@ -1,99 +0,0 @@
-#pragma once
-
-#include <stdbool.h>
-#include <kinc/global.h>
-
-/*! \file window.h
-    \brief Provides functionality for creating and handling windows.
-*/
-
-typedef struct kinc_framebuffer_options {
-	int frequency;
-	bool vertical_sync;
-	int color_bits;
-	int depth_bits;
-} kinc_framebuffer_options_t;
-
-typedef enum {
-	KINC_WINDOW_MODE_WINDOW,
-	KINC_WINDOW_MODE_FULLSCREEN
-} kinc_window_mode_t;
-
-#define KINC_WINDOW_FEATURE_RESIZEABLE 1
-#define KINC_WINDOW_FEATURE_MINIMIZABLE 2
-#define KINC_WINDOW_FEATURE_MAXIMIZABLE 4
-#define KINC_WINDOW_FEATURE_BORDERLESS 8
-#define KINC_WINDOW_FEATURE_ON_TOP 16
-
-typedef struct kinc_window_options {
-	const char *title;
-	int x;
-	int y;
-	int width;
-	int height;
-	int display_index;
-	bool visible;
-	int window_features;
-	kinc_window_mode_t mode;
-} kinc_window_options_t;
-
-void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame);
-void kinc_window_destroy();
-void kinc_window_options_set_defaults(kinc_window_options_t *win);
-void kinc_framebuffer_options_set_defaults(kinc_framebuffer_options_t *frame);
-void kinc_window_resize(int width, int height);
-void kinc_window_move(int x, int y);
-void kinc_window_change_mode(kinc_window_mode_t mode);
-void kinc_window_change_features(int features);
-int kinc_window_x();
-int kinc_window_y();
-int kinc_window_width();
-int kinc_window_height();
-int kinc_window_display();
-kinc_window_mode_t kinc_window_get_mode();
-void kinc_window_show();
-void kinc_window_hide();
-void kinc_window_set_title(const char *title);
-void kinc_window_set_resize_callback(void (*callback)(int x, int y, void *data), void *data);
-void kinc_window_set_close_callback(bool (*callback)(void *data), void *data);
-
-void kinc_internal_call_resize_callback(int width, int height);
-bool kinc_internal_call_close_callback();
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#ifdef KINC_IMPLEMENTATION
-
-#ifdef KINC_IMPLEMENTATION_ROOT
-#undef KINC_IMPLEMENTATION
-#endif
-#include <kinc/display.h>
-#ifdef KINC_IMPLEMENTATION_ROOT
-#define KINC_IMPLEMENTATION
-#endif
-
-#include <stdlib.h>
-
-void kinc_window_options_set_defaults(kinc_window_options_t *win) {
-	kinc_display_init();
-	win->title = NULL;
-	win->display_index = kinc_primary_display();
-	win->mode = KINC_WINDOW_MODE_WINDOW;
-	win->x = -1;
-	win->y = -1;
-	win->width = 800;
-	win->height = 600;
-	win->visible = true;
-	win->window_features = KINC_WINDOW_FEATURE_RESIZEABLE | KINC_WINDOW_FEATURE_MINIMIZABLE | KINC_WINDOW_FEATURE_MAXIMIZABLE;
-}
-
-void kinc_framebuffer_options_set_defaults(kinc_framebuffer_options_t *frame) {
-	frame->frequency = 60;
-	frame->vertical_sync = true;
-	frame->color_bits = 32;
-	frame->depth_bits = 16;
-}
-
-#endif

+ 0 - 19
armorcore/sources/libs/miniClib/license.txt

@@ -1,19 +0,0 @@
-Copyright (c) 2024 the Kinc Development Team
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-
-  3. This notice may not be removed or altered from any source distribution.

+ 0 - 11
armorcore/tools/wasm/README.md

@@ -1,11 +0,0 @@
-
-**Wasm (Linux, macOS or WSL)**
-```bash
-../../make --target wasm --compile
-# Copy resulting armorcore.wasm file to build/out
-# Copy index.html to build/out
-# Copy https://github.com/armory3d/armorcore/tree/main/sources/backends/data/wasm/JS-Sources to build/out
-# Todo:
-# start.js has hard-coded .wasm file name: https://github.com/armory3d/armorcore/tree/main/sources/backends/data/wasm/JS-Sources/start.js#L48
-# memory.c has hard-coded size: https://github.com/armory3d/armorcore/tree/main/sources/libs/miniClib/memory.c#L6
-```

+ 3 - 3
armorforge/sources/tab_scene.ts

@@ -102,10 +102,10 @@ function tab_scene_draw_list(ui: ui_t, list_handle: ui_handle_t, current_object:
 		tab_scene_select_object(current_object.ext);
 
 		ui_menu_draw(function (ui: ui_t) {
-			if (ui_menu_button(ui, tr("Duplicate"))) {
+			if (ui_menu_button(tr("Duplicate"))) {
 				sim_duplicate();
 			}
-			if (ui_menu_button(ui, tr("Delete"))) {
+			if (ui_menu_button(tr("Delete"))) {
 				sim_delete();
 			}
 		});
@@ -149,7 +149,7 @@ function tab_scene_new_object(mesh_name: string) {
 function tab_scene_new_menu(ui: ui_t) {
 	for (let i: i32 = 0; i < tab_scene_new_meshes.length; ++i) {
 		let mesh_name: string = tab_scene_new_meshes[i];
-		if (ui_menu_button(ui, mesh_name)) {
+		if (ui_menu_button(mesh_name)) {
 			tab_scene_new_object(mesh_name);
 		}
 	}

+ 3 - 3
armorlab/readme.md

@@ -17,19 +17,19 @@ cd armortools/armorlab
 
 **Windows (x64)**
 ```bash
-..\armorcore\make --graphics direct3d12
+..\base\make --graphics direct3d12
 # Open generated Visual Studio project at `build\ArmorLab.sln`
 # Build and run
 ```
 
 **Linux (x64)** *wip - cpu only*
 ```bash
-../armorcore/make --graphics vulkan --run
+../base/make --graphics vulkan --run
 ```
 
 **macOS (arm64)**
 ```bash
-../armorcore/make --graphics metal
+../base/make --graphics metal
 # Open generated Xcode project at `build/ArmorLab.xcodeproj`
 # Build and run
 ```

+ 1 - 1
armorpaint/plugins/proc_xatlas/xatlas.cpp

@@ -10056,7 +10056,7 @@ void xatlasPackOptionsInit(xatlasPackOptions *packOptions)
 extern "C" {
 #endif
 
-#include <kinc/system.h>
+#include <iron_system.h>
 #include <iron_obj.h>
 
 void proc_xatlas_unwrap(raw_mesh_t *mesh) {

+ 5 - 5
armorpaint/readme.md

@@ -16,33 +16,33 @@ cd armortools/armorpaint
 
 **Windows (x64)**
 ```bash
-..\armorcore\make --graphics direct3d12
+..\base\make --graphics direct3d12
 # Open generated Visual Studio project at `build\ArmorPaint.sln`
 # Build and run
 ```
 
 **Linux (x64)**
 ```bash
-../armorcore/make --graphics vulkan --run
+../base/make --graphics vulkan --run
 ```
 
 **macOS (arm64)**
 ```bash
-../armorcore/make --graphics metal
+../base/make --graphics metal
 # Open generated Xcode project at `build/ArmorPaint.xcodeproj`
 # Build and run
 ```
 
 **Android (arm64)** *wip*
 ```bash
-../armorcore/make --graphics vulkan --target android
+../base/make --graphics vulkan --target android
 # Open generated Android Studio project at `build/ArmorPaint`
 # Build for device
 ```
 
 **iOS (arm64)** *wip*
 ```bash
-../armorcore/make --graphics metal --target ios
+../base/make --graphics metal --target ios
 # Open generated Xcode project `build/ArmorPaint.xcodeproj`
 # Build for device
 ```

+ 1 - 1
armorsculpt/sources/tab_layers.ts

@@ -75,7 +75,7 @@ function tab_layers_button_new(text: string) {
 	if (ui_button(text)) {
 		ui_menu_draw(function (ui: ui_t) {
 			let l: slot_layer_t = context_raw.layer;
-			if (ui_menu_button(ui, tr("Paint Layer"))) {
+			if (ui_menu_button(tr("Paint Layer"))) {
 				layers_new_layer();
 				history_new_layer();
 			}

+ 0 - 0
armorcore/make → base/make


+ 0 - 0
armorcore/make.bat → base/make.bat


+ 1 - 2
base/plugins/phys_jolt/phys_jolt.cpp

@@ -14,8 +14,7 @@
 #include <Jolt/Physics/Collision/Shape/HeightFieldShape.h>
 #include <Jolt/Physics/Body/BodyCreationSettings.h>
 #include <Jolt/Physics/Body/MotionQuality.h>
-#include <kinc/vector.h>
-#include <kinc/quaternion.h>
+#include <iron_math.h>
 #include "iron_array.h"
 
 JPH_SUPPRESS_WARNINGS

+ 339 - 5
base/project.js

@@ -23,7 +23,7 @@ let dir = flags.name.toLowerCase();
 	project.add_define("IDLE_SLEEP");
 
 	if (graphics === "vulkan") {
-		project.add_project("../armorcore/tools/to_spirv");
+		project.add_project("./sources/libs/to_spirv");
 	}
 
 	if (flags.with_onnx) {
@@ -55,11 +55,10 @@ let dir = flags.name.toLowerCase();
 	project.add_project("plugins");
 }
 
-project.add_project("../armorcore");
-project.add_tsfiles("sources");
-project.add_tsfiles("sources/nodes");
-project.add_shaders("../armorcore/shaders/*.glsl");
+project.add_tsfiles("sources/ts");
+project.add_tsfiles("sources/ts/nodes");
 project.add_shaders("shaders/*.glsl");
+project.add_shaders("shaders/draw/*.glsl");
 project.add_assets("assets/*", { destination: "data/{name}" });
 project.add_assets("assets/locale/*", { destination: "data/locale/{name}" });
 project.add_assets("assets/licenses/**", { destination: "data/licenses/{name}" });
@@ -132,5 +131,340 @@ if (export_data_list) {
 	project.add_assets(dir + "/data_list.json", { destination: "data/{name}" });
 }
 
+{
+	project.add_include_dir("sources");
+
+	function add_backend(name) {
+		project.add_cfiles("sources/backends/" + name + "/**");
+		project.add_include_dir("sources/backends/" + name);
+	}
+
+	if (platform === "windows") {
+		add_backend("windows");
+		project.add_lib("dxguid");
+		project.add_lib("dsound");
+		project.add_lib("dinput8");
+		project.add_define("_CRT_SECURE_NO_WARNINGS");
+		project.add_define("_WINSOCK_DEPRECATED_NO_WARNINGS");
+		project.add_lib("ws2_32");
+		project.add_lib("Winhttp");
+		project.add_lib("wbemuuid");
+
+		if (graphics === "direct3d12" || graphics === "default") {
+			add_backend("direct3d12");
+			project.add_define("KINC_DIRECT3D12");
+			project.add_lib("dxgi");
+			project.add_lib("d3d12");
+		}
+		else {
+			throw new Error("Graphics API " + graphics + " is not available for Windows.");
+		}
+	}
+	else if (platform === "macos") {
+		add_backend("apple");
+		add_backend("macos");
+		add_backend("posix");
+		if (graphics === "metal" || graphics === "default") {
+			add_backend("metal");
+			project.add_define("KINC_METAL");
+			project.add_lib("Metal");
+			project.add_lib("MetalKit");
+		}
+		else {
+			throw new Error("Graphics API " + graphics + " is not available for macOS.");
+		}
+		project.add_lib("IOKit");
+		project.add_lib("Cocoa");
+		project.add_lib("AppKit");
+		project.add_lib("CoreAudio");
+		project.add_lib("CoreData");
+		project.add_lib("CoreMedia");
+		project.add_lib("CoreVideo");
+		project.add_lib("AVFoundation");
+		project.add_lib("Foundation");
+	}
+	else if (platform === "ios") {
+		add_backend("apple");
+		add_backend("ios");
+		add_backend("posix");
+		if (graphics === "metal" || graphics === "default") {
+			add_backend("metal");
+			project.add_define("KINC_METAL");
+			project.add_lib("Metal");
+		}
+		else {
+			throw new Error("Graphics API " + graphics + " is not available for iOS.");
+		}
+		project.add_lib("UIKit");
+		project.add_lib("Foundation");
+		project.add_lib("CoreGraphics");
+		project.add_lib("QuartzCore");
+		project.add_lib("CoreAudio");
+		project.add_lib("AudioToolbox");
+		project.add_lib("CoreMotion");
+		project.add_lib("AVFoundation");
+		project.add_lib("CoreFoundation");
+		project.add_lib("CoreVideo");
+		project.add_lib("CoreMedia");
+	}
+	else if (platform === "android") {
+		project.add_define("KINC_ANDROID");
+		add_backend("android");
+		add_backend("posix");
+		if (graphics === "vulkan") {
+			add_backend("vulkan" || graphics === "default");
+			project.add_define("KINC_VULKAN");
+			project.add_define("VK_USE_PLATFORM_ANDROID_KHR");
+			project.add_lib("vulkan");
+			project.add_define("KINC_ANDROID_API=24");
+		}
+		else {
+			throw new Error("Graphics API " + graphics + " is not available for Android.");
+		}
+		project.add_lib("log");
+		project.add_lib("android");
+		project.add_lib("EGL");
+		project.add_lib("GLESv3");
+		project.add_lib("OpenSLES");
+		project.add_lib("OpenMAXAL");
+	}
+	else if (platform === "wasm") {
+		project.add_define("KINC_WASM");
+		add_backend("wasm");
+		project.add_include_dir("miniClib");
+		project.add_cfiles("sources/libs/miniClib/**");
+		if (graphics === "webgpu") {
+			add_backend("webgpu" || graphics === "default");
+			project.add_define("KINC_WEBGPU");
+		}
+		else {
+			throw new Error("Graphics API " + graphics + " is not available for Wasm.");
+		}
+	}
+	else if (platform === "linux") {
+		add_backend("linux");
+		add_backend("posix");
+		project.add_lib("asound");
+		project.add_lib("dl");
+		project.add_lib("udev");
+
+		// try {
+		// 	if (!fs_exists("build")) {
+		// 		fs_mkdir("build");
+		// 	}
+		// 	if (!fs_exists(path_join("build", "wayland"))) {
+		// 		fs_mkdir(path_join("build", "wayland"));
+		// 	}
+		// 	const waylandDir = path_join("build", "wayland", "wayland-generated");
+		// 	if (!fs_exists(waylandDir)) {
+		// 		fs_mkdir(waylandDir);
+		// 	}
+
+		// 	let good_wayland = false;
+
+		// 	const wayland_call = os_exec("wayland-scanner", ["--version"]);
+		// 	if (wayland_call.status !== 0) {
+		// 		throw "Could not run wayland-scanner to ask for its version";
+		// 	}
+		// 	const wayland_version = wayland_call.stderr;
+
+		// 	try {
+		// 		const scanner_versions = wayland_version.split(" ")[1].split(".");
+		// 		const w_x = parseInt(scanner_versions[0]);
+		// 		const w_y = parseInt(scanner_versions[1]);
+		// 		const w_z = parseInt(scanner_versions[2]);
+
+		// 		if (w_x > 1) {
+		// 			good_wayland = true;
+		// 		}
+		// 		else if (w_x === 1) {
+		// 			if (w_y > 17) {
+		// 				good_wayland = true;
+		// 			}
+		// 			else if (w_y === 17) {
+		// 				if (w_z >= 91) {
+		// 					good_wayland = true;
+		// 				}
+		// 			}
+		// 		}
+		// 	}
+		// 	catch (err) {
+		// 		console.log("Could not parse wayland-version " + wayland_version);
+		// 	}
+
+		// 	let c_ending = ".c";
+		// 	if (good_wayland) {
+		// 		c_ending = ".c.h";
+		// 	}
+
+		// 	let chfiles = [];
+
+		// 	function wl_protocol(protocol, file) {
+		// 		chfiles.push(file);
+		// 		const backend_path = path_resolve(waylandDir);
+		// 		const protocol_path = path_resolve("/usr/share/wayland-protocols", protocol);
+		// 		if (os_exec("wayland-scanner", ["private-code", protocol_path, path_resolve(backend_path, file + c_ending)]).status !== 0) {
+		// 			throw "Failed to generate wayland protocol files for" + protocol;
+		// 		}
+		// 		if (os_exec("wayland-scanner", ["client-header", protocol_path, path_resolve(backend_path, file + ".h")]).status !== 0) {
+		// 			throw "Failed to generate wayland protocol header for" + protocol;
+		// 		}
+		// 	}
+
+		// 	if (os_exec("wayland-scanner", ["private-code", "/usr/share/wayland/wayland.xml", path_resolve(waylandDir, "wayland-protocol" + c_ending)]).status !== 0) {
+		// 		throw "Failed to generate wayland protocol files for /usr/share/wayland/wayland.xml";
+		// 	}
+		// 	if (os_exec("wayland-scanner", ["client-header", "/usr/share/wayland/wayland.xml", path_resolve(waylandDir, "wayland-protocol.h")]).status !== 0) {
+		// 		throw "Failed to generate wayland protocol header for /usr/share/wayland/wayland.xml";
+		// 	}
+		// 	wl_protocol("stable/viewporter/viewporter.xml", "wayland-viewporter");
+		// 	wl_protocol("stable/xdg-shell/xdg-shell.xml", "xdg-shell");
+		// 	wl_protocol("unstable/xdg-decoration/xdg-decoration-unstable-v1.xml", "xdg-decoration");
+		// 	wl_protocol("unstable/tablet/tablet-unstable-v2.xml", "wayland-tablet");
+		// 	wl_protocol("unstable/pointer-constraints/pointer-constraints-unstable-v1.xml", "wayland-pointer-constraint");
+		// 	wl_protocol("unstable/relative-pointer/relative-pointer-unstable-v1.xml", "wayland-relative-pointer");
+
+		// 	if (good_wayland) {
+		// 		let cfile = "#include \"wayland-protocol.c.h\"\n";
+		// 		for (const chfile of chfiles) {
+		// 			cfile += "#include \"" + chfile + ".c.h\"\n";
+		// 		}
+		// 		fs_writefile(path_resolve(waylandDir, "waylandunit.c"), cfile);
+		// 	}
+
+		// 	project.add_include_dir(path_join("build", "wayland"));
+		// 	project.add_cfiles(path_resolve(waylandDir, "**"));
+		// }
+		// catch (err) {
+		// 	console.log("Failed to include wayland-support, setting KINC_NO_WAYLAND.");
+		// 	console.log("Wayland error was: " + err);
+		// 	project.add_define("KINC_NO_WAYLAND");
+		// }
+
+		if (graphics === "vulkan" || graphics === "default") {
+			add_backend("vulkan");
+			project.add_lib("vulkan");
+			project.add_define("KINC_VULKAN");
+		}
+		else {
+			throw new Error("Graphics API " + graphics + " is not available for Linux.");
+		}
+		project.add_define("_POSIX_C_SOURCE=200112L");
+		project.add_define("_XOPEN_SOURCE=600");
+	}
+}
+
+if (fs_exists(os_cwd() + "/icon.png")) {
+	project.icon = "icon.png";
+	if (platform === "macos" && fs_exists(os_cwd() + "/icon_macos.png")) {
+		project.icon = "icon_macos.png";
+	}
+}
+
+project.add_include_dir("sources/libs");
+project.add_cfiles("sources/libs/gc.c");
+project.add_cfiles("sources/libs/dir.c");
+project.add_include_dir("sources");
+project.add_cfiles("sources/iron.c");
+project.add_define("IRON_C_PATH=\"" + os_cwd() + "/build/iron.c" + "\"");
+project.add_define("EMBED_H_PATH=\"" + os_cwd() + "/build/embed.h" + "\"");
+
+if (flags.with_audio) {
+	project.add_define("KINC_A1");
+	project.add_define("KINC_A2");
+	project.add_define("WITH_AUDIO");
+	project.add_define("arm_audio");
+	project.add_cfiles("sources/libs/stb_vorbis.c");
+}
+
+if (flags.with_eval) {
+	project.add_define("WITH_EVAL");
+	project.add_cfiles("sources/libs/quickjs/*.c");
+	if (platform === "linux") {
+		project.add_lib("m");
+		project.add_define("_GNU_SOURCE");
+		project.add_define("environ=__environ");
+		project.add_define("sighandler_t=__sighandler_t");
+	}
+	else if (platform === "windows") {
+		project.add_define("WIN32_LEAN_AND_MEAN");
+		project.add_define("_WIN32_WINNT=0x0602");
+	}
+}
+
+if (flags.with_iron) {
+	project.add_define("WITH_IRON");
+	project.add_cfiles("sources/*.c");
+}
+
+if (platform === "windows") {
+	project.add_lib("Dbghelp"); // Stack walk
+	project.add_lib("Dwmapi"); // DWMWA_USE_IMMERSIVE_DARK_MODE
+	if (flags.with_d3dcompiler) {
+		project.add_define("WITH_D3DCOMPILER");
+		project.add_lib("d3d11");
+		project.add_lib("d3dcompiler");
+	}
+}
+else if (platform === "linux") {
+	project.add_define("KINC_NO_WAYLAND"); // TODO: kinc_wayland_display_init() not implemented
+}
+else if (platform === "android") {
+	project.add_define("IDLE_SLEEP");
+	project.target_options.android.package = flags.package;
+	project.target_options.android.permissions = ["android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.INTERNET"];
+	project.target_options.android.screenOrientation = ["sensorLandscape"];
+	project.target_options.android.minSdkVersion = 30;
+	project.target_options.android.targetSdkVersion = 33;
+	project.target_options.android.versionCode = 240000;
+	project.target_options.android.versionName = "1.0 alpha";
+}
+else if (platform === "ios") {
+	project.add_define("IDLE_SLEEP");
+}
+
+if (flags.with_nfd && (platform === "windows" || platform === "linux" || platform === "macos")) {
+	project.add_define("WITH_NFD");
+	project.add_include_dir("sources/libs/nfd");
+	project.add_cfiles("sources/libs/nfd/nfd_common.c");
+
+	if (platform === "windows") {
+		project.add_cfiles("sources/libs/nfd/nfd_win.cpp");
+	}
+	else if (platform === "linux") {
+		project.add_cfiles("sources/libs/nfd/nfd_gtk.c");
+		project.add_include_dir("/usr/include/gtk-3.0");
+		project.add_include_dir("/usr/include/glib-2.0");
+		project.add_include_dir("/usr/lib/x86_64-linux-gnu/glib-2.0/include");
+		project.add_include_dir("/usr/include/pango-1.0");
+		project.add_include_dir("/usr/include/cairo");
+		project.add_include_dir("/usr/include/gdk-pixbuf-2.0");
+		project.add_include_dir("/usr/include/atk-1.0");
+		project.add_include_dir("/usr/lib64/glib-2.0/include");
+		project.add_include_dir("/usr/lib/glib-2.0/include");
+		project.add_include_dir("/usr/include/harfbuzz");
+		project.add_lib("gtk-3");
+		project.add_lib("gobject-2.0");
+		project.add_lib("glib-2.0");
+	}
+	else {
+		project.add_cfiles("sources/libs/nfd/nfd_cocoa.m");
+	}
+}
+
+if (flags.with_compress) {
+	project.add_define("WITH_COMPRESS");
+}
+
+if (flags.with_image_write) {
+	project.add_define("WITH_IMAGE_WRITE");
+}
+
+if (flags.with_video_write) {
+	project.add_define("WITH_VIDEO_WRITE");
+	project.add_cfiles("sources/libs/minimp4.c");
+	project.add_cfiles("sources/libs/minih264e.c");
+}
+
 project.flatten();
 return project;

+ 5 - 0
base/readme.md

@@ -0,0 +1,5 @@
+# iron
+
+3D engine for C with JS scripting, targeting Direct3D12, Vulkan, Metal and WebGPU.
+
+Powered by [Kore](https://github.com/Kode/Kore) - low-level hardware abstraction library.

+ 0 - 0
armorcore/shaders/g2_colored.frag.glsl → base/shaders/draw/draw_colored.frag.glsl


+ 0 - 0
armorcore/shaders/g2_colored.vert.glsl → base/shaders/draw/draw_colored.vert.glsl


+ 0 - 0
armorcore/shaders/g2_image.frag.glsl → base/shaders/draw/draw_image.frag.glsl


+ 0 - 0
armorcore/shaders/g2_image.vert.glsl → base/shaders/draw/draw_image.vert.glsl


+ 0 - 0
armorcore/shaders/g2_text.frag.glsl → base/shaders/draw/draw_text.frag.glsl


+ 0 - 0
armorcore/shaders/g2_text.vert.glsl → base/shaders/draw/draw_text.vert.glsl


+ 0 - 0
armorcore/sources/.clang-format → base/sources/.clang-format


+ 0 - 0
armorcore/sources/backends/android/android_native_app_glue.c → base/sources/backends/android/android_native_app_glue.c


+ 0 - 0
armorcore/sources/backends/android/android_native_app_glue.h → base/sources/backends/android/android_native_app_glue.h


+ 0 - 0
armorcore/sources/backends/android/java/arm/AndroidHttpRequest.java → base/sources/backends/android/java/arm/AndroidHttpRequest.java


+ 0 - 0
armorcore/sources/backends/android/java/tech/kinc/KincActivity.kt → base/sources/backends/android/java/tech/kinc/KincActivity.kt


+ 0 - 0
armorcore/sources/backends/android/java/tech/kinc/KincMoviePlayer.kt → base/sources/backends/android/java/tech/kinc/KincMoviePlayer.kt


+ 0 - 0
armorcore/sources/backends/android/java/tech/kinc/KincMovieTexture.kt → base/sources/backends/android/java/tech/kinc/KincMovieTexture.kt


+ 0 - 0
armorcore/sources/backends/android/kinc/backend/android.h → base/sources/backends/android/kinc/backend/android.h


+ 1 - 1
armorcore/sources/backends/android/kinc/backend/android_file_dialog.c → base/sources/backends/android/kinc/backend/android_file_dialog.c

@@ -1,5 +1,5 @@
 #include "android_file_dialog.h"
-#include <kinc/system.h>
+#include <iron_system.h>
 #include <jni.h>
 #include <string.h>
 #include <stdlib.h>

+ 0 - 0
armorcore/sources/backends/android/kinc/backend/android_file_dialog.h → base/sources/backends/android/kinc/backend/android_file_dialog.h


+ 1 - 1
armorcore/sources/backends/android/kinc/backend/android_http_request.c → base/sources/backends/android/kinc/backend/android_http_request.c

@@ -1,5 +1,5 @@
 #include "android_http_request.h"
-#include <kinc/system.h>
+#include <iron_system.h>
 #include <jni.h>
 #include <string.h>
 #include <android_native_app_glue.h>

+ 0 - 0
armorcore/sources/backends/android/kinc/backend/android_http_request.h → base/sources/backends/android/kinc/backend/android_http_request.h


+ 0 - 0
armorcore/sources/backends/android/kinc/backend/androidunit.c → base/sources/backends/android/kinc/backend/androidunit.c


+ 0 - 0
armorcore/sources/backends/android/kinc/backend/audio.c.h → base/sources/backends/android/kinc/backend/audio.c.h


+ 2 - 2
armorcore/sources/backends/android/kinc/backend/display.c.h → base/sources/backends/android/kinc/backend/display.c.h

@@ -1,7 +1,7 @@
 #include <kinc/backend/android.h>
 
-#include <kinc/display.h>
-#include <kinc/log.h>
+#include <iron_system.h>
+#include <iron_log.h>
 
 typedef struct {
 	bool available;

+ 8 - 15
armorcore/sources/backends/android/kinc/backend/system.c.h → base/sources/backends/android/kinc/backend/system.c.h

@@ -1,21 +1,15 @@
 #define EGL_NO_PLATFORM_SPECIFIC_TYPES
 #include <EGL/egl.h>
-#include <kinc/error.h>
 #include <kinc/backend/android.h>
-#include <kinc/g5.h>
-#include <kinc/gamepad.h>
-#include <kinc/keyboard.h>
-#include <kinc/mouse.h>
+#include <iron_gpu.h>
+#include <iron_input.h>
 #include <android/sensor.h>
 #include <android/window.h>
 #include <android_native_app_glue.h>
-#include <kinc/pen.h>
-#include <kinc/surface.h>
-#include <kinc/log.h>
-#include <kinc/system.h>
-#include <kinc/mutex.h>
-#include <kinc/video.h>
-#include <kinc/window.h>
+#include <iron_log.h>
+#include <iron_system.h>
+#include <iron_thread.h>
+#include <iron_video.h>
 #include <unistd.h>
 #include <stdlib.h>
 
@@ -36,7 +30,6 @@ static bool appIsForeground = false;
 static bool activityJustResized = false;
 
 #include <assert.h>
-#include <kinc/log.h>
 
 #include <vulkan/vulkan_android.h>
 #include <vulkan/vulkan_core.h>
@@ -957,7 +950,7 @@ void kinc_set_keep_screen_on(bool on) {
 	}
 }
 
-#include <kinc/window.h>
+#include <iron_system.h>
 #include <sys/time.h>
 #include <time.h>
 
@@ -1147,7 +1140,7 @@ const char *kinc_gamepad_product_name(int gamepad) {
 	return "gamepad";
 }
 
-#include <kinc/filereader.h>
+#include <iron_file.h>
 
 #define CLASS_NAME "android/app/NativeActivity"
 

+ 5 - 5
armorcore/sources/backends/android/kinc/backend/video.c.h → base/sources/backends/android/kinc/backend/video.c.h

@@ -1,10 +1,10 @@
-#include <kinc/video.h>
+#include <iron_video.h>
 
 #include <kinc/audio1/audio.h>
-#include <kinc/g5_texture.h>
-#include <kinc/filereader.h>
-#include <kinc/log.h>
-#include <kinc/system.h>
+#include <iron_gpu.h>
+#include <iron_file.h>
+#include <iron_log.h>
+#include <iron_system.h>
 
 #include <android_native_app_glue.h>
 #include <stdio.h>

+ 1 - 1
armorcore/sources/backends/android/kinc/backend/video.h → base/sources/backends/android/kinc/backend/video.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include <kinc/g5_texture.h>
+#include <iron_gpu.h>
 
 typedef struct {
 	void *assetReader;

+ 2 - 3
armorcore/sources/backends/android/kinc/backend/window.c.h → base/sources/backends/android/kinc/backend/window.c.h

@@ -1,6 +1,5 @@
-#include <kinc/display.h>
-#include <kinc/g5.h>
-#include <kinc/window.h>
+#include <iron_gpu.h>
+#include <iron_system.h>
 
 static void (*resizeCallback)(int x, int y, void *data) = NULL;
 static void *resizeCallbackData = NULL;

+ 0 - 0
armorcore/sources/backends/apple/kinc/backend/appleunit.m → base/sources/backends/apple/kinc/backend/appleunit.m


+ 1 - 1
armorcore/sources/backends/apple/kinc/backend/http.m.h → base/sources/backends/apple/kinc/backend/http.m.h

@@ -1,4 +1,4 @@
-#include <kinc/http.h>
+#include <iron_net.h>
 
 #import <Foundation/Foundation.h>
 

+ 1 - 1
armorcore/sources/backends/apple/kinc/backend/system.m.h → base/sources/backends/apple/kinc/backend/system.m.h

@@ -1,4 +1,4 @@
-#include <kinc/system.h>
+#include <iron_system.h>
 
 int kinc_hardware_threads(void) {
 	return (int)[[NSProcessInfo processInfo] processorCount];

+ 1 - 2
armorcore/sources/backends/apple/kinc/backend/thread.m.h → base/sources/backends/apple/kinc/backend/thread.m.h

@@ -1,8 +1,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <Foundation/Foundation.h>
-#include <kinc/mutex.h>
-#include <kinc/thread.h>
+#include <iron_thread.h>
 #include <pthread.h>
 #include <stdio.h>
 #include <wchar.h>

+ 1 - 1
armorcore/sources/backends/apple/kinc/backend/video.h → base/sources/backends/apple/kinc/backend/video.h

@@ -1,7 +1,7 @@
 #pragma once
 
 #include <objc/runtime.h>
-#include <kinc/g5_texture.h>
+#include <iron_gpu.h>
 
 typedef struct {
 	double start;

+ 6 - 6
armorcore/sources/backends/apple/kinc/backend/video.m.h → base/sources/backends/apple/kinc/backend/video.m.h

@@ -1,11 +1,11 @@
-#include <kinc/video.h>
+#include <iron_video.h>
 
 #import <AVFoundation/AVFoundation.h>
-#include <kinc/a1.h>
-#include <kinc/g5_texture.h>
-#include <kinc/filereader.h>
-#include <kinc/log.h>
-#include <kinc/system.h>
+#include <iron_audio.h>
+#include <iron_gpu.h>
+#include <iron_file.h>
+#include <iron_log.h>
+#include <iron_system.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

+ 0 - 0
armorcore/sources/backends/data/android/app/CMakeLists.txt → base/sources/backends/data/android/app/CMakeLists.txt


+ 0 - 0
armorcore/sources/backends/data/android/app/build.gradle.kts → base/sources/backends/data/android/app/build.gradle.kts


+ 0 - 0
armorcore/sources/backends/data/android/app/proguard-rules.pro → base/sources/backends/data/android/app/proguard-rules.pro


+ 0 - 0
armorcore/sources/backends/data/android/build.gradle.kts → base/sources/backends/data/android/build.gradle.kts


+ 0 - 0
armorcore/sources/backends/data/android/gradle.properties → base/sources/backends/data/android/gradle.properties


+ 0 - 0
armorcore/sources/backends/data/android/gradle/wrapper/gradle-wrapper.jar → base/sources/backends/data/android/gradle/wrapper/gradle-wrapper.jar


+ 0 - 0
armorcore/sources/backends/data/android/gradle/wrapper/gradle-wrapper.properties → base/sources/backends/data/android/gradle/wrapper/gradle-wrapper.properties


+ 0 - 0
armorcore/sources/backends/data/android/gradlew → base/sources/backends/data/android/gradlew


+ 0 - 0
armorcore/sources/backends/data/android/gradlew.bat → base/sources/backends/data/android/gradlew.bat


+ 0 - 0
armorcore/sources/backends/data/android/main/AndroidManifest.xml → base/sources/backends/data/android/main/AndroidManifest.xml


+ 0 - 0
armorcore/sources/backends/data/android/main/res/values/strings.xml → base/sources/backends/data/android/main/res/values/strings.xml


+ 0 - 0
armorcore/sources/backends/data/android/settings.gradle.kts → base/sources/backends/data/android/settings.gradle.kts


+ 0 - 0
armorcore/sources/backends/data/wasm/JS-Sources/audio-thread.js → base/sources/backends/data/wasm/JS-Sources/audio-thread.js


+ 0 - 0
armorcore/sources/backends/data/wasm/JS-Sources/index.html → base/sources/backends/data/wasm/JS-Sources/index.html


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác