├── .clang-format ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── funding.yml └── workflows │ ├── android-opengl.yml │ ├── android-vulkan.yml │ ├── dox.yml │ ├── html5.yml │ ├── html5worker.yml │ ├── ios-metal.yml │ ├── ios-opengl.yml │ ├── java.yml │ ├── krom.yml │ ├── linux-hl-opengl.yml │ ├── linux-opengl.yml │ ├── linux-vulkan.yml │ ├── macos-hl-metal.yml │ ├── macos-metal.yml │ ├── macos-opengl.yml │ ├── node.yml │ ├── uwp.yml │ ├── windows-direct3d11.yml │ ├── windows-direct3d12.yml │ ├── windows-hl-direct3d11.yml │ ├── windows-opengl.yml │ ├── windows-vulkan.yml │ └── wpf.yml ├── .gitignore ├── .gitmodules ├── .vscode └── settings.json ├── Backends ├── Empty │ └── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── DisplayImpl.hx │ │ ├── EnvironmentVariables.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── arrays │ │ ├── ByteArray.hx │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ └── Audio.hx │ │ ├── audio2 │ │ └── Audio.hx │ │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── IndexBuffer.hx │ │ ├── PipelineState.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ │ ├── input │ │ └── MouseImpl.hx │ │ ├── netsync │ │ └── Network.hx │ │ └── network │ │ └── Http.hx ├── HTML5-Worker │ └── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Starter.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── Worker.hx │ │ ├── arrays │ │ ├── ByteArray.hx │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ └── Audio.hx │ │ ├── audio2 │ │ └── Audio.hx │ │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── IndexBuffer.hx │ │ ├── PipelineState.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ │ └── html5worker │ │ ├── ConstantLocation.hx │ │ ├── Graphics.hx │ │ ├── Sound.hx │ │ └── TextureUnit.hx ├── HTML5 │ └── kha │ │ ├── Blob.hx │ │ ├── CanvasImage.hx │ │ ├── Display.hx │ │ ├── EnvironmentVariables.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Macros.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── WebGLImage.hx │ │ ├── Window.hx │ │ ├── arrays │ │ ├── ByteArray.hx │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ └── Audio.hx │ │ ├── audio2 │ │ ├── Audio.hx │ │ └── VirtualStreamChannel.hx │ │ ├── capture │ │ ├── AudioCapture.hx │ │ └── VideoCapture.hx │ │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── IndexBuffer.hx │ │ ├── PipelineState.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ │ ├── input │ │ ├── MouseImpl.hx │ │ └── Sensor.hx │ │ ├── js │ │ ├── AEAudioChannel.hx │ │ ├── AudioElementAudio.hx │ │ ├── CanvasGraphics.hx │ │ ├── Font.hx │ │ ├── MobileWebAudio.hx │ │ ├── MobileWebAudioChannel.hx │ │ ├── MobileWebAudioSound.hx │ │ ├── Sound.hx │ │ ├── Video.hx │ │ ├── WebAudioSound.hx │ │ ├── graphics4 │ │ │ ├── ConstantLocation.hx │ │ │ ├── Graphics.hx │ │ │ ├── Graphics2.hx │ │ │ └── TextureUnit.hx │ │ └── vr │ │ │ └── VrInterface.hx │ │ ├── netsync │ │ └── Network.hx │ │ └── network │ │ └── Http.hx ├── Java │ ├── java │ │ └── lang │ │ │ └── Runnable.hx │ └── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── arrays │ │ ├── Float32Array.hx │ │ ├── Int16Array.hx │ │ └── Int32Array.hx │ │ ├── audio1 │ │ ├── Audio.hx │ │ ├── JavaMusicChannel.hx │ │ └── JavaSoundChannel.hx │ │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── IndexBuffer.hx │ │ ├── Program.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ │ └── java │ │ ├── Font.hx │ │ ├── Graphics.hx │ │ ├── Music.hx │ │ ├── Painter.hx │ │ └── Sound.hx ├── Kore-HL │ ├── hl │ │ ├── .clang-format │ │ ├── LICENSE │ │ ├── include │ │ │ ├── mbedtls │ │ │ │ ├── LICENSE │ │ │ │ ├── apache-2.0.txt │ │ │ │ ├── include │ │ │ │ │ └── mbedtls │ │ │ │ │ │ ├── aes.h │ │ │ │ │ │ ├── aesni.h │ │ │ │ │ │ ├── arc4.h │ │ │ │ │ │ ├── asn1.h │ │ │ │ │ │ ├── asn1write.h │ │ │ │ │ │ ├── base64.h │ │ │ │ │ │ ├── bignum.h │ │ │ │ │ │ ├── blowfish.h │ │ │ │ │ │ ├── bn_mul.h │ │ │ │ │ │ ├── camellia.h │ │ │ │ │ │ ├── ccm.h │ │ │ │ │ │ ├── certs.h │ │ │ │ │ │ ├── check_config.h │ │ │ │ │ │ ├── cipher.h │ │ │ │ │ │ ├── cipher_internal.h │ │ │ │ │ │ ├── cmac.h │ │ │ │ │ │ ├── compat-1.3.h │ │ │ │ │ │ ├── config.h │ │ │ │ │ │ ├── ctr_drbg.h │ │ │ │ │ │ ├── debug.h │ │ │ │ │ │ ├── des.h │ │ │ │ │ │ ├── dhm.h │ │ │ │ │ │ ├── ecdh.h │ │ │ │ │ │ ├── ecdsa.h │ │ │ │ │ │ ├── ecjpake.h │ │ │ │ │ │ ├── ecp.h │ │ │ │ │ │ ├── ecp_internal.h │ │ │ │ │ │ ├── entropy.h │ │ │ │ │ │ ├── entropy_poll.h │ │ │ │ │ │ ├── error.h │ │ │ │ │ │ ├── gcm.h │ │ │ │ │ │ ├── havege.h │ │ │ │ │ │ ├── hmac_drbg.h │ │ │ │ │ │ ├── md.h │ │ │ │ │ │ ├── md2.h │ │ │ │ │ │ ├── md4.h │ │ │ │ │ │ ├── md5.h │ │ │ │ │ │ ├── md_internal.h │ │ │ │ │ │ ├── memory_buffer_alloc.h │ │ │ │ │ │ ├── net.h │ │ │ │ │ │ ├── net_sockets.h │ │ │ │ │ │ ├── oid.h │ │ │ │ │ │ ├── padlock.h │ │ │ │ │ │ ├── pem.h │ │ │ │ │ │ ├── pk.h │ │ │ │ │ │ ├── pk_internal.h │ │ │ │ │ │ ├── pkcs11.h │ │ │ │ │ │ ├── pkcs12.h │ │ │ │ │ │ ├── pkcs5.h │ │ │ │ │ │ ├── platform.h │ │ │ │ │ │ ├── platform_time.h │ │ │ │ │ │ ├── ripemd160.h │ │ │ │ │ │ ├── rsa.h │ │ │ │ │ │ ├── rsa_internal.h │ │ │ │ │ │ ├── sha1.h │ │ │ │ │ │ ├── sha256.h │ │ │ │ │ │ ├── sha512.h │ │ │ │ │ │ ├── ssl.h │ │ │ │ │ │ ├── ssl_cache.h │ │ │ │ │ │ ├── ssl_ciphersuites.h │ │ │ │ │ │ ├── ssl_cookie.h │ │ │ │ │ │ ├── ssl_internal.h │ │ │ │ │ │ ├── ssl_ticket.h │ │ │ │ │ │ ├── threading.h │ │ │ │ │ │ ├── threading_alt.h │ │ │ │ │ │ ├── timing.h │ │ │ │ │ │ ├── version.h │ │ │ │ │ │ ├── x509.h │ │ │ │ │ │ ├── x509_crl.h │ │ │ │ │ │ ├── x509_crt.h │ │ │ │ │ │ ├── x509_csr.h │ │ │ │ │ │ └── xtea.h │ │ │ │ └── library │ │ │ │ │ ├── aes.c │ │ │ │ │ ├── aesni.c │ │ │ │ │ ├── arc4.c │ │ │ │ │ ├── asn1parse.c │ │ │ │ │ ├── asn1write.c │ │ │ │ │ ├── base64.c │ │ │ │ │ ├── bignum.c │ │ │ │ │ ├── blowfish.c │ │ │ │ │ ├── camellia.c │ │ │ │ │ ├── ccm.c │ │ │ │ │ ├── certs.c │ │ │ │ │ ├── cipher.c │ │ │ │ │ ├── cipher_wrap.c │ │ │ │ │ ├── cmac.c │ │ │ │ │ ├── ctr_drbg.c │ │ │ │ │ ├── debug.c │ │ │ │ │ ├── des.c │ │ │ │ │ ├── dhm.c │ │ │ │ │ ├── ecdh.c │ │ │ │ │ ├── ecdsa.c │ │ │ │ │ ├── ecjpake.c │ │ │ │ │ ├── ecp.c │ │ │ │ │ ├── ecp_curves.c │ │ │ │ │ ├── entropy.c │ │ │ │ │ ├── entropy_poll.c │ │ │ │ │ ├── error.c │ │ │ │ │ ├── gcm.c │ │ │ │ │ ├── havege.c │ │ │ │ │ ├── hmac_drbg.c │ │ │ │ │ ├── md.c │ │ │ │ │ ├── md2.c │ │ │ │ │ ├── md4.c │ │ │ │ │ ├── md5.c │ │ │ │ │ ├── md_wrap.c │ │ │ │ │ ├── memory_buffer_alloc.c │ │ │ │ │ ├── net_sockets.c │ │ │ │ │ ├── oid.c │ │ │ │ │ ├── padlock.c │ │ │ │ │ ├── pem.c │ │ │ │ │ ├── pk.c │ │ │ │ │ ├── pk_wrap.c │ │ │ │ │ ├── pkcs11.c │ │ │ │ │ ├── pkcs12.c │ │ │ │ │ ├── pkcs5.c │ │ │ │ │ ├── pkparse.c │ │ │ │ │ ├── pkwrite.c │ │ │ │ │ ├── platform.c │ │ │ │ │ ├── ripemd160.c │ │ │ │ │ ├── rsa.c │ │ │ │ │ ├── rsa_internal.c │ │ │ │ │ ├── sha1.c │ │ │ │ │ ├── sha256.c │ │ │ │ │ ├── sha512.c │ │ │ │ │ ├── ssl_cache.c │ │ │ │ │ ├── ssl_ciphersuites.c │ │ │ │ │ ├── ssl_cli.c │ │ │ │ │ ├── ssl_cookie.c │ │ │ │ │ ├── ssl_srv.c │ │ │ │ │ ├── ssl_ticket.c │ │ │ │ │ ├── ssl_tls.c │ │ │ │ │ ├── threading.c │ │ │ │ │ ├── timing.c │ │ │ │ │ ├── version.c │ │ │ │ │ ├── version_features.c │ │ │ │ │ ├── x509.c │ │ │ │ │ ├── x509_create.c │ │ │ │ │ ├── x509_crl.c │ │ │ │ │ ├── x509_crt.c │ │ │ │ │ ├── x509_csr.c │ │ │ │ │ ├── x509write_crt.c │ │ │ │ │ ├── x509write_csr.c │ │ │ │ │ └── xtea.c │ │ │ ├── pcre │ │ │ │ ├── LICENCE │ │ │ │ ├── config.h │ │ │ │ ├── pcre2.h │ │ │ │ ├── pcre2_auto_possess.c │ │ │ │ ├── pcre2_chartables.c │ │ │ │ ├── pcre2_compile.c │ │ │ │ ├── pcre2_config.c │ │ │ │ ├── pcre2_context.c │ │ │ │ ├── pcre2_convert.c │ │ │ │ ├── pcre2_dfa_match.c │ │ │ │ ├── pcre2_error.c │ │ │ │ ├── pcre2_extuni.c │ │ │ │ ├── pcre2_find_bracket.c │ │ │ │ ├── pcre2_internal.h │ │ │ │ ├── pcre2_intmodedep.h │ │ │ │ ├── pcre2_jit_compile.c │ │ │ │ ├── pcre2_jit_match.c │ │ │ │ ├── pcre2_jit_misc.c │ │ │ │ ├── pcre2_maketables.c │ │ │ │ ├── pcre2_match.c │ │ │ │ ├── pcre2_match_data.c │ │ │ │ ├── pcre2_newline.c │ │ │ │ ├── pcre2_ord2utf.c │ │ │ │ ├── pcre2_pattern_info.c │ │ │ │ ├── pcre2_script_run.c │ │ │ │ ├── pcre2_serialize.c │ │ │ │ ├── pcre2_string_utils.c │ │ │ │ ├── pcre2_study.c │ │ │ │ ├── pcre2_substitute.c │ │ │ │ ├── pcre2_substring.c │ │ │ │ ├── pcre2_tables.c │ │ │ │ ├── pcre2_ucd.c │ │ │ │ ├── pcre2_ucp.h │ │ │ │ ├── pcre2_ucptables.c │ │ │ │ ├── pcre2_valid_utf.c │ │ │ │ └── pcre2_xclass.c │ │ │ └── zlib │ │ │ │ ├── README │ │ │ │ ├── adler32.c │ │ │ │ ├── crc32.c │ │ │ │ ├── crc32.h │ │ │ │ ├── deflate.c │ │ │ │ ├── deflate.h │ │ │ │ ├── inffast.c │ │ │ │ ├── inffast.h │ │ │ │ ├── inffixed.h │ │ │ │ ├── inflate.c │ │ │ │ ├── inflate.h │ │ │ │ ├── inftrees.c │ │ │ │ ├── inftrees.h │ │ │ │ ├── trees.c │ │ │ │ ├── trees.h │ │ │ │ ├── zconf.h │ │ │ │ ├── zlib.h │ │ │ │ ├── zutil.c │ │ │ │ └── zutil.h │ │ ├── libs │ │ │ ├── fmt │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── dxt.c │ │ │ │ ├── fmt.c │ │ │ │ ├── fmt.vcxproj │ │ │ │ ├── fmt.vcxproj.filters │ │ │ │ ├── mikkt.c │ │ │ │ ├── sha1.c │ │ │ │ └── sha1.h │ │ │ └── ssl │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── ssl.c │ │ │ │ ├── ssl.vcxproj │ │ │ │ └── ssl.vcxproj.filters │ │ └── src │ │ │ ├── allocator.c │ │ │ ├── allocator.h │ │ │ ├── code.c │ │ │ ├── debugger.c │ │ │ ├── gc.c │ │ │ ├── hl.h │ │ │ ├── hlc.h │ │ │ ├── hlc_main.c │ │ │ ├── hlmodule.h │ │ │ ├── jit.c │ │ │ ├── main.c │ │ │ ├── module.c │ │ │ ├── opcodes.h │ │ │ ├── profile.c │ │ │ └── std │ │ │ ├── array.c │ │ │ ├── buffer.c │ │ │ ├── bytes.c │ │ │ ├── cast.c │ │ │ ├── date.c │ │ │ ├── debug.c │ │ │ ├── error.c │ │ │ ├── file.c │ │ │ ├── fun.c │ │ │ ├── maps.c │ │ │ ├── maps.h │ │ │ ├── math.c │ │ │ ├── obj.c │ │ │ ├── process.c │ │ │ ├── random.c │ │ │ ├── regexp.c │ │ │ ├── socket.c │ │ │ ├── sort.h │ │ │ ├── string.c │ │ │ ├── sys.c │ │ │ ├── sys_android.c │ │ │ ├── sys_ios.m │ │ │ ├── thread.c │ │ │ ├── track.c │ │ │ ├── types.c │ │ │ ├── ucs2.c │ │ │ └── unicase.h │ ├── kfile.js │ ├── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Pointer.hx │ │ ├── Storage.hx │ │ ├── StringHelper.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── arrays │ │ │ ├── ByteArray.hx │ │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ │ └── Audio.hx │ │ ├── audio2 │ │ │ ├── Audio.hx │ │ │ └── StreamChannel.hx │ │ ├── graphics4 │ │ │ ├── ComputeShader.hx │ │ │ ├── CubeMap.hx │ │ │ ├── FragmentShader.hx │ │ │ ├── GeometryShader.hx │ │ │ ├── IndexBuffer.hx │ │ │ ├── PipelineState.hx │ │ │ ├── ShaderStorageBuffer.hx │ │ │ ├── TessellationControlShader.hx │ │ │ ├── TessellationEvaluationShader.hx │ │ │ ├── VertexBuffer.hx │ │ │ └── VertexShader.hx │ │ ├── input │ │ │ ├── MouseImpl.hx │ │ │ └── Sensor.hx │ │ ├── korehl │ │ │ ├── Sound.hx │ │ │ ├── Video.hx │ │ │ └── graphics4 │ │ │ │ ├── ConstantLocation.hx │ │ │ │ ├── Graphics.hx │ │ │ │ ├── Graphics2.hx │ │ │ │ └── TextureUnit.hx │ │ ├── netsync │ │ │ └── Network.hx │ │ └── network │ │ │ └── Http.hx │ └── kinc-bridge │ │ ├── arrays.c.h │ │ ├── bridge.c │ │ ├── compute.c.h │ │ ├── cubemap.c.h │ │ ├── display.c.h │ │ ├── graphics.c.h │ │ ├── indexbuffer.c.h │ │ ├── kinc.c.h │ │ ├── shader.c.h │ │ ├── sound.c.h │ │ ├── system.c.h │ │ ├── texture.c.h │ │ ├── vertexbuffer.c.h │ │ └── video.c.h ├── Kore-hxcpp │ ├── kfile.js │ ├── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── arrays │ │ │ ├── ByteArray.hx │ │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ │ └── Audio.hx │ │ ├── audio2 │ │ │ ├── Audio.hx │ │ │ └── StreamChannel.hx │ │ ├── capture │ │ │ └── AudioCapture.hx │ │ ├── graphics4 │ │ │ ├── ComputeShader.hx │ │ │ ├── CubeMap.hx │ │ │ ├── FragmentShader.hx │ │ │ ├── GeometryShader.hx │ │ │ ├── IndexBuffer.hx │ │ │ ├── PipelineState.hx │ │ │ ├── ShaderStorageBuffer.hx │ │ │ ├── TessellationControlShader.hx │ │ │ ├── TessellationEvaluationShader.hx │ │ │ ├── VertexBuffer.hx │ │ │ └── VertexShader.hx │ │ ├── graphics5_ │ │ │ ├── AccelerationStructure.hx │ │ │ ├── CommandList.hx │ │ │ ├── ConstantBuffer.hx │ │ │ ├── FragmentShader.hx │ │ │ ├── IndexBuffer.hx │ │ │ ├── PipelineState.hx │ │ │ ├── RayTracePipeline.hx │ │ │ ├── RayTraceTarget.hx │ │ │ ├── RenderTarget.hx │ │ │ ├── VertexBuffer.hx │ │ │ └── VertexShader.hx │ │ ├── input │ │ │ ├── MouseImpl.hx │ │ │ └── Sensor.hx │ │ ├── kore │ │ │ ├── Keyboard.hx │ │ │ ├── Video.hx │ │ │ ├── graphics4 │ │ │ │ ├── ConstantLocation.hx │ │ │ │ ├── Graphics.hx │ │ │ │ ├── Graphics2.hx │ │ │ │ ├── ShaderType.hx │ │ │ │ └── TextureUnit.hx │ │ │ ├── graphics5_ │ │ │ │ └── Graphics.hx │ │ │ └── vr │ │ │ │ ├── CardboardVrInterface.hx │ │ │ │ ├── VrInterface.hx │ │ │ │ └── VrInterfaceRift.hx │ │ ├── netsync │ │ │ └── Network.hx │ │ └── network │ │ │ └── Http.hx │ ├── lib │ │ └── khalib │ │ │ ├── float32x4.h │ │ │ ├── g4.h │ │ │ ├── loader.c │ │ │ ├── loader.h │ │ │ └── stb_ds.h │ ├── main.cpp │ └── test.natvis ├── Krom │ ├── Krom.hx │ └── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── arrays │ │ ├── ByteArray.hx │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ └── Audio.hx │ │ ├── audio2 │ │ └── Audio.hx │ │ ├── compute │ │ ├── Compute.hx │ │ ├── ConstantLocation.hx │ │ ├── Shader.hx │ │ ├── ShaderStorageBuffer.hx │ │ └── TextureUnit.hx │ │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── GeometryShader.hx │ │ ├── IndexBuffer.hx │ │ ├── PipelineState.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── TessellationControlShader.hx │ │ ├── TessellationEvaluationShader.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ │ ├── input │ │ └── MouseImpl.hx │ │ ├── krom │ │ ├── Graphics.hx │ │ └── Sound.hx │ │ └── network │ │ ├── Http.hx │ │ └── Network.hx ├── Node │ ├── js │ │ ├── LICENSE.md │ │ ├── Node.hx │ │ ├── README.md │ │ └── node │ │ │ ├── Assert.hx │ │ │ ├── Buffer.hx │ │ │ ├── ChildProcess.hx │ │ │ ├── Cluster.hx │ │ │ ├── Constants.hx │ │ │ ├── Crypto.hx │ │ │ ├── Dgram.hx │ │ │ ├── Dns.hx │ │ │ ├── Domain.hx │ │ │ ├── Events.hx │ │ │ ├── Fs.hx │ │ │ ├── Http.hx │ │ │ ├── Https.hx │ │ │ ├── Iterator.hx │ │ │ ├── KeyValue.hx │ │ │ ├── Module.hx │ │ │ ├── Net.hx │ │ │ ├── Os.hx │ │ │ ├── Path.hx │ │ │ ├── Process.hx │ │ │ ├── Punycode.hx │ │ │ ├── Querystring.hx │ │ │ ├── Readline.hx │ │ │ ├── Repl.hx │ │ │ ├── Require.hx │ │ │ ├── Stream.hx │ │ │ ├── StringDecoder.hx │ │ │ ├── Timers.hx │ │ │ ├── Tls.hx │ │ │ ├── Tty.hx │ │ │ ├── Url.hx │ │ │ ├── Util.hx │ │ │ ├── V8.hx │ │ │ ├── Vm.hx │ │ │ ├── Zlib.hx │ │ │ ├── assert │ │ │ └── AssertionError.hx │ │ │ ├── buffer │ │ │ ├── Buffer.hx │ │ │ └── SlowBuffer.hx │ │ │ ├── child_process │ │ │ └── ChildProcess.hx │ │ │ ├── cluster │ │ │ └── Worker.hx │ │ │ ├── console │ │ │ └── Console.hx │ │ │ ├── crypto │ │ │ ├── Certificate.hx │ │ │ ├── Cipher.hx │ │ │ ├── Decipher.hx │ │ │ ├── DiffieHellman.hx │ │ │ ├── ECDH.hx │ │ │ ├── Hash.hx │ │ │ ├── Hmac.hx │ │ │ ├── Sign.hx │ │ │ └── Verify.hx │ │ │ ├── dgram │ │ │ └── Socket.hx │ │ │ ├── domain │ │ │ └── Domain.hx │ │ │ ├── events │ │ │ └── EventEmitter.hx │ │ │ ├── fs │ │ │ ├── FSWatcher.hx │ │ │ ├── ReadStream.hx │ │ │ ├── Stats.hx │ │ │ └── WriteStream.hx │ │ │ ├── http │ │ │ ├── Agent.hx │ │ │ ├── ClientRequest.hx │ │ │ ├── IncomingMessage.hx │ │ │ ├── Method.hx │ │ │ ├── Server.hx │ │ │ └── ServerResponse.hx │ │ │ ├── https │ │ │ ├── Agent.hx │ │ │ └── Server.hx │ │ │ ├── net │ │ │ ├── Server.hx │ │ │ └── Socket.hx │ │ │ ├── readline │ │ │ └── Interface.hx │ │ │ ├── repl │ │ │ └── REPLServer.hx │ │ │ ├── stream │ │ │ ├── Duplex.hx │ │ │ ├── PassThrough.hx │ │ │ ├── Readable.hx │ │ │ ├── Transform.hx │ │ │ └── Writable.hx │ │ │ ├── tls │ │ │ ├── SecureContext.hx │ │ │ ├── SecurePair.hx │ │ │ ├── Server.hx │ │ │ └── TLSSocket.hx │ │ │ ├── tty │ │ │ ├── ReadStream.hx │ │ │ └── WriteStream.hx │ │ │ ├── url │ │ │ ├── URL.hx │ │ │ └── URLSearchParams.hx │ │ │ ├── util │ │ │ ├── Inspect.hx │ │ │ ├── Promisify.hx │ │ │ ├── TextDecoder.hx │ │ │ ├── TextEncoder.hx │ │ │ └── Types.hx │ │ │ ├── vm │ │ │ └── Script.hx │ │ │ └── zlib │ │ │ ├── Deflate.hx │ │ │ ├── DeflateRaw.hx │ │ │ ├── Gunzip.hx │ │ │ ├── Gzip.hx │ │ │ ├── Inflate.hx │ │ │ ├── InflateRaw.hx │ │ │ ├── Unzip.hx │ │ │ └── Zlib.hx │ └── kha │ │ ├── Blob.hx │ │ ├── Display.hx │ │ ├── Font.hx │ │ ├── Image.hx │ │ ├── LoaderImpl.hx │ │ ├── Storage.hx │ │ ├── SystemImpl.hx │ │ ├── Window.hx │ │ ├── arrays │ │ ├── ByteArray.hx │ │ └── ByteBuffer.hx │ │ ├── audio1 │ │ ├── Audio.hx │ │ └── NodeAudioChannel.hx │ │ ├── compute │ │ └── Shader.hx │ │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── IndexBuffer.hx │ │ ├── PipelineState.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ │ └── js │ │ ├── EmptyFont.hx │ │ ├── EmptyGraphics1.hx │ │ ├── EmptyGraphics2.hx │ │ ├── EmptyGraphics4.hx │ │ ├── Mouse.hx │ │ ├── Music.hx │ │ ├── Sound.hx │ │ ├── Video.hx │ │ └── graphics4 │ │ ├── ConstantLocation.hx │ │ └── TextureUnit.hx └── WPF │ ├── kha │ ├── Blob.hx │ ├── Font.hx │ ├── Image.hx │ ├── LoaderImpl.hx │ ├── Storage.hx │ ├── SystemImpl.hx │ ├── audio1 │ │ ├── Audio.hx │ │ ├── WpfAudioChannel.hx │ │ └── WpfMusicChannel.hx │ ├── graphics4 │ │ ├── ComputeShader.hx │ │ ├── CubeMap.hx │ │ ├── FragmentShader.hx │ │ ├── IndexBuffer.hx │ │ ├── PipelineState.hx │ │ ├── ShaderStorageBuffer.hx │ │ ├── VertexBuffer.hx │ │ └── VertexShader.hx │ ├── network │ │ ├── Http.hx │ │ └── Network.hx │ └── wpf │ │ ├── Font.hx │ │ ├── Graphics.hx │ │ ├── Mouse.hx │ │ ├── Music.hx │ │ ├── Painter.hx │ │ ├── Sound.hx │ │ └── Video.hx │ └── system │ ├── Uri.hx │ ├── UriKind.hx │ ├── diagnostics │ └── Stopwatch.hx │ ├── io │ ├── Directory.hx │ ├── DirectoryInfo.hx │ ├── File.hx │ └── Path.hx │ └── windows │ ├── FrameworkElement.hx │ ├── Window.hx │ ├── controls │ ├── Canvas.hx │ ├── MediaElement.hx │ └── MediaState.hx │ ├── input │ ├── Cursor.hx │ ├── Cursors.hx │ └── Mouse.hx │ └── media │ ├── Color.hx │ ├── DrawingContext.hx │ ├── DrawingVisual.hx │ ├── ImageBrush.hx │ ├── ImageSource.hx │ ├── MatrixTransform.hx │ ├── MediaPlayer.hx │ └── imaging │ └── BitmapSource.hx ├── Sources ├── Shaders │ ├── painter-colored.frag.glsl │ ├── painter-colored.vert.glsl │ ├── painter-image.frag.glsl │ ├── painter-image.vert.glsl │ ├── painter-text.frag.glsl │ ├── painter-text.vert.glsl │ ├── painter-video.frag.glsl │ └── painter-video.vert.glsl ├── haxe │ └── Timer.hx └── kha │ ├── AssetError.hx │ ├── Assets.hx │ ├── Blob.hx │ ├── Canvas.hx │ ├── CodeStyle.hx │ ├── Color.hx │ ├── Display.hx │ ├── DisplayMode.hx │ ├── EnvironmentVariables.hx │ ├── FastFloat.hx │ ├── Float32ArrayExtensions.hx │ ├── Font.hx │ ├── FontStyle.hx │ ├── Framebuffer.hx │ ├── FramebufferOptions.hx │ ├── HaxelibRunner.hx │ ├── Image.hx │ ├── Kravur.hx │ ├── Resource.hx │ ├── Rotation.hx │ ├── Scaler.hx │ ├── Scheduler.hx │ ├── ScreenCanvas.hx │ ├── ScreenRotation.hx │ ├── Shaders.hx │ ├── Sound.hx │ ├── StorageFile.hx │ ├── StringExtensions.hx │ ├── System.hx │ ├── Video.hx │ ├── Window.hx │ ├── WindowMode.hx │ ├── WindowOptions.hx │ ├── Worker.hx │ ├── arrays │ ├── ByteArray.hx │ ├── ByteBuffer.hx │ ├── Float32Array.hx │ ├── Float64Array.hx │ ├── Int16Array.hx │ ├── Int32Array.hx │ ├── Int8Array.hx │ ├── Uint16Array.hx │ ├── Uint32Array.hx │ └── Uint8Array.hx │ ├── audio1 │ ├── Audio.hx │ └── AudioChannel.hx │ ├── audio2 │ ├── Audio.hx │ ├── Audio1.hx │ ├── AudioChannel.hx │ ├── Buffer.hx │ ├── ResamplingAudioChannel.hx │ ├── StreamChannel.hx │ └── ogg │ │ ├── tools │ │ ├── Crc32.hx │ │ ├── MathTools.hx │ │ └── Mdct.hx │ │ └── vorbis │ │ ├── Reader.hx │ │ ├── VorbisDecodeState.hx │ │ ├── VorbisDecoder.hx │ │ ├── VorbisTools.hx │ │ └── data │ │ ├── Codebook.hx │ │ ├── Comment.hx │ │ ├── Floor.hx │ │ ├── Header.hx │ │ ├── IntPoint.hx │ │ ├── Mapping.hx │ │ ├── Mode.hx │ │ ├── Page.hx │ │ ├── ProbedPage.hx │ │ ├── ReaderError.hx │ │ ├── Residue.hx │ │ └── Setting.hx │ ├── capture │ ├── AudioCapture.hx │ └── VideoCapture.hx │ ├── deprecated │ └── Painter.hx │ ├── graphics1 │ ├── Graphics.hx │ └── Graphics4.hx │ ├── graphics2 │ ├── Graphics.hx │ ├── Graphics1.hx │ ├── GraphicsExtension.hx │ ├── HorTextAlignment.hx │ ├── ImageScaleQuality.hx │ ├── VerTextAlignment.hx │ └── truetype │ │ ├── StbTruetype.hx │ │ └── stb_truetype.h │ ├── graphics4 │ ├── BlendingFactor.hx │ ├── BlendingOperation.hx │ ├── CompareMode.hx │ ├── ComputeShader.hx │ ├── ConstantLocation.hx │ ├── CubeMap.hx │ ├── CullMode.hx │ ├── DepthStencilFormat.hx │ ├── FragmentShader.hx │ ├── GeometryShader.hx │ ├── Graphics.hx │ ├── Graphics2.hx │ ├── IndexBuffer.hx │ ├── MipMapFilter.hx │ ├── PipelineState.hx │ ├── PipelineStateBase.hx │ ├── ShaderStorageBuffer.hx │ ├── StencilAction.hx │ ├── StencilValue.hx │ ├── TessellationControlShader.hx │ ├── TessellationEvaluationShader.hx │ ├── TexDir.hx │ ├── TextureAddressing.hx │ ├── TextureFilter.hx │ ├── TextureFormat.hx │ ├── TextureUnit.hx │ ├── Usage.hx │ ├── VertexBuffer.hx │ ├── VertexData.hx │ ├── VertexElement.hx │ ├── VertexShader.hx │ └── VertexStructure.hx │ ├── graphics5_ │ ├── AccelerationStructure.hx │ ├── BlendingFactor.hx │ ├── BlendingOperation.hx │ ├── CommandList.hx │ ├── CompareMode.hx │ ├── ConstantBuffer.hx │ ├── ConstantLocation.hx │ ├── CubeMap.hx │ ├── CullMode.hx │ ├── FragmentShader.hx │ ├── GeometryShader.hx │ ├── Graphics.hx │ ├── IndexBuffer.hx │ ├── MipMapFilter.hx │ ├── PipelineState.hx │ ├── PipelineStateBase.hx │ ├── RenderTarget.hx │ ├── StencilAction.hx │ ├── TessellationControlShader.hx │ ├── TessellationEvaluationShader.hx │ ├── TextureAddressing.hx │ ├── TextureFilter.hx │ ├── TextureFormat.hx │ ├── TextureUnit.hx │ ├── Usage.hx │ ├── VertexBuffer.hx │ ├── VertexData.hx │ ├── VertexElement.hx │ ├── VertexShader.hx │ └── VertexStructure.hx │ ├── input │ ├── Gamepad.hx │ ├── KeyCode.hx │ ├── Keyboard.hx │ ├── Mouse.hx │ ├── Pen.hx │ ├── Sensor.hx │ ├── SensorType.hx │ └── Surface.hx │ ├── internal │ ├── AssetErrorCallback.hx │ ├── AssetsBuilder.hx │ ├── BytesBlob.hx │ ├── HdrFormat.hx │ ├── IntBox.hx │ ├── IntCallback.hx │ ├── ShadersBuilder.hx │ └── VoidCallback.hx │ ├── math │ ├── FastMatrix2.hx │ ├── FastMatrix3.hx │ ├── FastMatrix4.hx │ ├── FastVector2.hx │ ├── FastVector3.hx │ ├── FastVector4.hx │ ├── Matrix2.hx │ ├── Matrix3.hx │ ├── Matrix4.hx │ ├── Quaternion.hx │ ├── Random.hx │ ├── Vector2.hx │ ├── Vector2i.hx │ ├── Vector3.hx │ └── Vector4.hx │ ├── netsync │ ├── Client.hx │ ├── Controller.hx │ ├── ControllerBuilder.hx │ ├── Entity.hx │ ├── EntityBuilder.hx │ ├── Example.hx │ ├── LocalClient.hx │ ├── Network.hx │ ├── NodeProcessClient.hx │ ├── Server.hx │ ├── Session.hx │ ├── Sync.hx │ ├── SyncBuilder.hx │ ├── UdpClient.hx │ └── WebSocketClient.hx │ ├── network │ ├── Http.hx │ └── HttpMethod.hx │ ├── simd │ └── Float32x4.hx │ └── vr │ ├── Pose.hx │ ├── PoseState.hx │ ├── SensorState.hx │ ├── TimeWarpImage.hx │ ├── TimeWarpParms.hx │ ├── VrInterface.hx │ └── VrInterfaceEmulated.hx ├── Tests ├── Empty │ ├── Sources │ │ └── Main.hx │ └── khafile.js └── Gamepads │ ├── configure-msvc2010-opengl.cmd │ ├── khafile.js │ └── src │ ├── AnalogPadDisplay.hx │ ├── DigitalPadDisplay.hx │ └── Main.hx ├── Tools └── platform.sh ├── checkstyle-exclude.json ├── checkstyle.bat ├── checkstyle.json ├── get_dlc ├── get_dlc.bat ├── get_dlc_dangerously ├── get_dlc_dangerously.bat ├── hxformat.json ├── license.txt ├── make.bat ├── make.js ├── make.sh ├── readme.md └── updates.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * -text 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Execution Environment:** 27 | - Host system (where you compile your code): 28 | - Target system (where you run your code): 29 | - IDE used (if any): 30 | - Kha revision: 31 | - Kha build output (Using Kha...): 32 | - Application output (if it runs): 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | github: RobDangerous 2 | patreon: RobDangerous 3 | -------------------------------------------------------------------------------- /.github/workflows/android-opengl.yml: -------------------------------------------------------------------------------- 1 | name: Android (OpenGL) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-java@v3 19 | with: 20 | distribution: 'oracle' 21 | java-version: '17' 22 | - name: Get DLC 23 | run: ./get_dlc 24 | - name: Get Node.js 25 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 26 | - name: Setup Node.js 27 | run: nodejs_bin/copysysbin.sh 28 | - name: Compile 29 | run: nodejs_bin/node make.js android -g opengl --kha . --from Tests/Empty --arch arm8 --compile 30 | -------------------------------------------------------------------------------- /.github/workflows/android-vulkan.yml: -------------------------------------------------------------------------------- 1 | name: Android (Vulkan) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-java@v3 19 | with: 20 | distribution: 'oracle' 21 | java-version: '17' 22 | - name: Get DLC 23 | run: ./get_dlc 24 | - name: Get Node.js 25 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 26 | - name: Setup Node.js 27 | run: nodejs_bin/copysysbin.sh 28 | - name: Compile 29 | run: nodejs_bin/node make.js android -g vulkan --kha . --from Tests/Empty --arch arm8 --compile 30 | -------------------------------------------------------------------------------- /.github/workflows/html5.yml: -------------------------------------------------------------------------------- 1 | name: HTML5 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js html5 --kha . --from Tests/Empty 26 | -------------------------------------------------------------------------------- /.github/workflows/html5worker.yml: -------------------------------------------------------------------------------- 1 | name: HTML5 Worker 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js html5worker --kha . --from Tests/Empty 26 | -------------------------------------------------------------------------------- /.github/workflows/ios-metal.yml: -------------------------------------------------------------------------------- 1 | name: iOS (Metal) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: macOS-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js ios -g metal --kha . --from Tests/Empty --nosigning --compile 26 | -------------------------------------------------------------------------------- /.github/workflows/ios-opengl.yml: -------------------------------------------------------------------------------- 1 | name: iOS (OpenGL) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: macOS-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js ios -g opengl --kha . --from Tests/Empty --nosigning --compile 26 | -------------------------------------------------------------------------------- /.github/workflows/java.yml: -------------------------------------------------------------------------------- 1 | name: Java 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js java --kha . --from Tests/Empty 26 | -------------------------------------------------------------------------------- /.github/workflows/krom.yml: -------------------------------------------------------------------------------- 1 | name: Krom 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js krom --kha . --from Tests/Empty 26 | -------------------------------------------------------------------------------- /.github/workflows/linux-hl-opengl.yml: -------------------------------------------------------------------------------- 1 | name: Linux (HL, OpenGL) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Apt Update 19 | run: sudo apt-get update 20 | - name: Apt Install 21 | run: sudo apt-get install libasound2-dev libxinerama-dev libxrandr-dev libgl1-mesa-dev libxi-dev libxcursor-dev libudev-dev libwayland-dev wayland-protocols libxkbcommon-dev ninja-build --yes --quiet 22 | - name: Get DLC 23 | run: ./get_dlc 24 | - name: Get Node.js 25 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 26 | - name: Setup Node.js 27 | run: nodejs_bin/copysysbin.sh 28 | - name: Compile 29 | run: nodejs_bin/node make.js linux-hl -g opengl --kha . --from Tests/Empty --compile 30 | -------------------------------------------------------------------------------- /.github/workflows/linux-opengl.yml: -------------------------------------------------------------------------------- 1 | name: Linux (OpenGL) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Apt Update 19 | run: sudo apt-get update 20 | - name: Apt Install 21 | run: sudo apt-get install libasound2-dev libxinerama-dev libxrandr-dev libgl1-mesa-dev libxi-dev libxcursor-dev libudev-dev libwayland-dev wayland-protocols libxkbcommon-dev ninja-build --yes --quiet 22 | - name: Get DLC 23 | run: ./get_dlc 24 | - name: Get Node.js 25 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 26 | - name: Setup Node.js 27 | run: nodejs_bin/copysysbin.sh 28 | - name: Compile 29 | run: nodejs_bin/node make.js -g opengl --kha . --from Tests/Empty --compile 30 | -------------------------------------------------------------------------------- /.github/workflows/macos-hl-metal.yml: -------------------------------------------------------------------------------- 1 | name: macOS (HL, Metal) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: macOS-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js osx-hl -g metal --kha . --from Tests/Empty --compile 26 | -------------------------------------------------------------------------------- /.github/workflows/macos-metal.yml: -------------------------------------------------------------------------------- 1 | name: macOS (Metal) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: macOS-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js -g metal --kha . --from Tests/Empty --compile 26 | -------------------------------------------------------------------------------- /.github/workflows/macos-opengl.yml: -------------------------------------------------------------------------------- 1 | name: macOS (OpenGL) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: macOS-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js -g opengl --kha . --from Tests/Empty --compile 26 | -------------------------------------------------------------------------------- /.github/workflows/node.yml: -------------------------------------------------------------------------------- 1 | name: Node.js 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: ./get_dlc 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Setup Node.js 23 | run: nodejs_bin/copysysbin.sh 24 | - name: Compile 25 | run: nodejs_bin/node make.js node --kha . --from Tests/Empty 26 | -------------------------------------------------------------------------------- /.github/workflows/uwp.yml: -------------------------------------------------------------------------------- 1 | name: UWP 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: .\get_dlc.bat 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Compile 23 | run: .\nodejs_bin\node.exe make.js windowsapp -v vs2022 --kha . --from Tests/Empty --compile 24 | -------------------------------------------------------------------------------- /.github/workflows/windows-direct3d11.yml: -------------------------------------------------------------------------------- 1 | name: Windows (Direct3D 11) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: .\get_dlc.bat 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Compile 23 | run: .\nodejs_bin\node.exe make.js -v vs2022 -g direct3d11 --kha . --from Tests/Empty --compile 24 | -------------------------------------------------------------------------------- /.github/workflows/windows-direct3d12.yml: -------------------------------------------------------------------------------- 1 | name: Windows (Direct3D 12) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: .\get_dlc.bat 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Compile 23 | run: .\nodejs_bin\node.exe make.js -v vs2022 -g direct3d12 --kha . --from Tests/Empty --compile 24 | -------------------------------------------------------------------------------- /.github/workflows/windows-hl-direct3d11.yml: -------------------------------------------------------------------------------- 1 | name: Windows (HL, Direct3D 11) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: .\get_dlc.bat 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Compile 23 | run: .\nodejs_bin\node.exe make.js windows-hl -v vs2022 -g direct3d11 --kha . --from Tests/Empty --compile 24 | -------------------------------------------------------------------------------- /.github/workflows/windows-opengl.yml: -------------------------------------------------------------------------------- 1 | name: Windows (OpenGL) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: .\get_dlc.bat 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Compile 23 | run: .\nodejs_bin\node.exe make.js -v vs2022 -g opengl --kha . --from Tests/Empty --compile 24 | -------------------------------------------------------------------------------- /.github/workflows/windows-vulkan.yml: -------------------------------------------------------------------------------- 1 | name: Windows (Vulkan) 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Setup Vulkan 19 | run: | 20 | Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.275.0/windows/VulkanSDK-1.3.275.0-Installer.exe" -OutFile VulkanSDK.exe 21 | $installer = Start-Process -FilePath VulkanSDK.exe -Wait -PassThru -ArgumentList @("--da", "--al", "-c", "in"); 22 | $installer.WaitForExit(); 23 | - name: Get DLC 24 | run: .\get_dlc.bat 25 | - name: Get Node.js 26 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 27 | - name: Compile 28 | run: .\nodejs_bin\node.exe make.js -v vs2022 -g vulkan --kha . --from Tests/Empty --compile 29 | env: 30 | VULKAN_SDK: C:\VulkanSDK\1.3.275.0 31 | -------------------------------------------------------------------------------- /.github/workflows/wpf.yml: -------------------------------------------------------------------------------- 1 | name: WPF 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | - name: Get DLC 19 | run: .\get_dlc.bat 20 | - name: Get Node.js 21 | run: git clone https://github.com/Kode/nodejs_bin.git --depth 1 22 | - name: Compile 23 | run: .\nodejs_bin\node.exe make.js wpf --kha . --from Tests/Empty 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /build 3 | /Tests/Empty/korefile.js 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Tools/khamake"] 2 | path = Tools/khamake 3 | url = https://github.com/Kode/khamake.git 4 | branch = main 5 | [submodule "Backends/Kore-hxcpp/khacpp"] 6 | path = Backends/Kore-hxcpp/khacpp 7 | url = https://github.com/Kode/khacpp.git 8 | branch = main 9 | [submodule "Kore"] 10 | path = Kore 11 | url = https://github.com/Kode/Kore.git 12 | branch = v2 13 | [submodule "Tools/linux_x64"] 14 | path = Tools/linux_x64 15 | url = https://github.com/Kode/KhaTools_linux_x64.git 16 | branch = main 17 | shallow = true 18 | [submodule "Tools/linux_arm64"] 19 | path = Tools/linux_arm64 20 | url = https://github.com/Kode/KhaTools_linux_arm64.git 21 | branch = main 22 | shallow = true 23 | [submodule "Tools/macos"] 24 | path = Tools/macos 25 | url = https://github.com/Kode/KhaTools_macos.git 26 | branch = main 27 | shallow = true 28 | [submodule "Tools/windows_x64"] 29 | path = Tools/windows_x64 30 | url = https://github.com/Kode/KhaTools_windows_x64.git 31 | branch = main 32 | shallow = true 33 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[haxe]": { 3 | "editor.formatOnSave": true, 4 | "editor.formatOnPaste": false 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /Backends/Empty/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/Empty/kha/DisplayImpl.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class DisplayImpl { 4 | public static function count(): Int { 5 | return 1; 6 | } 7 | 8 | public static function width(index: Int): Int { 9 | return -1; 10 | } 11 | 12 | public static function height(index: Int): Int { 13 | return -1; 14 | } 15 | 16 | public static function x(index: Int): Int { 17 | return -1; 18 | } 19 | 20 | public static function y(index: Int): Int { 21 | return -1; 22 | } 23 | 24 | public static function isPrimary(index: Int): Bool { 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/Empty/kha/EnvironmentVariables.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class EnvironmentVariables { 4 | public static function get(name: String): String { 5 | return null; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Empty/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/Empty/kha/LoaderImpl.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import kha.FontStyle; 4 | import kha.Blob; 5 | import kha.Kravur; 6 | import haxe.io.Bytes; 7 | import haxe.io.BytesData; 8 | 9 | class LoaderImpl { 10 | public static function getImageFormats(): Array { 11 | return ["png", "jpg"]; 12 | } 13 | 14 | public static function loadImageFromDescription(desc: Dynamic, done: kha.Image->Void, failed: AssetError->Void) {} 15 | 16 | public static function getSoundFormats(): Array { 17 | return ["mp4", "ogg"]; 18 | } 19 | 20 | public static function loadSoundFromDescription(desc: Dynamic, done: kha.Sound->Void, failed: AssetError->Void) {} 21 | 22 | public static function getVideoFormats(): Array { 23 | return ["mp4", "webm"]; 24 | } 25 | 26 | public static function loadVideoFromDescription(desc: Dynamic, done: kha.Video->Void, failed: AssetError->Void): Void {} 27 | 28 | public static function loadBlobFromDescription(desc: Dynamic, done: Blob->Void, failed: AssetError->Void) {} 29 | 30 | public static function loadFontFromDescription(desc: Dynamic, done: Font->Void, failed: AssetError->Void): Void {} 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Empty/kha/Storage.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.io.Bytes; 4 | import haxe.io.BytesBuffer; 5 | import haxe.io.BytesData; 6 | 7 | class Storage { 8 | public static function namedFile(name: String): StorageFile { 9 | return null; 10 | } 11 | 12 | public static function defaultFile(): StorageFile { 13 | return namedFile("default.kha"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Backends/Empty/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | class ByteBuffer { 4 | public static function create(length: Int): ByteBuffer { 5 | return null; 6 | } 7 | 8 | function new(length: Int) {} 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Empty/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | import kha.Sound; 4 | 5 | class Audio { 6 | /** 7 | * Plays a sound immediately. 8 | * @param sound 9 | * The sound to play 10 | * @param loop 11 | * Whether or not to automatically loop the sound 12 | * @return A channel object that can be used to control the playing sound. Please be a ware that Null is returned when the maximum number of simultaneously played channels was reached. 13 | */ 14 | public static function play(sound: Sound, loop: Bool = false): AudioChannel { 15 | return null; 16 | } 17 | 18 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 19 | return null; 20 | } 21 | 22 | public static function _playAgain(channel: kha.audio2.AudioChannel): Void {} 23 | } 24 | -------------------------------------------------------------------------------- /Backends/Empty/kha/audio2/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2; 2 | 3 | import kha.Sound; 4 | import kha.internal.IntBox; 5 | 6 | class Audio { 7 | public static var disableGcInteractions = false; 8 | public static var samplesPerSecond: Int; 9 | public static var audioCallback: IntBox->Buffer->Void; 10 | 11 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 12 | return null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class CubeMap implements Canvas implements Resource { 6 | public static function createRenderTarget(size: Int, format: TextureFormat = null, depthStencil: DepthStencilFormat = null): CubeMap { 7 | return null; 8 | } 9 | 10 | public function unload(): Void {} 11 | 12 | public function lock(level: Int = 0): Bytes { 13 | return null; 14 | } 15 | 16 | public function unlock(): Void {} 17 | 18 | public var width(get, never): Int; 19 | 20 | function get_width(): Int { 21 | return 0; 22 | } 23 | 24 | public var height(get, never): Int; 25 | 26 | function get_height(): Int { 27 | return 0; 28 | } 29 | 30 | public var g1(get, never): kha.graphics1.Graphics; 31 | 32 | function get_g1(): kha.graphics1.Graphics { 33 | return null; 34 | } 35 | 36 | public var g2(get, never): kha.graphics2.Graphics; 37 | 38 | function get_g2(): kha.graphics2.Graphics { 39 | return null; 40 | } 41 | 42 | public var g4(get, never): kha.graphics4.Graphics; 43 | 44 | function get_g4(): kha.graphics4.Graphics { 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class FragmentShader { 4 | public var sources: Array; 5 | public var type: Dynamic; 6 | public var shader: Dynamic; 7 | public var files: Array; 8 | 9 | public function new(sources: Array, files: Array) {} 10 | 11 | public static function fromSource(source: String): FragmentShader { 12 | return null; 13 | } 14 | 15 | public function delete(): Void { 16 | shader = null; 17 | sources = null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.graphics4.Usage; 4 | 5 | class IndexBuffer { 6 | public function new(indexCount: Int, usage: Usage, canRead: Bool = false) {} 7 | 8 | public function lock(?start: Int, ?count: Int): Array { 9 | return null; 10 | } 11 | 12 | public function unlock(?count: Int): Void {} 13 | 14 | public function set(): Void {} 15 | 16 | public function count(): Int { 17 | return 0; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/PipelineState.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.graphics4.FragmentShader; 4 | import kha.graphics4.VertexData; 5 | import kha.graphics4.VertexShader; 6 | import kha.graphics4.VertexStructure; 7 | 8 | class PipelineState extends PipelineStateBase { 9 | public function new() { 10 | super(); 11 | } 12 | 13 | public function compile(): Void {} 14 | 15 | public function set(): Void {} 16 | 17 | public function getConstantLocation(name: String): kha.graphics4.ConstantLocation { 18 | return null; 19 | } 20 | 21 | public function getTextureUnit(name: String): kha.graphics4.TextureUnit { 22 | return null; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/VertexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.arrays.Float32Array; 4 | import kha.graphics4.Usage; 5 | import kha.graphics4.VertexStructure; 6 | import kha.graphics4.VertexData; 7 | 8 | class VertexBuffer { 9 | public function new(vertexCount: Int, structure: VertexStructure, usage: Usage, instanceDataStepRate: Int = 0, canRead: Bool = false) {} 10 | 11 | public function lock(?start: Int, ?count: Int): Float32Array { 12 | return null; 13 | } 14 | 15 | public function unlock(?count: Int): Void {} 16 | 17 | public function stride(): Int { 18 | return 0; 19 | } 20 | 21 | public function count(): Int { 22 | return 0; 23 | } 24 | 25 | public function set(offset: Int): Int { 26 | return 0; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Backends/Empty/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class VertexShader { 4 | public var sources: Array; 5 | public var type: Dynamic; 6 | public var shader: Dynamic; 7 | public var files: Array; 8 | 9 | public function new(sources: Array, files: Array) {} 10 | 11 | public static function fromSource(source: String): FragmentShader { 12 | return null; 13 | } 14 | 15 | public function delete(): Void { 16 | shader = null; 17 | sources = null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Empty/kha/input/MouseImpl.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | class MouseImpl extends kha.input.Mouse { 4 | public function new() { 5 | super(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Empty/kha/netsync/Network.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Network { 6 | public function new(url: String, port: Int, errorCallback: Void->Void, closeCallback: Void->Void) {} 7 | 8 | public function send(bytes: Bytes, mandatory: Bool): Void {} 9 | 10 | public function listen(listener: Bytes->Void): Void {} 11 | } 12 | -------------------------------------------------------------------------------- /Backends/Empty/kha/network/Http.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Http { 6 | public static function request(url: String, path: String, data: String, port: Int, secure: Bool, method: HttpMethod, headers: Map, 7 | callback: Int->Int->String->Void /*error, response, body*/): Void {} 8 | } 9 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/Storage.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.io.Bytes; 4 | import haxe.io.BytesData; 5 | import js.lib.ArrayBuffer; 6 | 7 | class Storage { 8 | public static function namedFile(name: String): StorageFile { 9 | return null; 10 | } 11 | 12 | public static function defaultFile(): StorageFile { 13 | return namedFile("default.kha"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/Worker.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class Worker { 4 | public static function postMessage(m: Dynamic): Void { 5 | try { 6 | js.Syntax.code("self.postMessage(m)"); 7 | } 8 | catch (e:Dynamic) { 9 | trace(e); 10 | } 11 | } 12 | 13 | public static function handleMessages(messageHandler: Dynamic->Void) { 14 | untyped js.Syntax.code("self.onmessage = messageHandler"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import js.lib.ArrayBuffer; 4 | 5 | @:forward 6 | abstract ByteBuffer(ArrayBuffer) from ArrayBuffer to ArrayBuffer { 7 | public static function create(length: Int): ByteBuffer { 8 | return new ByteBuffer(length); 9 | } 10 | 11 | function new(length: Int) { 12 | this = new ArrayBuffer(length); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | class Audio { 4 | public static function play(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 5 | Worker.postMessage({command: 'playSound', id: cast(sound, kha.html5worker.Sound)._id, loop: loop}); 6 | return null; 7 | } 8 | 9 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 10 | Worker.postMessage({command: 'streamSound', id: cast(sound, kha.html5worker.Sound)._id, loop: loop}); 11 | return null; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/audio2/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2; 2 | 3 | import kha.Sound; 4 | 5 | class Audio { 6 | public static var disableGcInteractions = false; 7 | public static var samplesPerSecond: Int; 8 | public static var audioCallback: Int->Buffer->Void; 9 | 10 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 11 | return null; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/graphics4/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class CubeMap implements Canvas implements Resource { 6 | public static function createRenderTarget(size: Int, format: TextureFormat, depthStencil: DepthStencilFormat = NoDepthAndStencil): CubeMap { 7 | return null; 8 | } 9 | 10 | public function unload(): Void {} 11 | 12 | public function lock(level: Int = 0): Bytes { 13 | return null; 14 | } 15 | 16 | public function unlock(): Void {} 17 | 18 | public var width(get, never): Int; 19 | public var height(get, never): Int; 20 | 21 | function get_width(): Int { 22 | return 512; 23 | } 24 | 25 | function get_height(): Int { 26 | return 512; 27 | } 28 | 29 | public var g1(get, never): kha.graphics1.Graphics; 30 | public var g2(get, never): kha.graphics2.Graphics; 31 | public var g4(get, never): kha.graphics4.Graphics; 32 | 33 | function get_g1(): kha.graphics1.Graphics { 34 | return null; 35 | } 36 | 37 | function get_g2(): kha.graphics2.Graphics { 38 | return null; 39 | } 40 | 41 | function get_g4(): kha.graphics4.Graphics { 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class FragmentShader { 4 | public var sources: Array; 5 | public var shader: Dynamic; 6 | public var files: Array; 7 | 8 | public function new(sources: Array, files: Array) { 9 | this.sources = []; 10 | for (source in sources) { 11 | this.sources.push(source.toString()); 12 | } 13 | this.shader = null; 14 | this.files = files; 15 | } 16 | 17 | public static function fromSource(source: String): FragmentShader { 18 | var shader = new FragmentShader([], ["runtime-string"]); 19 | shader.sources.push(source); 20 | return shader; 21 | } 22 | 23 | public function delete(): Void { 24 | shader = null; 25 | sources = null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class VertexShader { 4 | public var sources: Array; 5 | public var shader: Dynamic; 6 | public var files: Array; 7 | 8 | public function new(sources: Array, files: Array) { 9 | this.sources = []; 10 | for (source in sources) { 11 | this.sources.push(source.toString()); 12 | } 13 | this.shader = null; 14 | this.files = files; 15 | } 16 | 17 | public static function fromSource(source: String): VertexShader { 18 | var shader = new VertexShader([], ["runtime-string"]); 19 | shader.sources.push(source); 20 | return shader; 21 | } 22 | 23 | public function delete(): Void { 24 | shader = null; 25 | sources = null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/html5worker/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.html5worker; 2 | 3 | class ConstantLocation implements kha.graphics4.ConstantLocation { 4 | static var lastId: Int = -1; 5 | 6 | public var _id: Int; 7 | 8 | public function new() { 9 | _id = ++lastId; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/html5worker/Sound.hx: -------------------------------------------------------------------------------- 1 | package kha.html5worker; 2 | 3 | import haxe.io.Bytes; 4 | import haxe.ds.Vector; 5 | 6 | class Sound extends kha.Sound { 7 | public var _id: Int; 8 | public var _callback: Void->Void; 9 | 10 | public function new(id: Int) { 11 | super(); 12 | this._id = id; 13 | } 14 | 15 | override public function uncompress(done: Void->Void): Void { 16 | compressedData = null; 17 | Worker.postMessage({command: 'uncompressSound', id: _id}); 18 | _callback = done; 19 | } 20 | 21 | override public function unload() { 22 | compressedData = null; 23 | uncompressedData = null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Backends/HTML5-Worker/kha/html5worker/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.html5worker; 2 | 3 | class TextureUnit implements kha.graphics4.TextureUnit { 4 | static var lastId: Int = -1; 5 | 6 | public var _id: Int; 7 | 8 | public function new() { 9 | _id = ++lastId; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/EnvironmentVariables.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import js.Browser; 4 | 5 | class EnvironmentVariables { 6 | public static function get(name: String): String { 7 | try { 8 | var query = Browser.location.href.substr(Browser.location.href.indexOf("?") + 1); 9 | var parts = query.split("&"); 10 | 11 | for (part in parts) { 12 | var subparts = part.split("="); 13 | if (subparts[0] == name) { 14 | return subparts[1]; 15 | } 16 | } 17 | 18 | return null; 19 | } 20 | catch (error:Dynamic) { 21 | return null; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/Macros.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.macro.Context; 4 | import haxe.macro.Expr; 5 | 6 | class Macros { 7 | public static macro function canvasId(): Expr { 8 | return { 9 | expr: EConst(CString(Context.getDefines().get("canvas_id"))), 10 | pos: Context.currentPos() 11 | }; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import js.lib.ArrayBuffer; 4 | 5 | @:forward 6 | abstract ByteBuffer(ArrayBuffer) from ArrayBuffer to ArrayBuffer { 7 | public static function create(length: Int): ByteBuffer { 8 | return new ByteBuffer(length); 9 | } 10 | 11 | function new(length: Int) { 12 | this = new ArrayBuffer(length); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | typedef Audio = kha.audio2.Audio1; 4 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/capture/VideoCapture.hx: -------------------------------------------------------------------------------- 1 | package kha.capture; 2 | 3 | import js.Browser; 4 | 5 | class VideoCapture { 6 | public static function init(initialized: kha.Video->Void, error: Void->Void): Void { 7 | var getUserMedia = untyped __js__("navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia"); 8 | getUserMedia.call(js.Browser.navigator, {audio: true, video: true}, function(stream: Dynamic) { 9 | var element: js.html.VideoElement = cast Browser.document.createElement("video"); 10 | element.srcObject = stream; 11 | element.onloadedmetadata = function(e) { 12 | initialized(kha.js.Video.fromElement(element)); 13 | } 14 | }, function() { 15 | error(); 16 | }); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import js.html.webgl.GL; 4 | 5 | class FragmentShader { 6 | public var sources: Array; 7 | public var type: Dynamic; 8 | public var shader: Dynamic; 9 | public var files: Array; 10 | 11 | public function new(sources: Array, files: Array) { 12 | this.sources = []; 13 | for (source in sources) { 14 | this.sources.push(source.toString()); 15 | } 16 | this.type = GL.FRAGMENT_SHADER; 17 | this.shader = null; 18 | this.files = files; 19 | } 20 | 21 | public static function fromSource(source: String): FragmentShader { 22 | var shader = new FragmentShader([], ["runtime-string"]); 23 | shader.sources.push(source); 24 | return shader; 25 | } 26 | 27 | public function delete(): Void { 28 | SystemImpl.gl.deleteShader(shader); 29 | shader = null; 30 | sources = null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import js.html.webgl.GL; 4 | 5 | class VertexShader { 6 | public var sources: Array; 7 | public var type: Dynamic; 8 | public var shader: Dynamic; 9 | public var files: Array; 10 | 11 | public function new(sources: Array, files: Array) { 12 | this.sources = []; 13 | for (source in sources) { 14 | this.sources.push(source.toString()); 15 | } 16 | this.type = GL.VERTEX_SHADER; 17 | this.shader = null; 18 | this.files = files; 19 | } 20 | 21 | public static function fromSource(source: String): VertexShader { 22 | var shader = new VertexShader([], ["runtime-string"]); 23 | shader.sources.push(source); 24 | return shader; 25 | } 26 | 27 | public function delete(): Void { 28 | SystemImpl.gl.deleteShader(shader); 29 | shader = null; 30 | sources = null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/input/Sensor.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | import kha.SystemImpl; 4 | 5 | class Sensor { 6 | static var isInited: Bool = false; 7 | static var accelerometer: Sensor = new Sensor(); 8 | static var gyroscope: Sensor = new Sensor(); 9 | 10 | var listeners: ArrayFloat->Float->Void> = new Array(); 11 | 12 | public static function get(type: SensorType): Sensor { 13 | switch (type) { 14 | case Accelerometer: 15 | return accelerometer; 16 | case Gyroscope: 17 | return gyroscope; 18 | } 19 | } 20 | 21 | public function notify(listener: Float->Float->Float->Void): Void { 22 | if (!isInited) { 23 | SystemImpl.initSensor(); 24 | isInited = true; 25 | } 26 | listeners.push(listener); 27 | } 28 | 29 | function new() {} 30 | 31 | public static function _changed(type: Int, x: Float, y: Float, z: Float): Void { 32 | var sensor = get(type == 0 ? SensorType.Accelerometer : SensorType.Gyroscope); 33 | for (listener in sensor.listeners) { 34 | listener(x, y, z); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/js/AudioElementAudio.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | @:keep 4 | class AudioElementAudio { 5 | public static function play(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 6 | return stream(sound, loop); 7 | } 8 | 9 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 10 | sound.element.loop = loop; 11 | var channel = new AEAudioChannel(sound.element, loop); 12 | channel.play(); 13 | return cast channel; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/js/MobileWebAudio.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | import js.Syntax; 4 | import js.html.audio.AudioContext; 5 | 6 | @:keep 7 | class MobileWebAudio { 8 | @:noCompletion public static var _context: AudioContext; 9 | 10 | @:noCompletion public static function _init(): Void { 11 | try { 12 | _context = new AudioContext(); 13 | return; 14 | } 15 | catch (e:Dynamic) {} 16 | try { 17 | Syntax.code("this._context = new webkitAudioContext();"); 18 | return; 19 | } 20 | catch (e:Dynamic) {} 21 | } 22 | 23 | public static function play(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 24 | var channel = new MobileWebAudioChannel(cast sound, loop); 25 | channel.play(); 26 | return channel; 27 | } 28 | 29 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 30 | return play(sound, loop); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/js/MobileWebAudioSound.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | import haxe.io.Bytes; 4 | import js.html.XMLHttpRequest; 5 | 6 | class MobileWebAudioSound extends kha.Sound { 7 | public var _buffer: Dynamic; 8 | 9 | public function new(filename: String, done: kha.Sound->Void, failed: AssetError->Void) { 10 | super(); 11 | var request = untyped new XMLHttpRequest(); 12 | request.open("GET", filename, true); 13 | request.responseType = "arraybuffer"; 14 | 15 | request.onerror = function() { 16 | failed({url: filename}); 17 | }; 18 | 19 | request.onload = function() { 20 | compressedData = Bytes.ofData(request.response); 21 | uncompressedData = null; 22 | MobileWebAudio._context.decodeAudioData(compressedData.getData(), function(buffer) { 23 | length = buffer.duration; 24 | channels = buffer.numberOfChannels; 25 | _buffer = buffer; 26 | done(this); 27 | }, function() { 28 | failed({url: filename, error: "Audio format not supported"}); 29 | }); 30 | }; 31 | request.send(null); 32 | } 33 | 34 | override public function uncompress(done: Void->Void): Void { 35 | done(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/js/graphics4/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.js.graphics4; 2 | 3 | class ConstantLocation implements kha.graphics4.ConstantLocation { 4 | public var value: Dynamic; 5 | public var type: Int; 6 | 7 | public function new(value: Dynamic, type: Int) { 8 | this.value = value; 9 | this.type = type; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/js/graphics4/Graphics2.hx: -------------------------------------------------------------------------------- 1 | package kha.js.graphics4; 2 | 3 | import js.html.webgl.GL; 4 | import kha.Color; 5 | 6 | class Graphics2 extends kha.graphics4.Graphics2 { 7 | public function new(canvas: Canvas) { 8 | super(canvas); 9 | } 10 | 11 | override public function drawVideoInternal(video: kha.Video, x: Float, y: Float, width: Float, height: Float): Void { 12 | var v = cast(video, Video); 13 | drawScaledSubImage(v.texture, 0, 0, v.texture.width, v.texture.height, x, y, width, height); 14 | } 15 | 16 | override public function begin(clear: Bool = true, clearColor: Color = null): Void { 17 | SystemImpl.gl.colorMask(true, true, true, true); 18 | 19 | // Disable depth test so that everything is just overpainted as determined by the order of function calls2 20 | SystemImpl.gl.disable(GL.DEPTH_TEST); 21 | SystemImpl.gl.depthFunc(GL.ALWAYS); 22 | 23 | super.begin(clear, clearColor); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Backends/HTML5/kha/js/graphics4/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.js.graphics4; 2 | 3 | class TextureUnit implements kha.graphics4.TextureUnit { 4 | public var value: Int; 5 | 6 | public function new(value: Int) { 7 | this.value = value; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Java/java/lang/Runnable.hx: -------------------------------------------------------------------------------- 1 | package java.lang; 2 | 3 | extern interface Runnable { 4 | function run(): Void; 5 | } 6 | -------------------------------------------------------------------------------- /Backends/Java/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/Java/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.java.Font; 4 | -------------------------------------------------------------------------------- /Backends/Java/kha/arrays/Float32Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import java.NativeArray; 4 | 5 | abstract Float32Array(NativeArray) { 6 | public inline function new(elements: Int) { 7 | this = new NativeArray(elements); 8 | } 9 | 10 | public var length(get, never): Int; 11 | 12 | inline function get_length(): Int { 13 | return this.length; 14 | } 15 | 16 | @:arrayAccess 17 | public function set(index: Int, value: FastFloat): FastFloat { 18 | this[index] = value; 19 | return value; 20 | } 21 | 22 | @:arrayAccess 23 | public inline function get(index: Int): FastFloat { 24 | return this[index]; 25 | } 26 | 27 | public inline function data(): NativeArray { 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Backends/Java/kha/arrays/Int16Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import java.NativeArray; 4 | 5 | abstract Int16Array(NativeArray) { 6 | public inline function new(elements: Int) { 7 | this = new NativeArray(elements); 8 | } 9 | 10 | public var length(get, never): Int; 11 | 12 | inline function get_length(): Int { 13 | return this.length; 14 | } 15 | 16 | public inline function set(index: Int, value: Int): Int { 17 | return this[index] = value; 18 | } 19 | 20 | public inline function get(index: Int): Int { 21 | return this[index]; 22 | } 23 | 24 | public inline function data(): NativeArray { 25 | return this; 26 | } 27 | 28 | @:arrayAccess 29 | public inline function arrayRead(index: Int): Int { 30 | return this[index]; 31 | } 32 | 33 | @:arrayAccess 34 | public inline function arrayWrite(index: Int, value: Int): Int { 35 | return this[index] = value; 36 | } 37 | 38 | // public inline function subarray(start: Int, ?end: Int): Int16Array { 39 | // return cast this.subarray(start, end); 40 | // } 41 | } 42 | -------------------------------------------------------------------------------- /Backends/Java/kha/arrays/Int32Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import java.NativeArray; 4 | 5 | abstract Int32Array(NativeArray) { 6 | public inline function new(elements: Int) { 7 | this = new NativeArray(elements); 8 | } 9 | 10 | public var length(get, never): Int; 11 | 12 | inline function get_length(): Int { 13 | return this.length; 14 | } 15 | 16 | public inline function set(index: Int, value: Int): Int { 17 | return this[index] = value; 18 | } 19 | 20 | public inline function get(index: Int): Int { 21 | return this[index]; 22 | } 23 | 24 | public inline function data(): NativeArray { 25 | return this; 26 | } 27 | 28 | @:arrayAccess 29 | public inline function arrayRead(index: Int): Int { 30 | return this[index]; 31 | } 32 | 33 | @:arrayAccess 34 | public inline function arrayWrite(index: Int, value: Int): Int { 35 | return this[index] = value; 36 | } 37 | 38 | // public inline function subarray(start: Int, ?end: Int): Int16Array { 39 | // return cast this.subarray(start, end); 40 | // } 41 | } 42 | -------------------------------------------------------------------------------- /Backends/Java/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | import kha.Sound; 4 | 5 | class Audio { 6 | public static function play(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 7 | return new JavaSoundChannel(cast(sound, kha.java.Sound)); 8 | } 9 | 10 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 11 | return new JavaMusicChannel(cast(sound, kha.java.Music), loop); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Java/kha/audio1/JavaSoundChannel.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | class JavaSoundChannel implements kha.audio1.AudioChannel { 4 | var sound: kha.java.Sound; 5 | 6 | public function new(sound: kha.java.Sound) { 7 | this.sound = sound; 8 | play(); 9 | } 10 | 11 | public function play(): Void { 12 | sound.play(); 13 | } 14 | 15 | public function pause(): Void { 16 | sound.stop(); 17 | } 18 | 19 | public function stop(): Void { 20 | sound.stop(); 21 | } 22 | 23 | public var length(get, never): Float; 24 | 25 | function get_length(): Float { 26 | return 0; 27 | } 28 | 29 | public var position(get, set): Float; 30 | 31 | function get_position(): Float { 32 | return 0.0; 33 | } 34 | 35 | function set_position(value: Float): Float { 36 | return value; 37 | } 38 | 39 | public var volume(get, set): Float; 40 | 41 | function get_volume(): Float { 42 | return 1; 43 | } 44 | 45 | function set_volume(value: Float): Float { 46 | return 1; 47 | } 48 | 49 | public var finished(get, never): Bool; 50 | 51 | function get_finished(): Bool { 52 | return false; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class CubeMap implements Canvas implements Resource { 6 | public static function createRenderTarget(size: Int, format: TextureFormat = null, depthStencil: DepthStencilFormat = null): CubeMap { 7 | return null; 8 | } 9 | 10 | public function unload(): Void {} 11 | 12 | public function lock(level: Int = 0): Bytes { 13 | return null; 14 | } 15 | 16 | public function unlock(): Void {} 17 | 18 | public var width(get, never): Int; 19 | 20 | function get_width(): Int { 21 | return 0; 22 | } 23 | 24 | public var height(get, never): Int; 25 | 26 | function get_height(): Int { 27 | return 0; 28 | } 29 | 30 | public var g1(get, never): kha.graphics1.Graphics; 31 | 32 | function get_g1(): kha.graphics1.Graphics { 33 | return null; 34 | } 35 | 36 | public var g2(get, never): kha.graphics2.Graphics; 37 | 38 | function get_g2(): kha.graphics2.Graphics { 39 | return null; 40 | } 41 | 42 | public var g4(get, never): kha.graphics4.Graphics; 43 | 44 | function get_g4(): kha.graphics4.Graphics { 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class FragmentShader { 6 | public function new(source: Blob) {} 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class IndexBuffer { 4 | public function new(indexCount: Int, usage: Usage, canRead: Bool = false) {} 5 | 6 | public function lock(?start: Int, ?count: Int): Array { 7 | return null; 8 | } 9 | 10 | public function unlock(?count: Int): Void {} 11 | 12 | public function set(): Void {} 13 | 14 | public function count(): Int { 15 | return 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/Program.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class Program { 4 | public function new() {} 5 | 6 | public function setVertexShader(shader: VertexShader): Void {} 7 | 8 | public function setFragmentShader(shader: FragmentShader): Void {} 9 | 10 | public function link(structure: VertexStructure): Void {} 11 | 12 | public function getConstantLocation(name: String): ConstantLocation { 13 | return null; 14 | } 15 | 16 | public function getTextureUnit(name: String): TextureUnit { 17 | return null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/VertexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class VertexBuffer { 4 | public function new(vertexCount: Int, structure: VertexStructure, usage: Usage, canRead: Bool = false) {} 5 | 6 | public function lock(?start: Int, ?count: Int): kha.arrays.Float32Array { 7 | return null; 8 | } 9 | 10 | public function unlock(?count: Int): Void {} 11 | 12 | public function count(): Int { 13 | return 0; 14 | } 15 | 16 | public function stride(): Int { 17 | return 1; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Java/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class VertexShader { 6 | public function new(source: Blob) {} 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Java/kha/java/Graphics.hx: -------------------------------------------------------------------------------- 1 | package kha.java; 2 | 3 | class Graphics { 4 | public function new() {} 5 | 6 | public function maxTextureSize(): Int { 7 | return 4096; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Kore-HL/hl/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /Backends/Kore-HL/hl/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C)2015-2018 Haxe Foundation 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Backends/Kore-HL/hl/include/mbedtls/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt 3 | -------------------------------------------------------------------------------- /Backends/Kore-HL/hl/include/mbedtls/include/mbedtls/threading_alt.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct 4 | { 5 | CRITICAL_SECTION cs; 6 | char is_valid; 7 | } mbedtls_threading_mutex_t; 8 | -------------------------------------------------------------------------------- /Backends/Kore-HL/hl/include/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /Backends/Kore-HL/hl/src/allocator.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned short fl_cursor; 3 | 4 | typedef struct { 5 | fl_cursor pos; 6 | fl_cursor count; 7 | } gc_fl; 8 | 9 | typedef struct _gc_freelist { 10 | int current; 11 | int count; 12 | int size_bits; 13 | gc_fl *data; 14 | } gc_freelist; 15 | 16 | typedef struct { 17 | int block_size; 18 | int max_blocks; 19 | int first_block; 20 | bool need_flush; 21 | // mutable 22 | gc_freelist free; 23 | unsigned char *sizes; 24 | int sizes_ref; 25 | int sizes_ref2; 26 | } gc_allocator_page_data; 27 | 28 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/Pointer.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Pointer = hl.Bytes; 4 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/Storage.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.io.Bytes; 4 | import haxe.io.BytesBuffer; 5 | import haxe.io.BytesData; 6 | 7 | class Storage { 8 | public static function namedFile(name: String): StorageFile { 9 | return null; 10 | } 11 | 12 | public static function defaultFile(): StorageFile { 13 | return namedFile("default.kha"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/StringHelper.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | @:access(String) 4 | class StringHelper { 5 | public static inline function convert(s: String): hl.Bytes { 6 | var size = 0; 7 | return s.bytes.utf16ToUtf8(0, size); 8 | } 9 | 10 | public static inline function fromBytes(bytes: hl.Bytes): String { 11 | var s = ""; 12 | var size = 0; 13 | s.bytes = bytes.utf8ToUtf16(0, size); 14 | s.length = Std.int(size / 2); 15 | return s; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | abstract ByteBuffer(Pointer) from Pointer to Pointer { 4 | function new(bytearray: Pointer) { 5 | this = bytearray; 6 | } 7 | 8 | public static function create(length: Int): ByteBuffer { 9 | return new ByteBuffer(kinc_bytebuffer_alloc(length)); 10 | } 11 | 12 | public function free() { 13 | kinc_bytebuffer_free(this); 14 | } 15 | 16 | @:hlNative("std", "kinc_bytebuffer_alloc") static function kinc_bytebuffer_alloc(elements: Int): Pointer { 17 | return null; 18 | } 19 | 20 | @:hlNative("std", "kinc_bytebuffer_free") static function kinc_bytebuffer_free(bytearray: Pointer) {} 21 | } 22 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | typedef Audio = kha.audio2.Audio1; 4 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class FragmentShader { 6 | public var _shader: Pointer; 7 | 8 | public function new(sources: Array, files: Array) { 9 | initShader(sources[0]); 10 | } 11 | 12 | function initShader(source: Blob): Void { 13 | _shader = kinc_create_fragmentshader(source.bytes.getData(), source.bytes.getData().length); 14 | } 15 | 16 | public static function fromSource(source: String): FragmentShader { 17 | var sh = new FragmentShader(null, null); 18 | sh._shader = kinc_fragmentshader_from_source(StringHelper.convert(source)); 19 | return sh; 20 | } 21 | 22 | public function delete(): Void {} 23 | 24 | @:hlNative("std", "kinc_create_fragmentshader") static function kinc_create_fragmentshader(data: hl.Bytes, length: Int): Pointer { 25 | return null; 26 | } 27 | 28 | @:hlNative("std", "kinc_fragmentshader_from_source") static function kinc_fragmentshader_from_source(source: hl.Bytes): Pointer { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/graphics4/GeometryShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class GeometryShader { 6 | public var _shader: Pointer; 7 | 8 | public function new(sources: Array, files: Array) { 9 | initShader(sources[0]); 10 | } 11 | 12 | function initShader(source: Blob): Void { 13 | _shader = kinc_create_geometryshader(source.bytes.getData(), source.bytes.getData().length); 14 | } 15 | 16 | public static function fromSource(source: String): GeometryShader { 17 | var sh = new GeometryShader(null, null); 18 | sh._shader = kinc_geometryshader_from_source(StringHelper.convert(source)); 19 | return sh; 20 | } 21 | 22 | public function delete(): Void {} 23 | 24 | @:hlNative("std", "kinc_create_geometryshader") static function kinc_create_geometryshader(data: hl.Bytes, length: Int): Pointer { 25 | return null; 26 | } 27 | 28 | @:hlNative("std", "kinc_geometryshader_from_source") static function kinc_geometryshader_from_source(source: hl.Bytes): Pointer { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | public var _buffer: Pointer; 5 | 6 | var data: Array; 7 | var myCount: Int; 8 | 9 | public function new(indexCount: Int, type: VertexData) {} 10 | 11 | function init(indexCount: Int, type: VertexData) {} 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/graphics4/TessellationControlShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class TessellationControlShader { 7 | public var _shader: Pointer; 8 | 9 | public function new(sources: Array, files: Array) { 10 | initShader(sources[0]); 11 | } 12 | 13 | function initShader(source: Blob): Void { 14 | _shader = kinc_create_tesscontrolshader(source.bytes.getData(), source.bytes.getData().length); 15 | } 16 | 17 | public static function fromSource(source: String): TessellationControlShader { 18 | var sh = new TessellationControlShader(null, null); 19 | sh._shader = kinc_tesscontrolshader_from_source(StringHelper.convert(source)); 20 | return sh; 21 | } 22 | 23 | public function delete(): Void {} 24 | 25 | @:hlNative("std", "kinc_create_tesscontrolshader") static function kinc_create_tesscontrolshader(data: hl.Bytes, length: Int): Pointer { 26 | return null; 27 | } 28 | 29 | @:hlNative("std", "kinc_tesscontrolshader_from_source") static function kinc_tesscontrolshader_from_source(source: hl.Bytes): Pointer { 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/graphics4/TessellationEvaluationShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class TessellationEvaluationShader { 6 | public var _shader: Pointer; 7 | 8 | public function new(sources: Array, files: Array) { 9 | initShader(sources[0]); 10 | } 11 | 12 | function initShader(source: Blob): Void { 13 | _shader = kinc_create_tessevalshader(source.bytes.getData(), source.bytes.getData().length); 14 | } 15 | 16 | public static function fromSource(source: String): TessellationEvaluationShader { 17 | var sh = new TessellationEvaluationShader(null, null); 18 | sh._shader = kinc_tessevalshader_from_source(StringHelper.convert(source)); 19 | return sh; 20 | } 21 | 22 | public function delete(): Void {} 23 | 24 | @:hlNative("std", "kinc_create_tessevalshader") static function kinc_create_tessevalshader(data: hl.Bytes, length: Int): Pointer { 25 | return null; 26 | } 27 | 28 | @:hlNative("std", "kinc_tessevalshader_from_source") static function kinc_tessevalshader_from_source(source: hl.Bytes): Pointer { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class VertexShader { 6 | public var _shader: Pointer; 7 | 8 | public function new(sources: Array, files: Array) { 9 | initShader(sources[0]); 10 | } 11 | 12 | function initShader(source: Blob): Void { 13 | _shader = kinc_create_vertexshader(source.bytes.getData(), source.bytes.getData().length); 14 | } 15 | 16 | public static function fromSource(source: String): VertexShader { 17 | var sh = new VertexShader(null, null); 18 | sh._shader = kinc_vertexshader_from_source(StringHelper.convert(source)); 19 | return sh; 20 | } 21 | 22 | public function delete(): Void {} 23 | 24 | @:hlNative("std", "kinc_create_vertexshader") static function kinc_create_vertexshader(data: hl.Bytes, length: Int): Pointer { 25 | return null; 26 | } 27 | 28 | @:hlNative("std", "kinc_vertexshader_from_source") static function kinc_vertexshader_from_source(source: hl.Bytes): Pointer { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/input/MouseImpl.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | import kha.SystemImpl; 4 | 5 | class MouseImpl extends kha.input.Mouse { 6 | public function new() { 7 | super(); 8 | } 9 | 10 | override public function lock(): Void { 11 | SystemImpl.lockMouse(); 12 | } 13 | 14 | override public function unlock(): Void { 15 | SystemImpl.unlockMouse(); 16 | } 17 | 18 | override public function canLock(): Bool { 19 | return SystemImpl.canLockMouse(); 20 | } 21 | 22 | override public function isLocked(): Bool { 23 | return SystemImpl.isMouseLocked(); 24 | } 25 | 26 | override public function notifyOnLockChange(func: Void->Void, error: Void->Void): Void { 27 | SystemImpl.notifyOfMouseLockChange(func, error); 28 | } 29 | 30 | override public function removeFromLockChange(func: Void->Void, error: Void->Void): Void { 31 | SystemImpl.removeFromMouseLockChange(func, error); 32 | } 33 | 34 | override public function hideSystemCursor(): Void { 35 | SystemImpl.hideSystemCursor(); 36 | } 37 | 38 | override public function showSystemCursor(): Void { 39 | SystemImpl.showSystemCursor(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/input/Sensor.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | @:keep 4 | class Sensor { 5 | static var accelerometer: Sensor = new Sensor(); 6 | static var gyroscope: Sensor = new Sensor(); 7 | 8 | var listeners: ArrayFloat->Float->Void> = new Array(); 9 | 10 | public static function get(type: SensorType): Sensor { 11 | switch (type) { 12 | case Accelerometer: 13 | return accelerometer; 14 | case Gyroscope: 15 | return gyroscope; 16 | } 17 | } 18 | 19 | public function notify(listener: Float->Float->Float->Void): Void { 20 | listeners.push(listener); 21 | } 22 | 23 | function new() {} 24 | 25 | public static function _accelerometerChanged(x: Float, y: Float, z: Float): Void { 26 | var sensor = get(SensorType.Accelerometer); 27 | for (listener in sensor.listeners) { 28 | listener(x, y, z); 29 | } 30 | } 31 | 32 | public static function _gyroscopeChanged(x: Float, y: Float, z: Float): Void { 33 | var sensor = get(SensorType.Gyroscope); 34 | for (listener in sensor.listeners) { 35 | listener(x, y, z); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/korehl/graphics4/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.korehl.graphics4; 2 | 3 | class ConstantLocation implements kha.graphics4.ConstantLocation { 4 | public var _location: Pointer; 5 | 6 | public function new(location: Pointer) { 7 | _location = location; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/korehl/graphics4/Graphics2.hx: -------------------------------------------------------------------------------- 1 | package kha.korehl.graphics4; 2 | 3 | import kha.Canvas; 4 | import kha.graphics4.Graphics; 5 | import kha.graphics4.Graphics2; 6 | import kha.graphics4.TextureFormat; 7 | 8 | class Graphics2 extends kha.graphics4.Graphics2 { 9 | public function new(canvas: Canvas) { 10 | super(canvas); 11 | } 12 | 13 | override public function drawVideoInternal(video: kha.Video, x: Float, y: Float, width: Float, height: Float): Void { 14 | color = Color.Blue; 15 | fillRect(x, y, width, height); 16 | color = Color.White; 17 | drawScaledSubImage(Image.fromVideo(video), 0, 0, video.width(), video.height(), x, y, width, height); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/korehl/graphics4/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.korehl.graphics4; 2 | 3 | class TextureUnit implements kha.graphics4.TextureUnit { 4 | public var _unit: Pointer; 5 | 6 | public function new(unit: Pointer) { 7 | _unit = unit; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/netsync/Network.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Network { 6 | public function new(url: String, port: Int, errorCallback: Void->Void, closeCallback: Void->Void) {} 7 | 8 | public function send(bytes: Bytes, mandatory: Bool): Void {} 9 | 10 | public function listen(listener: Bytes->Void): Void {} 11 | } 12 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kha/network/Http.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Http { 6 | public static function request(url: String, path: String, data: String, port: Int, secure: Bool, method: HttpMethod, contentType: String, 7 | callback: Int->Int->String->Void /*error, response, body*/): Void {} 8 | } 9 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kinc-bridge/bridge.c: -------------------------------------------------------------------------------- 1 | #include "arrays.c.h" 2 | #include "compute.c.h" 3 | #include "cubemap.c.h" 4 | #include "display.c.h" 5 | #include "graphics.c.h" 6 | #include "indexbuffer.c.h" 7 | #include "kinc.c.h" 8 | #include "shader.c.h" 9 | #include "sound.c.h" 10 | #include "system.c.h" 11 | #include "texture.c.h" 12 | #include "vertexbuffer.c.h" 13 | #include "video.c.h" 14 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kinc-bridge/display.c.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void hl_kinc_display_init(void) { 4 | kinc_display_init(); 5 | } 6 | 7 | int hl_kinc_display_count(void) { 8 | return kinc_count_displays(); 9 | } 10 | 11 | int hl_kinc_display_width(int index) { 12 | return kinc_display_current_mode(index).width; 13 | } 14 | 15 | int hl_kinc_display_height(int index) { 16 | return kinc_display_current_mode(index).height; 17 | } 18 | 19 | int hl_kinc_display_x(int index) { 20 | return kinc_display_current_mode(index).x; 21 | } 22 | 23 | int hl_kinc_display_y(int index) { 24 | return kinc_display_current_mode(index).y; 25 | } 26 | 27 | bool hl_kinc_display_is_primary(int index) { 28 | return kinc_primary_display() == index; 29 | } 30 | 31 | int hl_kinc_display_ppi(void) { 32 | return kinc_display_current_mode(kinc_primary_display()).pixels_per_inch; 33 | } 34 | -------------------------------------------------------------------------------- /Backends/Kore-HL/kinc-bridge/indexbuffer.c.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | vbyte *hl_kinc_create_indexbuffer(int count) { 6 | kinc_g4_index_buffer_t *buffer = (kinc_g4_index_buffer_t *)malloc(sizeof(kinc_g4_index_buffer_t)); 7 | kinc_g4_index_buffer_init(buffer, count, KINC_G4_INDEX_BUFFER_FORMAT_32BIT, KINC_G4_USAGE_STATIC); 8 | return (vbyte *)buffer; 9 | } 10 | 11 | void hl_kinc_delete_indexbuffer(vbyte *buffer) { 12 | kinc_g4_index_buffer_t *buf = (kinc_g4_index_buffer_t *)buffer; 13 | kinc_g4_index_buffer_destroy(buf); 14 | free(buf); 15 | } 16 | 17 | vbyte *hl_kinc_indexbuffer_lock(vbyte *buffer, int start, int count) { 18 | kinc_g4_index_buffer_t *buf = (kinc_g4_index_buffer_t *)buffer; 19 | return (vbyte *)kinc_g4_index_buffer_lock(buf, start, count); 20 | } 21 | 22 | void hl_kinc_indexbuffer_unlock(vbyte *buffer, int count) { 23 | kinc_g4_index_buffer_t *buf = (kinc_g4_index_buffer_t *)buffer; 24 | kinc_g4_index_buffer_unlock(buf, count); 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:unreflective 4 | @:structAccess 5 | @:include("cpp_bytearray.h") 6 | @:native("bytearray") 7 | extern class ByteBuffer { 8 | @:native("bytearray") 9 | public static function create(): ByteBuffer; 10 | 11 | public function alloc(length: Int): Void; 12 | 13 | public function addRef(): Void; 14 | 15 | public function subRef(): Void; 16 | 17 | public function get(index: Int): FastFloat; 18 | 19 | public function set(index: Int, value: FastFloat): FastFloat; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | typedef Audio = kha.audio2.Audio1; 4 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/capture/AudioCapture.hx: -------------------------------------------------------------------------------- 1 | package kha.capture; 2 | 3 | import kha.audio2.Buffer; 4 | 5 | class AudioCapture { 6 | public static var audioCallback: Int->Buffer->Void; 7 | 8 | public static function init(initialized: Void->Void, error: Void->Void): Void { 9 | error(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(" 7 | #include 8 | ") 9 | @:headerClassCode("kinc_g4_shader_t shader;") 10 | class FragmentShader { 11 | public function new(sources: Array, files: Array) { 12 | if (sources != null) { 13 | init(sources[0], files[0]); 14 | } 15 | } 16 | 17 | function init(source: Blob, file: String): Void { 18 | untyped __cpp__("kinc_g4_shader_init(&shader, source->bytes->b->Pointer(), source->get_length(), KINC_G4_SHADER_TYPE_FRAGMENT);"); 19 | } 20 | 21 | public static function fromSource(source: String): FragmentShader { 22 | var fragmentShader = new FragmentShader(null, null); 23 | untyped __cpp__("kinc_g4_shader_init_from_source(&fragmentShader->shader, source, KINC_G4_SHADER_TYPE_FRAGMENT);"); 24 | return fragmentShader; 25 | } 26 | 27 | public function delete(): Void { 28 | untyped __cpp__("kinc_g4_shader_destroy(&shader);"); 29 | } 30 | 31 | @:keep 32 | function _forceInclude(): Void { 33 | Bytes.alloc(0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics4/GeometryShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(" 7 | #include 8 | ") 9 | @:headerClassCode("kinc_g4_shader_t shader;") 10 | class GeometryShader { 11 | public function new(sources: Array, files: Array) { 12 | init(sources[0], files[0]); 13 | } 14 | 15 | function init(source: Blob, file: String): Void { 16 | untyped __cpp__("kinc_g4_shader_init(&shader, source->bytes->b->Pointer(), source->get_length(), KINC_G4_SHADER_TYPE_GEOMETRY);"); 17 | } 18 | 19 | public function delete(): Void { 20 | untyped __cpp__("kinc_g4_shader_destroy(&shader);"); 21 | } 22 | 23 | @:keep 24 | function _forceInclude(): Void { 25 | Bytes.alloc(0); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics4/TessellationControlShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(" 7 | #include 8 | ") 9 | @:headerClassCode("kinc_g4_shader_t shader;") 10 | class TessellationControlShader { 11 | public function new(sources: Array, files: Array) { 12 | init(sources[0], files[0]); 13 | } 14 | 15 | function init(source: Blob, file: String): Void { 16 | untyped __cpp__("kinc_g4_shader_init(&shader, source->bytes->b->Pointer(), source->get_length(), KINC_G4_SHADER_TYPE_TESSELLATION_CONTROL);"); 17 | } 18 | 19 | public function delete(): Void { 20 | untyped __cpp__("kinc_g4_shader_destroy(&shader);"); 21 | } 22 | 23 | @:keep 24 | function _forceInclude(): Void { 25 | Bytes.alloc(0); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics4/TessellationEvaluationShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(" 7 | #include 8 | ") 9 | @:headerClassCode("kinc_g4_shader_t shader;") 10 | class TessellationEvaluationShader { 11 | public function new(sources: Array, files: Array) { 12 | init(sources[0], files[0]); 13 | } 14 | 15 | function init(source: Blob, file: String): Void { 16 | untyped __cpp__("kinc_g4_shader_init(&shader, source->bytes->b->Pointer(), source->get_length(), KINC_G4_SHADER_TYPE_TESSELLATION_EVALUATION);"); 17 | } 18 | 19 | public function delete(): Void { 20 | untyped __cpp__("kinc_g4_shader_destroy(&shader);"); 21 | } 22 | 23 | @:keep 24 | function _forceInclude(): Void { 25 | Bytes.alloc(0); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(" 7 | #include 8 | ") 9 | @:headerClassCode("kinc_g4_shader_t shader;") 10 | class VertexShader { 11 | public function new(sources: Array, files: Array) { 12 | if (sources != null) { 13 | init(sources[0], files[0]); 14 | } 15 | } 16 | 17 | function init(source: Blob, file: String): Void { 18 | untyped __cpp__("kinc_g4_shader_init(&shader, source->bytes->b->Pointer(), source->get_length(), KINC_G4_SHADER_TYPE_VERTEX);"); 19 | } 20 | 21 | public static function fromSource(source: String): VertexShader { 22 | var vertexShader = new VertexShader(null, null); 23 | untyped __cpp__("kinc_g4_shader_init_from_source(&vertexShader->shader, source, KINC_G4_SHADER_TYPE_VERTEX);"); 24 | return vertexShader; 25 | } 26 | 27 | public function delete(): Void { 28 | untyped __cpp__("kinc_g4_shader_destroy(&shader);"); 29 | } 30 | 31 | @:keep 32 | function _forceInclude(): Void { 33 | Bytes.alloc(0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics5_/AccelerationStructure.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5; 2 | 3 | #if kha_dxr 4 | @:headerCode(' 5 | #include 6 | ') 7 | @:headerClassCode("Kore::Graphics5::AccelerationStructure* accel;") 8 | class AccelerationStructure { 9 | public function new(commandList: CommandList, vb: VertexBuffer, ib: IndexBuffer) { 10 | init(commandList, vb, ib); 11 | } 12 | 13 | function init(commandList: CommandList, vb: VertexBuffer, ib: IndexBuffer) { 14 | untyped __cpp__("accel = new Kore::Graphics5::AccelerationStructure(commandList->commandList, vb->buffer, ib->buffer);"); 15 | } 16 | } 17 | #end 18 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics5_/ConstantBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5; 2 | 3 | @:headerCode(' 4 | #include 5 | ') 6 | @:headerClassCode("Kore::Graphics5::ConstantBuffer* buffer;") 7 | class ConstantBuffer { 8 | public function new(size: Int) { 9 | init(size); 10 | } 11 | 12 | function init(size: Int) { 13 | untyped __cpp__("buffer = new Kore::Graphics5::ConstantBuffer(size)"); 14 | } 15 | 16 | public function lock(): Void { 17 | untyped __cpp__("buffer->lock()"); 18 | } 19 | 20 | public function unlock(): Void { 21 | untyped __cpp__("buffer->unlock()"); 22 | } 23 | 24 | public function setFloat(offset: Int, value: FastFloat): Void { 25 | untyped __cpp__("buffer->setFloat(offset, value)"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics5_/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(' 7 | #include 8 | ') 9 | @:headerClassCode("Kore::Graphics5::Shader* shader;") 10 | class FragmentShader { 11 | public function new(sources: Array, files: Array) { 12 | if (sources != null) { 13 | init(sources[0], files[0]); 14 | } 15 | } 16 | 17 | private function init(source: Blob, file: String): Void { 18 | untyped __cpp__('shader = new Kore::Graphics5::Shader(source->bytes->b->Pointer(), source->get_length(), Kore::Graphics5::FragmentShader);'); 19 | } 20 | 21 | // public static function fromSource(source: String): FragmentShader { 22 | // var fragmentShader = new FragmentShader(null, null); 23 | // untyped __cpp__('fragmentShader->shader = new Kore::Graphics5::Shader(source, Kore::Graphics5::FragmentShader);'); 24 | // return fragmentShader; 25 | // } 26 | 27 | public function delete(): Void { 28 | untyped __cpp__('delete shader; shader = nullptr;'); 29 | } 30 | 31 | @:keep 32 | function _forceInclude(): Void { 33 | Bytes.alloc(0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics5_/RayTracePipeline.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5; 2 | 3 | #if kha_dxr 4 | @:headerCode(' 5 | #include 6 | ') 7 | @:headerClassCode("Kore::Graphics5::RayTracePipeline* pipeline;") 8 | class RayTracePipeline { 9 | public function new(commandList: CommandList, rayTraceShader: kha.Blob, constantBuffer: ConstantBuffer) { 10 | untyped __cpp__("pipeline = new Kore::Graphics5::RayTracePipeline(commandList->commandList, rayTraceShader->bytes->b->Pointer(), rayTraceShader->get_length(), constantBuffer->buffer);"); 11 | } 12 | 13 | @:keep 14 | function _forceInclude(): Void { 15 | haxe.io.Bytes.alloc(0); 16 | } 17 | } 18 | #end 19 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics5_/RayTraceTarget.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5; 2 | 3 | #if kha_dxr 4 | @:headerCode(' 5 | #include 6 | ') 7 | @:headerClassCode("Kore::Graphics5::RayTraceTarget* target;") 8 | class RayTraceTarget { 9 | public function new(width: Int, height: Int) { 10 | init(width, height); 11 | } 12 | 13 | function init(width: Int, height: Int) { 14 | untyped __cpp__("target = new Kore::Graphics5::RayTraceTarget(width, height);"); 15 | } 16 | } 17 | #end 18 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/graphics5_/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | @:headerCode(' 7 | #include 8 | ') 9 | @:headerClassCode("Kore::Graphics5::Shader* shader;") 10 | class VertexShader { 11 | public function new(sources: Array, files: Array) { 12 | if (sources != null) { 13 | init(sources[0], files[0]); 14 | } 15 | } 16 | 17 | private function init(source: Blob, file: String): Void { 18 | untyped __cpp__('shader = new Kore::Graphics5::Shader(source->bytes->b->Pointer(), source->get_length(), Kore::Graphics5::VertexShader);'); 19 | } 20 | 21 | // public static function fromSource(source: String): VertexShader { 22 | // var vertexShader = new VertexShader(null, null); 23 | // untyped __cpp__('vertexShader->shader = new Kore::Graphics5::Shader(source, Kore::Graphics5::VertexShader);'); 24 | // return vertexShader; 25 | // } 26 | 27 | public function delete(): Void { 28 | untyped __cpp__('delete shader; shader = nullptr;'); 29 | } 30 | 31 | @:keep 32 | function _forceInclude(): Void { 33 | Bytes.alloc(0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/input/Sensor.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | @:keep 4 | class Sensor { 5 | static var accelerometer: Sensor = new Sensor(); 6 | static var gyroscope: Sensor = new Sensor(); 7 | 8 | var listeners: ArrayFloat->Float->Void> = new Array(); 9 | 10 | public static function get(type: SensorType): Sensor { 11 | switch (type) { 12 | case Accelerometer: 13 | return accelerometer; 14 | case Gyroscope: 15 | return gyroscope; 16 | } 17 | } 18 | 19 | public function notify(listener: Float->Float->Float->Void): Void { 20 | listeners.push(listener); 21 | } 22 | 23 | function new() {} 24 | 25 | public static function _changed(type: Int, x: Float, y: Float, z: Float): Void { 26 | var sensor = get(type == 0 ? SensorType.Accelerometer : SensorType.Gyroscope); 27 | for (listener in sensor.listeners) { 28 | listener(x, y, z); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/kore/Keyboard.hx: -------------------------------------------------------------------------------- 1 | package kha.kore; 2 | 3 | @:headerCode(" 4 | #include 5 | ") 6 | @:allow(kha.SystemImpl) 7 | class Keyboard extends kha.input.Keyboard { 8 | function new() { 9 | super(); 10 | } 11 | 12 | @:functionCode("kinc_keyboard_show();") 13 | override public function show(): Void {} 14 | 15 | @:functionCode("kinc_keyboard_hide();") 16 | override public function hide(): Void {} 17 | } 18 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/kore/graphics4/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.kore.graphics4; 2 | 3 | @:headerCode(" 4 | #include 5 | ") 6 | @:headerClassCode("kinc_g4_constant_location_t location;") 7 | class ConstantLocation implements kha.graphics4.ConstantLocation { 8 | public function new() {} 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/kore/graphics4/Graphics2.hx: -------------------------------------------------------------------------------- 1 | package kha.kore.graphics4; 2 | 3 | class Graphics2 extends kha.graphics4.Graphics2 { 4 | override public function drawVideoInternal(video: kha.Video, x: Float, y: Float, width: Float, height: Float): Void { 5 | // color = Color.Blue; 6 | // fillRect(x, y, width, height); 7 | 8 | color = Color.White; 9 | drawScaledSubImage(Image.fromVideo(video), 0, 0, video.width(), video.height() * 0.66, x, y, width, height); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/kore/graphics4/ShaderType.hx: -------------------------------------------------------------------------------- 1 | package kha.kore.graphics4; 2 | 3 | enum abstract ShaderType(Int) { 4 | var FragmentShader; 5 | var VertexShader; 6 | } 7 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/kha/kore/graphics4/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.kore.graphics4; 2 | 3 | @:headerCode(" 4 | #include 5 | ") 6 | @:headerClassCode("kinc_g4_texture_unit_t unit;") 7 | class TextureUnit implements kha.graphics4.TextureUnit { 8 | public function new() {} 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Kore-hxcpp/lib/khalib/float32x4.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Krom/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/Krom/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/Krom/kha/Storage.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.io.Bytes; 4 | import haxe.io.BytesBuffer; 5 | import haxe.io.BytesData; 6 | 7 | using StringTools; 8 | 9 | class KromStorageFile extends StorageFile { 10 | var name: String; 11 | 12 | public function new(name: String) { 13 | this.name = name; 14 | } 15 | 16 | override public function read(): Blob { 17 | var data: BytesData = Krom.readStorage(name); 18 | return data != null ? Blob.fromBytes(Bytes.ofData(data)) : null; 19 | } 20 | 21 | override public function write(data: Blob): Void { 22 | if (data != null) { 23 | Krom.writeStorage(name, data.toBytes().getData()); 24 | } 25 | } 26 | } 27 | 28 | class Storage { 29 | public static function namedFile(name: String): StorageFile { 30 | name = name.replace("\\", "."); 31 | name = name.replace("/", "."); 32 | return new KromStorageFile(name); 33 | } 34 | 35 | public static function defaultFile(): StorageFile { 36 | return namedFile("default.kha"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Backends/Krom/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import js.lib.ArrayBuffer; 4 | 5 | @:forward 6 | abstract ByteBuffer(ArrayBuffer) from ArrayBuffer to ArrayBuffer { 7 | public static function create(length: Int): ByteBuffer { 8 | return new ByteBuffer(length); 9 | } 10 | 11 | function new(length: Int) { 12 | this = new ArrayBuffer(length); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Krom/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | typedef Audio = kha.audio2.Audio1; 4 | -------------------------------------------------------------------------------- /Backends/Krom/kha/compute/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.compute; 2 | 3 | class ConstantLocation { 4 | public function new() {} 5 | } 6 | -------------------------------------------------------------------------------- /Backends/Krom/kha/compute/Shader.hx: -------------------------------------------------------------------------------- 1 | package kha.compute; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class Shader { 7 | public var shader_: Dynamic; 8 | 9 | public function new(sources: Array, files: Array) { 10 | shader_ = Krom.createShaderCompute(sources[0].toBytes().getData()); 11 | } 12 | 13 | public function delete(): Void { 14 | Krom.deleteShaderCompute(shader_); 15 | shader_ = null; 16 | } 17 | 18 | public function getConstantLocation(name: String): ConstantLocation { 19 | return Krom.getConstantLocationCompute(shader_, name); 20 | } 21 | 22 | public function getTextureUnit(name: String): TextureUnit { 23 | return Krom.getTextureUnitCompute(shader_, name); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Krom/kha/compute/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.compute; 2 | 3 | import kha.graphics4.VertexData; 4 | 5 | class ShaderStorageBuffer { 6 | var data: Array; 7 | var myCount: Int; 8 | 9 | public function new(indexCount: Int, type: VertexData) { 10 | myCount = indexCount; 11 | data = new Array(); 12 | data[myCount - 1] = 0; 13 | init(indexCount, type); 14 | } 15 | 16 | function init(indexCount: Int, type: VertexData) { 17 | myCount = indexCount; 18 | data = new Array(); 19 | data[myCount - 1] = 0; 20 | } 21 | 22 | public function delete(): Void {} 23 | 24 | public function lock(): Array { 25 | return data; 26 | } 27 | 28 | public function unlock(): Void {} 29 | 30 | public function count(): Int { 31 | return myCount; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Backends/Krom/kha/compute/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.compute; 2 | 3 | class TextureUnit { 4 | public function new() {} 5 | } 6 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class FragmentShader { 4 | public var shader: Dynamic; 5 | 6 | public function new(sources: Array, names: Array) { 7 | if (sources != null) { 8 | shader = Krom.createFragmentShader(sources[0].bytes.getData(), names[0]); 9 | } 10 | } 11 | 12 | public static function fromSource(source: String): FragmentShader { 13 | var shader = new FragmentShader(null, null); 14 | shader.shader = Krom.createFragmentShaderFromSource(source); 15 | return shader; 16 | } 17 | 18 | public function delete() { 19 | Krom.deleteShader(shader); 20 | shader = null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/GeometryShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class GeometryShader { 4 | public var shader: Dynamic; 5 | 6 | public function new(sources: Array, names: Array) { 7 | shader = Krom.createGeometryShader(sources[0].bytes.getData(), names[0]); 8 | } 9 | 10 | public function delete() { 11 | Krom.deleteShader(shader); 12 | shader = null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.arrays.Uint32Array; 4 | import kha.graphics4.Usage; 5 | 6 | class IndexBuffer { 7 | public var _data: Uint32Array; 8 | 9 | var buffer: Dynamic; 10 | var indexCount: Int; 11 | 12 | public function new(indexCount: Int, usage: Usage, canRead: Bool = false) { 13 | this.indexCount = indexCount; 14 | buffer = Krom.createIndexBuffer(indexCount); 15 | } 16 | 17 | public function delete() { 18 | Krom.deleteIndexBuffer(buffer); 19 | buffer = null; 20 | } 21 | 22 | public function lock(?start: Int, ?count: Int): Uint32Array { 23 | _data = Krom.lockIndexBuffer(buffer); 24 | if (start == null) 25 | start = 0; 26 | if (count == null) 27 | count = indexCount; 28 | return _data.subarray(start, start + count); 29 | } 30 | 31 | public function unlock(?count: Int): Void { 32 | Krom.unlockIndexBuffer(buffer); 33 | } 34 | 35 | public function set(): Void { 36 | Krom.setIndexBuffer(buffer); 37 | } 38 | 39 | public function count(): Int { 40 | return indexCount; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/TessellationControlShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class TessellationControlShader { 4 | public var shader: Dynamic; 5 | 6 | public function new(sources: Array, names: Array) { 7 | shader = Krom.createTessellationControlShader(sources[0].bytes.getData(), names[0]); 8 | } 9 | 10 | public function delete() { 11 | Krom.deleteShader(shader); 12 | shader = null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/TessellationEvaluationShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class TessellationEvaluationShader { 4 | public var shader: Dynamic; 5 | 6 | public function new(sources: Array, names: Array) { 7 | shader = Krom.createTessellationEvaluationShader(sources[0].bytes.getData(), names[0]); 8 | } 9 | 10 | public function delete() { 11 | Krom.deleteShader(shader); 12 | shader = null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Krom/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class VertexShader { 4 | public var shader: Dynamic; 5 | 6 | public function new(sources: Array, names: Array) { 7 | if (sources != null) { 8 | shader = Krom.createVertexShader(sources[0].bytes.getData(), names[0]); 9 | } 10 | } 11 | 12 | public static function fromSource(source: String): VertexShader { 13 | var shader = new VertexShader(null, null); 14 | shader.shader = Krom.createVertexShaderFromSource(source); 15 | return shader; 16 | } 17 | 18 | public function delete() { 19 | Krom.deleteShader(shader); 20 | shader = null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Krom/kha/input/MouseImpl.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | import kha.SystemImpl; 4 | 5 | class MouseImpl extends kha.input.Mouse { 6 | public function new() { 7 | super(); 8 | } 9 | 10 | override public function lock(): Void { 11 | SystemImpl.lockMouse(); 12 | } 13 | 14 | override public function unlock(): Void { 15 | SystemImpl.unlockMouse(); 16 | } 17 | 18 | override public function canLock(): Bool { 19 | return SystemImpl.canLockMouse(); 20 | } 21 | 22 | override public function isLocked(): Bool { 23 | return SystemImpl.isMouseLocked(); 24 | } 25 | 26 | override public function notifyOnLockChange(func: Void->Void, error: Void->Void): Void { 27 | SystemImpl.notifyOfMouseLockChange(func, error); 28 | } 29 | 30 | override public function removeFromLockChange(func: Void->Void, error: Void->Void): Void { 31 | SystemImpl.removeFromMouseLockChange(func, error); 32 | } 33 | 34 | override public function hideSystemCursor(): Void { 35 | SystemImpl.hideSystemCursor(); 36 | } 37 | 38 | override public function showSystemCursor(): Void { 39 | SystemImpl.showSystemCursor(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Backends/Krom/kha/krom/Sound.hx: -------------------------------------------------------------------------------- 1 | package kha.krom; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Sound extends kha.Sound { 6 | public function new(bytes: Bytes) { 7 | super(); 8 | 9 | var count = Std.int(bytes.length / 4); 10 | uncompressedData = new kha.arrays.Float32Array(count); 11 | for (i in 0...count) { 12 | uncompressedData[i] = bytes.getFloat(i * 4); 13 | } 14 | 15 | compressedData = null; 16 | } 17 | 18 | override public function uncompress(done: Void->Void): Void { 19 | done(); 20 | } 21 | 22 | override public function unload(): Void { 23 | super.unload(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Krom/kha/network/Http.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Http { 6 | public static function request(url: String, path: String, data: String, port: Int, secure: Bool, method: HttpMethod, contentType: String, 7 | callback: Int->Int->String->Void /*error, response, body*/): Void {} 8 | } 9 | -------------------------------------------------------------------------------- /Backends/Krom/kha/network/Network.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Network { 6 | public function new(url: String, port: Int, errorCallback: Void->Void, closeCallback: Void->Void) {} 7 | 8 | public function send(bytes: Bytes, mandatory: Bool): Void {} 9 | 10 | public function listen(listener: Bytes->Void): Void {} 11 | } 12 | -------------------------------------------------------------------------------- /Backends/Node/js/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Haxe Foundation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Backends/Node/kha/Display.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class Display { 4 | public static final primary = new Display(); 5 | public static var all = []; 6 | 7 | public final frequency = 60; 8 | public final pixelsPerInch = 96; 9 | 10 | public static function init(): Void {} 11 | 12 | function new() {} 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Node/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/Node/kha/Storage.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.io.Bytes; 4 | import haxe.io.BytesData; 5 | import js.html.ArrayBuffer; 6 | 7 | class Storage { 8 | public static function namedFile(name: String): StorageFile { 9 | return null; 10 | } 11 | 12 | public static function defaultFile(): StorageFile { 13 | return namedFile("default.kha"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Backends/Node/kha/Window.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class Window { 4 | public static function create(win: WindowOptions = null, frame: FramebufferOptions = null): Window { 5 | return instance; 6 | } 7 | 8 | public static function destroy(window: Window) {} 9 | 10 | public static function get(index: Int): Window { 11 | return instance; 12 | } 13 | 14 | public static var all = []; 15 | 16 | public var x = 0; 17 | public var y = 0; 18 | public var width = 0; 19 | public var height = 0; 20 | public var mode = WindowMode.Windowed; 21 | public var visible = false; 22 | public var title = ""; 23 | public final vSynced = false; 24 | 25 | static final instance = new Window(); 26 | 27 | function new() {} 28 | 29 | public function notifyOnResize(callback: Int->Int->Void) {} 30 | 31 | public function notifyOnPpiChange(callback: Int->Void) {} 32 | 33 | public function changeWindowFeatures(features: WindowOptions.WindowFeatures) {} 34 | 35 | public function changeFramebuffer(frame: FramebufferOptions) {} 36 | 37 | public function resize(width: Int, height: Int) {} 38 | 39 | public function move(x: Int, y: Int) {} 40 | } 41 | -------------------------------------------------------------------------------- /Backends/Node/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | import js.lib.ArrayBuffer; 4 | 5 | @:forward 6 | abstract ByteBuffer(ArrayBuffer) from ArrayBuffer to ArrayBuffer { 7 | public static function create(length: Int): ByteBuffer { 8 | return new ByteBuffer(length); 9 | } 10 | 11 | function new(length: Int) { 12 | this = new ArrayBuffer(length); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Node/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | import kha.Sound; 4 | 5 | class Audio { 6 | public static function play(sound: Sound, loop: Bool = false): AudioChannel { 7 | return new NodeAudioChannel(); 8 | } 9 | 10 | public static function stream(sound: Sound, loop: Bool = false): AudioChannel { 11 | return new NodeAudioChannel(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Node/kha/audio1/NodeAudioChannel.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | class NodeAudioChannel implements AudioChannel { 4 | public function new() {} 5 | 6 | public function play(): Void {} 7 | 8 | public function pause(): Void {} 9 | 10 | public function stop(): Void {} 11 | 12 | public var length(get, never): Float; 13 | 14 | function get_length(): Float { 15 | return 0; 16 | } 17 | 18 | public var position(get, set): Float; 19 | 20 | function get_position(): Float { 21 | return 0; 22 | } 23 | 24 | function set_position(value: Float): Float { 25 | return value; 26 | } 27 | 28 | public var volume(get, set): Float; 29 | 30 | function get_volume(): Float { 31 | return 1; 32 | } 33 | 34 | function set_volume(value: Float): Float { 35 | return 1; 36 | } 37 | 38 | public var finished(get, never): Bool; 39 | 40 | function get_finished(): Bool { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Backends/Node/kha/compute/Shader.hx: -------------------------------------------------------------------------------- 1 | package kha.compute; 2 | 3 | class Shader { 4 | public function new(sources: Array, files: Array) {} 5 | } 6 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class CubeMap implements Canvas implements Resource { 6 | public static function createRenderTarget(size: Int, format: TextureFormat = null, depthStencil: DepthStencilFormat = null): CubeMap { 7 | return null; 8 | } 9 | 10 | public function unload(): Void {} 11 | 12 | public function lock(level: Int = 0): Bytes { 13 | return null; 14 | } 15 | 16 | public function unlock(): Void {} 17 | 18 | public var width(get, never): Int; 19 | 20 | function get_width(): Int { 21 | return 0; 22 | } 23 | 24 | public var height(get, never): Int; 25 | 26 | function get_height(): Int { 27 | return 0; 28 | } 29 | 30 | public var g1(get, never): kha.graphics1.Graphics; 31 | 32 | function get_g1(): kha.graphics1.Graphics { 33 | return null; 34 | } 35 | 36 | public var g2(get, never): kha.graphics2.Graphics; 37 | 38 | function get_g2(): kha.graphics2.Graphics { 39 | return null; 40 | } 41 | 42 | public var g4(get, never): kha.graphics4.Graphics; 43 | 44 | function get_g4(): kha.graphics4.Graphics { 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class FragmentShader { 6 | public function new(sources: Array, files: Array) {} 7 | 8 | public static function fromSource(source: String): FragmentShader { 9 | return null; 10 | } 11 | 12 | public function delete(): Void {} 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.graphics4.Usage; 4 | 5 | class IndexBuffer { 6 | var data: Array; 7 | var mySize: Int; 8 | 9 | public function new(indexCount: Int, usage: Usage, canRead: Bool = false) { 10 | mySize = indexCount; 11 | data = new Array(); 12 | data[indexCount - 1] = 0; 13 | } 14 | 15 | public function delete(): Void { 16 | data = null; 17 | } 18 | 19 | public function lock(?start: Int, ?count: Int): Array { 20 | return data; 21 | } 22 | 23 | public function unlock(?count: Int): Void {} 24 | 25 | public function set(): Void {} 26 | 27 | public function count(): Int { 28 | return mySize; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/PipelineState.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.graphics4.FragmentShader; 4 | import kha.graphics4.VertexData; 5 | import kha.graphics4.VertexShader; 6 | import kha.graphics4.VertexStructure; 7 | 8 | class PipelineState extends PipelineStateBase { 9 | public function new() { 10 | super(); 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function compile(): Void {} 16 | 17 | public function set(): Void {} 18 | 19 | public function getConstantLocation(name: String): kha.graphics4.ConstantLocation { 20 | return new kha.js.graphics4.ConstantLocation(); 21 | } 22 | 23 | public function getTextureUnit(name: String): kha.graphics4.TextureUnit { 24 | return new kha.js.graphics4.TextureUnit(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Node/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class VertexShader { 6 | public function new(sources: Array, files: Array) {} 7 | 8 | public static function fromSource(source: String): VertexShader { 9 | return null; 10 | } 11 | 12 | public function delete(): Void {} 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/EmptyGraphics1.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | import kha.graphics1.Graphics; 4 | 5 | class EmptyGraphics1 implements Graphics { 6 | public function new(width: Int, height: Int) {} 7 | 8 | public function begin(): Void {} 9 | 10 | public function end(): Void {} 11 | 12 | public function setPixel(x: Int, y: Int, color: Color): Void {} 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/EmptyGraphics2.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | import js.Browser; 4 | import kha.Color; 5 | import kha.FontStyle; 6 | import kha.graphics2.Graphics; 7 | import kha.Kravur; 8 | import kha.math.Matrix3; 9 | import kha.Rotation; 10 | 11 | class EmptyGraphics2 extends Graphics { 12 | var width: Int; 13 | var height: Int; 14 | var myColor: Color; 15 | var myFont: kha.Font; 16 | 17 | static var instance: EmptyGraphics2; 18 | 19 | public function new(width: Int, height: Int) { 20 | super(); 21 | this.width = width; 22 | this.height = height; 23 | instance = this; 24 | myColor = Color.fromBytes(0, 0, 0); 25 | } 26 | 27 | override function set_color(color: Color): Color { 28 | return myColor = color; 29 | } 30 | 31 | override function get_color(): Color { 32 | return myColor; 33 | } 34 | 35 | override function set_font(font: kha.Font): kha.Font { 36 | return myFont = font; 37 | } 38 | 39 | override function get_font(): kha.Font { 40 | return myFont; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/Mouse.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | import js.Browser; 4 | import js.html.CanvasElement; 5 | import kha.Cursor; 6 | import kha.Image; 7 | 8 | class Mouse extends kha.Mouse { 9 | public static var SystemCursor: String = "default"; 10 | 11 | public static function UpdateSystemCursor() {} 12 | 13 | public function new() { 14 | super(); 15 | } 16 | 17 | override function hideSystemCursor(): Void {} 18 | 19 | override function showSystemCursor(): Void {} 20 | 21 | override public function update(): Void {} 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/Music.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | import js.Browser; 4 | import js.html.AudioElement; 5 | import js.html.ErrorEvent; 6 | import js.html.Event; 7 | import js.html.MediaError; 8 | import js.Lib; 9 | 10 | using StringTools; 11 | 12 | class Music extends kha.Music { 13 | public function new() { 14 | super(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/Sound.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | class SoundChannel extends kha.SoundChannel { 4 | public function new() { 5 | super(); 6 | } 7 | 8 | override public function play(): Void { 9 | super.play(); 10 | } 11 | 12 | override public function pause(): Void {} 13 | 14 | override public function stop(): Void { 15 | super.stop(); 16 | } 17 | 18 | override public function getCurrentPos(): Int { 19 | return 0; 20 | } 21 | 22 | override public function getLength(): Int { 23 | return 0; 24 | } 25 | } 26 | 27 | class Sound extends kha.Sound { 28 | public function new() { 29 | super(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/Video.hx: -------------------------------------------------------------------------------- 1 | package kha.js; 2 | 3 | class Video extends kha.Video { 4 | public function new() { 5 | super(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/graphics4/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.js.graphics4; 2 | 3 | class ConstantLocation implements kha.graphics4.ConstantLocation { 4 | public function new() {} 5 | } 6 | -------------------------------------------------------------------------------- /Backends/Node/kha/js/graphics4/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.js.graphics4; 2 | 3 | class TextureUnit implements kha.graphics4.TextureUnit { 4 | public function new() {} 5 | } 6 | -------------------------------------------------------------------------------- /Backends/WPF/kha/Blob.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Blob = kha.internal.BytesBlob; 4 | -------------------------------------------------------------------------------- /Backends/WPF/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef Font = kha.Kravur; 4 | -------------------------------------------------------------------------------- /Backends/WPF/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | class Audio { 4 | public static function play(sound: Sound, loop: Bool = false, stream: Bool = false): kha.audio1.AudioChannel { 5 | return new WpfAudioChannel(cast(sound, kha.wpf.Sound).filename); 6 | } 7 | 8 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel { 9 | return new WpfAudioChannel(cast(sound, kha.wpf.Sound).filename); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Backends/WPF/kha/audio1/WpfMusicChannel.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | import system.windows.controls.MediaElement; 4 | 5 | class WpfMusicChannel extends WpfSoundChannel implements kha.audio1.MusicChannel { 6 | var looping: Bool = false; 7 | 8 | public function new(filename: String, looping: Bool) { 9 | super(filename); 10 | this.looping = looping; 11 | } 12 | 13 | override function OnMediaEnded(obj: Dynamic, e: RoutedEventArgs): Void { 14 | if (looping) { 15 | play(); 16 | } 17 | else { 18 | hasFinished = true; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | import kha.Blob; 5 | 6 | class ComputeShader { 7 | public function new(sources: Array, files: Array) { 8 | 9 | } 10 | 11 | public function delete(): Void { 12 | 13 | } 14 | 15 | public function getConstantLocation(name: String): ConstantLocation { 16 | return null; 17 | } 18 | 19 | public function getTextureUnit(name: String): TextureUnit { 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class CubeMap implements Canvas implements Resource { 6 | public static function createRenderTarget(size: Int, format: TextureFormat = null, depthStencil: DepthStencilFormat = null): CubeMap { 7 | return null; 8 | } 9 | 10 | public function unload(): Void {} 11 | 12 | public function lock(level: Int = 0): Bytes { 13 | return null; 14 | } 15 | 16 | public function unlock(): Void {} 17 | 18 | public var width(get, never): Int; 19 | 20 | function get_width(): Int { 21 | return 0; 22 | } 23 | 24 | public var height(get, never): Int; 25 | 26 | function get_height(): Int { 27 | return 0; 28 | } 29 | 30 | public var g1(get, never): kha.graphics1.Graphics; 31 | 32 | function get_g1(): kha.graphics1.Graphics { 33 | return null; 34 | } 35 | 36 | public var g2(get, never): kha.graphics2.Graphics; 37 | 38 | function get_g2(): kha.graphics2.Graphics { 39 | return null; 40 | } 41 | 42 | public var g4(get, never): kha.graphics4.Graphics; 43 | 44 | function get_g4(): kha.graphics4.Graphics { 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class FragmentShader { 6 | public function new(source: Blob) {} 7 | } 8 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class IndexBuffer { 4 | public function new(indexCount: Int, usage: Usage, canRead: Bool = false) {} 5 | 6 | public function lock(?start: Int, ?count: Int): Array { 7 | return null; 8 | } 9 | 10 | public function unlock(?count: Int): Void {} 11 | 12 | public function set(): Void {} 13 | 14 | public function count(): Int { 15 | return 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/PipelineState.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class PipelineState extends PipelineStateBase { 4 | public function new() { 5 | super(); 6 | } 7 | 8 | public function compile(): Void {} 9 | 10 | public function getConstantLocation(name: String): ConstantLocation { 11 | return null; 12 | } 13 | 14 | public function getTextureUnit(name: String): TextureUnit { 15 | return null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class ShaderStorageBuffer { 4 | var data: Array; 5 | var myCount: Int; 6 | 7 | public function new(indexCount: Int, type: VertexData) { 8 | myCount = indexCount; 9 | data = new Array(); 10 | data[myCount - 1] = 0; 11 | } 12 | 13 | public function delete(): Void {} 14 | 15 | public function lock(): Array { 16 | return data; 17 | } 18 | 19 | public function unlock(): Void {} 20 | 21 | public function count(): Int { 22 | return myCount; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/VertexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Float32Array; 4 | 5 | class VertexBuffer { 6 | public function new(vertexCount: Int, structure: VertexStructure, usage: Usage, canRead: Bool = false) {} 7 | 8 | public function lock(?start: Int, ?count: Int): Float32Array { 9 | return null; 10 | } 11 | 12 | public function unlock(?count: Int): Void {} 13 | 14 | public function count(): Int { 15 | return 0; 16 | } 17 | 18 | public function stride(): Int { 19 | return 1; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Backends/WPF/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | class VertexShader { 6 | public function new(source: Blob) {} 7 | } 8 | -------------------------------------------------------------------------------- /Backends/WPF/kha/network/Http.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Http { 6 | public static function request(url: String, path: String, data: String, port: Int, secure: Bool, method: HttpMethod, contentType: String, 7 | callback: Int->Int->String->Void /*error, response, body*/): Void { 8 | callback(418, 418, null); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Backends/WPF/kha/network/Network.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class Network { 6 | public function new(url: String, port: Int, errorCallback: Void->Void, closeCallback: Void->Void) {} 7 | 8 | public function send(bytes: Bytes, mandatory: Bool): Void {} 9 | 10 | public function listen(listener: Bytes->Void): Void {} 11 | } 12 | -------------------------------------------------------------------------------- /Backends/WPF/kha/wpf/Graphics.hx: -------------------------------------------------------------------------------- 1 | package kha.wpf; 2 | 3 | class Graphics { 4 | public function new() {} 5 | 6 | // public function createTexture(width: Int, height: Int, format: TextureFormat, usage: Usage): Image { 7 | // return new Image(width, height, format); 8 | // } 9 | 10 | public function maxTextureSize(): Int { 11 | return 4096; 12 | } 13 | 14 | public function vsynced(): Bool { 15 | return true; 16 | } 17 | 18 | public function refreshRate(): Int { 19 | return 60; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Backends/WPF/kha/wpf/Mouse.hx: -------------------------------------------------------------------------------- 1 | package kha.wpf; 2 | 3 | class Mouse extends kha.Mouse { 4 | public function new() { 5 | super(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Backends/WPF/kha/wpf/Music.hx: -------------------------------------------------------------------------------- 1 | package kha.wpf; 2 | 3 | import kha.audio1.MusicChannel; 4 | import system.io.Path; 5 | import system.Uri; 6 | import system.UriKind; 7 | import system.windows.controls.MediaElement; 8 | import system.windows.controls.MediaState; 9 | 10 | class Music extends kha.Music { 11 | public var filename: String; 12 | 13 | public function new(filename: String): Void { 14 | super(); 15 | this.filename = filename; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Backends/WPF/kha/wpf/Sound.hx: -------------------------------------------------------------------------------- 1 | package kha.wpf; 2 | 3 | import kha.audio1.AudioChannel; 4 | import system.io.Path; 5 | import system.Uri; 6 | import system.UriKind; 7 | import system.windows.controls.MediaElement; 8 | import system.windows.controls.MediaState; 9 | 10 | class Sound extends kha.Sound { 11 | public var filename: String; 12 | 13 | var channel: AudioChannel; 14 | 15 | public function new(filename: String): Void { 16 | super(); 17 | this.filename = filename; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/WPF/system/Uri.hx: -------------------------------------------------------------------------------- 1 | package system; 2 | 3 | @:native("System.Uri") 4 | extern class Uri { 5 | function new(filename: String, kind: UriKind): Void; 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/UriKind.hx: -------------------------------------------------------------------------------- 1 | package system; 2 | 3 | @:native("System.UriKind") 4 | extern enum UriKind { 5 | RelativeOrAbsolute; 6 | Absolute; 7 | Relative; 8 | } 9 | -------------------------------------------------------------------------------- /Backends/WPF/system/diagnostics/Stopwatch.hx: -------------------------------------------------------------------------------- 1 | package system.diagnostics; 2 | 3 | import haxe.Int64; 4 | 5 | @:native("System.Diagnostics.Stopwatch") 6 | extern class Stopwatch { 7 | public function new(): Void; 8 | public function Start(): Void; 9 | public var ElapsedMilliseconds: Int64; 10 | } 11 | -------------------------------------------------------------------------------- /Backends/WPF/system/io/Directory.hx: -------------------------------------------------------------------------------- 1 | package system.io; 2 | 3 | @:native("System.IO.Directory") 4 | extern class Directory { 5 | public static function CreateDirectory(path: String): DirectoryInfo; 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/io/DirectoryInfo.hx: -------------------------------------------------------------------------------- 1 | package system.io; 2 | 3 | @:native("System.IO.DirectoryInfo") 4 | extern class DirectoryInfo {} 5 | -------------------------------------------------------------------------------- /Backends/WPF/system/io/File.hx: -------------------------------------------------------------------------------- 1 | package system.io; 2 | 3 | import haxe.io.BytesData; 4 | 5 | @:native("System.IO.File") 6 | extern class File { 7 | public static function AppendAllText(path: String, contents: String): Void; 8 | public static function ReadAllText(filename: String): String; 9 | public static function WriteAllText(path: String, contents: String): Void; 10 | public static function ReadAllBytes(path: String): BytesData; 11 | public static function WriteAllBytes(path: String, bytes: BytesData): Void; 12 | public static function Exists(path: String): Bool; 13 | } 14 | -------------------------------------------------------------------------------- /Backends/WPF/system/io/Path.hx: -------------------------------------------------------------------------------- 1 | package system.io; 2 | 3 | @:native("System.IO.Path") 4 | extern class Path { 5 | public static function GetFullPath(path: String): String; 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/FrameworkElement.hx: -------------------------------------------------------------------------------- 1 | package system.windows; 2 | 3 | import system.windows.input.Cursor; 4 | 5 | @:native("System.Windows.FrameworkElement") 6 | extern class FrameworkElement { 7 | public var Cursor: Cursor; 8 | public var Width: Float; 9 | public var Height: Float; 10 | } 11 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/Window.hx: -------------------------------------------------------------------------------- 1 | package system.windows; 2 | 3 | @:native("System.Windows.Window") 4 | extern class Window extends FrameworkElement { 5 | public function AddChild(child: FrameworkElement): Void; 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/controls/Canvas.hx: -------------------------------------------------------------------------------- 1 | package system.windows.controls; 2 | 3 | import system.windows.FrameworkElement; 4 | 5 | @:native("System.Windows.Controls.Canvas") 6 | extern class Canvas extends FrameworkElement { 7 | public function new(): Void; 8 | } 9 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/controls/MediaElement.hx: -------------------------------------------------------------------------------- 1 | package system.windows.controls; 2 | 3 | import system.Uri; 4 | 5 | @:native("System.Windows.Controls.MediaElement") 6 | extern class MediaElement { 7 | public var Volume: Float; 8 | public var Source: Uri; 9 | public var LoadedBehavior: MediaState; 10 | public var UnloadedBehavior: MediaState; 11 | 12 | public var MediaOpened: Dynamic; 13 | 14 | public function new(): Void {} 15 | 16 | public function Play(): Void {} 17 | 18 | public function Pause(): Void {} 19 | 20 | public function Stop(): Void {} 21 | } 22 | 23 | @:native("System.Windows.RoutedEventArgs") 24 | extern class RoutedEventArgs {} 25 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/controls/MediaState.hx: -------------------------------------------------------------------------------- 1 | package system.windows.controls; 2 | 3 | @:native("System.Windows.Controls.MediaState") 4 | extern enum MediaState { 5 | Manual; 6 | Play; 7 | Close; 8 | Pause; 9 | Stop; 10 | } 11 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/input/Cursor.hx: -------------------------------------------------------------------------------- 1 | package system.windows.input; 2 | 3 | @:native("System.Windows.Input.Cursor") 4 | extern class Cursor {} 5 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/input/Cursors.hx: -------------------------------------------------------------------------------- 1 | package system.windows.input; 2 | 3 | @:native("System.Windows.Input.Cursors") 4 | extern class Cursors { 5 | public static var Arrow: Cursor; 6 | public static var Hand: Cursor; 7 | public static var Wait: Cursor; 8 | } 9 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/input/Mouse.hx: -------------------------------------------------------------------------------- 1 | package system.windows.input; 2 | 3 | @:native("System.Windows.Input.Mouse") 4 | extern class Mouse { 5 | public static var OverrideCursor: Cursor; 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/Color.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.Color") 4 | extern class Color {} 5 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/DrawingContext.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.DrawingContext") 4 | extern class DrawingContext { 5 | public function PushTransform(transform: MatrixTransform): Void; 6 | public function Pop(): Void; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/DrawingVisual.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.DrawingVisual") 4 | extern class DrawingVisual { 5 | public function new(); 6 | public function RenderOpen(): DrawingContext; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/ImageBrush.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.ImageBrush") 4 | extern class ImageBrush { 5 | // public function new(); 6 | public function new(source: ImageSource); 7 | public var ImageSource(get, set): ImageSource; 8 | function get_ImageSource(): ImageSource; 9 | function set_ImageSource(source: ImageSource): ImageSource; 10 | } 11 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/ImageSource.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.ImageSource") 4 | extern class ImageSource { 5 | public function new() {} 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/MatrixTransform.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.MatrixTransform") 4 | extern class MatrixTransform { 5 | public function new(m11: Float, m12: Float, m21: Float, m22: Float, offsetX: Float, offsetY: Float); 6 | } 7 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/MediaPlayer.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media; 2 | 3 | @:native("System.Windows.Media.MediaPlayer") 4 | extern class MediaPlayer { 5 | public var Volume: Float; 6 | 7 | public function new(): Void; 8 | 9 | public function Open(uri: Uri): Void; 10 | 11 | public function Play(): Void; 12 | 13 | public function Pause(): Void; 14 | 15 | public function Stop(): Void; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/WPF/system/windows/media/imaging/BitmapSource.hx: -------------------------------------------------------------------------------- 1 | package system.windows.media.imaging; 2 | 3 | @:native("System.Windows.Media.Imaging.BitmapSource") 4 | extern class BitmapSource {} 5 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-colored.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec4 fragmentColor; 4 | out vec4 FragColor; 5 | 6 | void main() { 7 | FragColor = fragmentColor; 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-colored.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec4 vertexColor; 5 | uniform mat4 projectionMatrix; 6 | out vec4 fragmentColor; 7 | 8 | void main() { 9 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 10 | fragmentColor = vertexColor; 11 | } 12 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-image.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform sampler2D tex; 4 | in vec2 texCoord; 5 | in vec4 color; 6 | out vec4 FragColor; 7 | 8 | void main() { 9 | vec4 texcolor = texture(tex, texCoord) * color; 10 | texcolor.rgb *= color.a; 11 | FragColor = texcolor; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-image.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec2 vertexUV; 5 | in vec4 vertexColor; 6 | uniform mat4 projectionMatrix; 7 | out vec2 texCoord; 8 | out vec4 color; 9 | 10 | void main() { 11 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 12 | texCoord = vertexUV; 13 | color = vertexColor; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-text.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform sampler2D tex; 4 | in vec2 texCoord; 5 | in vec4 fragmentColor; 6 | out vec4 FragColor; 7 | 8 | void main() { 9 | FragColor = vec4(fragmentColor.rgb, texture(tex, texCoord).r * fragmentColor.a); 10 | } 11 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-text.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec2 vertexUV; 5 | in vec4 vertexColor; 6 | uniform mat4 projectionMatrix; 7 | out vec2 texCoord; 8 | out vec4 fragmentColor; 9 | 10 | void main() { 11 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 12 | texCoord = vertexUV; 13 | fragmentColor = vertexColor; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-video.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform samplerVideo tex; 4 | in vec2 texCoord; 5 | in vec4 color; 6 | out vec4 FragColor; 7 | 8 | void main() { 9 | vec4 texcolor = texture(tex, texCoord) * color; 10 | texcolor.rgb *= color.a; 11 | FragColor = texcolor; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-video.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec2 vertexUV; 5 | in vec4 vertexColor; 6 | uniform mat4 projectionMatrix; 7 | out vec2 texCoord; 8 | out vec4 color; 9 | 10 | void main() { 11 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 12 | texCoord = vertexUV; 13 | color = vertexColor; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/kha/AssetError.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | typedef AssetError = { 4 | url: String, 5 | ?error: Dynamic, 6 | } 7 | -------------------------------------------------------------------------------- /Sources/kha/Canvas.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | /** 4 | * Interface for a generic Canvas with different APIs,
5 | * that can be used to draw graphics. 6 | */ 7 | interface Canvas { 8 | /** 9 | * The width of the canvas in pixels. 10 | */ 11 | var width(get, null): Int; 12 | 13 | /** 14 | * The height of the canvas in pixels. 15 | */ 16 | var height(get, null): Int; 17 | 18 | /** 19 | * The Graphics1 interface object.
20 | * Basic setPixel operation. 21 | */ 22 | var g1(get, null): kha.graphics1.Graphics; 23 | 24 | /** 25 | * The Graphics2 interface object.
26 | * Use this for 2D operations. 27 | */ 28 | var g2(get, null): kha.graphics2.Graphics; 29 | 30 | /** 31 | * The Graphics4 interface object.
32 | * Use this for 3D operations. 33 | */ 34 | var g4(get, null): kha.graphics4.Graphics; 35 | } 36 | -------------------------------------------------------------------------------- /Sources/kha/CodeStyle.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class CodeStyle { // upper camel case class names 4 | public function new() { // egyptian style curly brackets 5 | } 6 | 7 | public function doIt(): Void { // lower camel case method and function names 8 | var i = 0; 9 | switch (i) { 10 | case 1: // case in same column as switch 11 | playSfx(2); 12 | } 13 | } 14 | 15 | public function playSfx(soundId: Int) { // lower camel case for parameters and locals, camel case is used for akronyms, too 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/kha/Display.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | extern class Display { 4 | public static var primary(get, never): Display; 5 | public static var all(get, never): Array; 6 | public var available(get, never): Bool; 7 | public var name(get, never): String; 8 | public var x(get, never): Int; 9 | public var y(get, never): Int; 10 | public var width(get, never): Int; 11 | public var height(get, never): Int; 12 | public var frequency(get, never): Int; 13 | public var pixelsPerInch(get, never): Int; 14 | public var modes(get, never): Array; 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/DisplayMode.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class DisplayMode { 4 | public var width: Int; 5 | public var height: Int; 6 | public var frequency: Int; 7 | public var bitsPerPixel: Int; 8 | 9 | public function new(width: Int, height: Int, frequency: Int, bitsPerPixel: Int) { 10 | this.width = width; 11 | this.height = height; 12 | this.frequency = frequency; 13 | this.bitsPerPixel = bitsPerPixel; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/EnvironmentVariables.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | extern class EnvironmentVariables { 4 | public static function get(name: String): String; 5 | } 6 | -------------------------------------------------------------------------------- /Sources/kha/FastFloat.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | /* 4 | FastFloat uses 32 bit floats wherever that is possible. 5 | But JavaScript in particular only supports 64 bit floats. 6 | Therefore when using FastFloat you will have different 7 | precision on different targets and therefore it is 8 | strongly advised to only use it where that does not 9 | matter (typically graphics code, avoid it in gameplay 10 | code at all costs). 11 | */ 12 | #if cpp 13 | typedef FastFloat = cpp.Float32; 14 | #elseif hl 15 | typedef FastFloat = hl.F32; 16 | #elseif java 17 | typedef FastFloat = Single; 18 | #else 19 | typedef FastFloat = Float; 20 | #end 21 | -------------------------------------------------------------------------------- /Sources/kha/Font.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import haxe.io.Bytes; 4 | 5 | extern class Font implements Resource { 6 | function height(fontSize: Int): Float; 7 | 8 | function width(fontSize: Int, str: String): Float; 9 | 10 | function widthOfCharacters(fontSize: Int, characters: Array, start: Int, length: Int): Float; 11 | 12 | function baseline(fontSize: Int): Float; 13 | 14 | function unload(): Void; 15 | 16 | // Portability warning, this works only on some platforms but can usually read ttf 17 | static function fromBytes(bytes: Bytes): Font; 18 | } 19 | -------------------------------------------------------------------------------- /Sources/kha/FramebufferOptions.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | @:structInit 4 | class FramebufferOptions { 5 | @:optional public var frequency: Int = 60; 6 | @:optional public var verticalSync: Bool = true; 7 | @:optional public var colorBufferBits: Int = 32; 8 | @:optional public var depthBufferBits: Int = 16; 9 | @:optional public var stencilBufferBits: Int = 8; 10 | @:optional public var samplesPerPixel: Int = 1; 11 | 12 | public function new(?frequency: Int = 60, ?verticalSync: Bool = true, ?colorBufferBits: Int = 32, ?depthBufferBits: Int = 16, ?stencilBufferBits: Int = 8, 13 | ?samplesPerPixel: Int = 1) { 14 | this.frequency = frequency; 15 | this.verticalSync = verticalSync; 16 | this.colorBufferBits = colorBufferBits; 17 | this.depthBufferBits = depthBufferBits; 18 | this.stencilBufferBits = stencilBufferBits; 19 | this.samplesPerPixel = samplesPerPixel; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Sources/kha/Resource.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | /** 4 | * Interface representing a generic application resource. 5 | * It can go from images, to sound or music, videos or blobs. 6 | */ 7 | interface Resource { 8 | /** 9 | * Unload the resource from memory. Normally called by the Loader. 10 | */ 11 | function unload(): Void; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/kha/Rotation.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | import kha.math.Vector2; 4 | 5 | class Rotation { 6 | public var center: Vector2; 7 | public var angle: Float; 8 | 9 | public function new(center: Vector2, angle: Float) { 10 | this.center = center; 11 | this.angle = angle; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Sources/kha/ScreenCanvas.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class ScreenCanvas implements Canvas { 4 | static var instance: ScreenCanvas = null; 5 | 6 | function new() {} 7 | 8 | public static var the(get, null): ScreenCanvas; 9 | 10 | static function get_the(): ScreenCanvas { 11 | if (instance == null) 12 | instance = new ScreenCanvas(); 13 | return instance; 14 | } 15 | 16 | public var width(get, null): Int; 17 | 18 | function get_width(): Int { 19 | return System.windowWidth(); 20 | } 21 | 22 | public var height(get, null): Int; 23 | 24 | function get_height(): Int { 25 | return System.windowHeight(); 26 | } 27 | 28 | public var g1(get, null): kha.graphics1.Graphics; 29 | 30 | function get_g1(): kha.graphics1.Graphics { 31 | return null; 32 | } 33 | 34 | public var g2(get, null): kha.graphics2.Graphics; 35 | 36 | function get_g2(): kha.graphics2.Graphics { 37 | return null; 38 | } 39 | 40 | public var g4(get, null): kha.graphics4.Graphics; 41 | 42 | function get_g4(): kha.graphics4.Graphics { 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/kha/ScreenRotation.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | /** 4 | * Enum with all the possible rotations. 5 | */ 6 | enum abstract ScreenRotation(Int) { 7 | var RotationNone = 0; 8 | var Rotation90 = 90; 9 | var Rotation180 = 180; 10 | var Rotation270 = 270; 11 | } 12 | -------------------------------------------------------------------------------- /Sources/kha/Shaders.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | @:keep 4 | @:build(kha.internal.ShadersBuilder.build()) 5 | class Shaders {} 6 | -------------------------------------------------------------------------------- /Sources/kha/StringExtensions.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | class StringExtensions { 4 | public static function toCharArray(s: String): Array { 5 | var results = new Array(); 6 | for (i in 0...s.length) { 7 | results.push(s.charCodeAt(i)); 8 | } 9 | return results; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/kha/Window.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | extern class Window { 4 | public static function create(win: WindowOptions = null, frame: FramebufferOptions = null): Window; 5 | public static function destroy(window: Window): Void; 6 | public static function get(index: Int): Window; 7 | public static var all(get, never): Array; 8 | public function resize(width: Int, height: Int): Void; 9 | public function move(x: Int, y: Int): Void; 10 | public function changeWindowFeatures(features: WindowOptions.WindowFeatures): Void; 11 | public function changeFramebuffer(frame: FramebufferOptions): Void; 12 | public var x(get, set): Int; 13 | public var y(get, set): Int; 14 | public var width(get, set): Int; 15 | public var height(get, set): Int; 16 | public var mode(get, set): WindowMode; 17 | public var visible(get, set): Bool; 18 | public var title(get, set): String; 19 | public function notifyOnResize(callback: Int->Int->Void): Void; 20 | public function notifyOnPpiChange(callback: Int->Void): Void; 21 | public var vSynced(get, never): Bool; 22 | } 23 | -------------------------------------------------------------------------------- /Sources/kha/WindowMode.hx: -------------------------------------------------------------------------------- 1 | package kha; 2 | 3 | enum abstract WindowMode(Int) { 4 | var Windowed = 0; // Use an ordinary window 5 | var Fullscreen = 1; // Regular fullscreen mode 6 | var ExclusiveFullscreen = 2; // Exclusive fullscreen mode (switches monitor resolution, Windows only) 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/arrays/ByteBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | /** 4 | * Holds unformatted binary data into a byte buffer. Use ByteArray for access. 5 | */ 6 | extern class ByteBuffer { 7 | public static function create(length: Int): ByteBuffer; 8 | 9 | public var byteLength(get, null): Int; 10 | 11 | /** 12 | * Returns a shallow copy of a range of bytes from this buffer. 13 | * @param begin start of the range, inclusive 14 | * @param end end of the range, exclusive 15 | * @return ByteBuffer 16 | */ 17 | public function slice(begin: Int, end: Int): ByteBuffer; 18 | } 19 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Float32Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Float32Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength >> 2; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements * 4); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): FastFloat { 17 | return this.getFloat32(k * 4); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: FastFloat): FastFloat { 22 | this.setFloat32(k * 4, v); 23 | return v; 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Float32Array { 27 | return this.subarray(start * 4, end != null ? end * 4 : end); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Float64Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Float64Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength >> 3; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements * 8); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Float { 17 | return this.getFloat64(k * 8); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Float): Float { 22 | this.setFloat64(k * 8, v); 23 | return v; 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Float64Array { 27 | return this.subarray(start * 8, end != null ? end * 8 : end); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Int16Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Int16Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength >> 1; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements * 2); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Int { 17 | return this.getInt16(k * 2); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Int): Int { 22 | this.setInt16(k * 2, v); 23 | return get(k); 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Int16Array { 27 | return this.subarray(start * 2, end != null ? end * 2 : null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Int32Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Int32Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength >> 2; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements * 4); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Int { 17 | return this.getInt32(k * 4); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Int): Int { 22 | this.setInt32(k * 4, v); 23 | return get(k); 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Int32Array { 27 | return this.subarray(start * 4, end != null ? end * 4 : null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Int8Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Int8Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Int { 17 | return this.getInt8(k); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Int): Int { 22 | this.setInt8(k, v); 23 | return get(k); 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Int8Array { 27 | return this.subarray(start, end); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Uint16Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Uint16Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength >> 1; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements * 2); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Int { 17 | return this.getUint16(k * 2); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Int): Int { 22 | this.setUint16(k * 2, v); 23 | return get(k); 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Uint16Array { 27 | return this.subarray(start * 2, end != null ? end * 2 : null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Uint32Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Uint32Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength >> 2; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements * 4); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Int { 17 | return this.getUint32(k * 4); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Int): Int { 22 | this.setUint32(k * 4, v); 23 | return get(k); 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Uint32Array { 27 | return this.subarray(start * 4, end != null ? end * 4 : null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/arrays/Uint8Array.hx: -------------------------------------------------------------------------------- 1 | package kha.arrays; 2 | 3 | @:forward 4 | abstract Uint8Array(ByteArray) from ByteArray to ByteArray { 5 | public var length(get, never): Int; 6 | 7 | inline function get_length(): Int { 8 | return this.byteLength; 9 | } 10 | 11 | public function new(elements: Int) { 12 | this = ByteArray.make(elements); 13 | } 14 | 15 | @:arrayAccess 16 | public inline function get(k: Int): Int { 17 | return this.getUint8(k); 18 | } 19 | 20 | @:arrayAccess 21 | public inline function set(k: Int, v: Int): Int { 22 | this.setUint8(k, v); 23 | return get(k); 24 | } 25 | 26 | public inline function subarray(start: Int, ?end: Int): Uint8Array { 27 | return this.subarray(start, end); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/audio1/Audio.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | import kha.Sound; 4 | 5 | extern class Audio { 6 | /** 7 | * Plays a sound immediately. 8 | * @param sound 9 | * The sound to play 10 | * @param loop 11 | * Whether or not to automatically loop the sound 12 | * @return A channel object that can be used to control the playing sound. Please be a ware that Null is returned when the maximum number of simultaneously played channels was reached. 13 | */ 14 | public static function play(sound: Sound, loop: Bool = false): AudioChannel; 15 | 16 | public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel; 17 | } 18 | -------------------------------------------------------------------------------- /Sources/kha/audio1/AudioChannel.hx: -------------------------------------------------------------------------------- 1 | package kha.audio1; 2 | 3 | interface AudioChannel { 4 | function play(): Void; 5 | function pause(): Void; 6 | function stop(): Void; 7 | var length(get, null): Float; // Seconds 8 | private function get_length(): Float; 9 | var position(get, set): Float; // Seconds 10 | private function get_position(): Float; 11 | private function set_position(value: Float): Float; 12 | var volume(get, set): Float; 13 | private function get_volume(): Float; 14 | private function set_volume(value: Float): Float; 15 | var finished(get, null): Bool; 16 | private function get_finished(): Bool; 17 | } 18 | -------------------------------------------------------------------------------- /Sources/kha/audio2/Buffer.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2; 2 | 3 | class Buffer { 4 | public var channels: Int; 5 | public var samplesPerSecond: Int; 6 | 7 | public var data: kha.arrays.Float32Array; 8 | public var size: Int; 9 | public var readLocation: Int; 10 | public var writeLocation: Int; 11 | 12 | public function new(size: Int, channels: Int, samplesPerSecond: Int) { 13 | this.size = size; 14 | this.data = new kha.arrays.Float32Array(size); 15 | this.channels = channels; 16 | this.samplesPerSecond = samplesPerSecond; 17 | readLocation = 0; 18 | writeLocation = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/kha/audio2/ogg/tools/Crc32.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2.ogg.tools; 2 | import haxe.ds.Vector; 3 | 4 | /** 5 | * ... 6 | * @author shohei909 7 | */ 8 | class Crc32 9 | { 10 | static inline var POLY:UInt = 0x04c11db7; 11 | static var table:Vector; 12 | 13 | public static function init() { 14 | if (table != null) { 15 | return; 16 | } 17 | 18 | table = new Vector(256); 19 | for (i in 0...256) { 20 | var s:UInt = ((i:UInt) << (24:UInt)); 21 | for (j in 0...8) { 22 | s = (s << 1) ^ (s >= ((1:UInt) << 31) ? POLY : 0); 23 | } 24 | table[i] = s; 25 | } 26 | } 27 | 28 | public static inline function update(crc:UInt, byte:UInt):UInt 29 | { 30 | return (crc << 8) ^ table[byte ^ (crc >>> 24)]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/kha/audio2/ogg/tools/MathTools.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2.ogg.tools; 2 | 3 | /** 4 | * ... 5 | * @author shohei909 6 | */ 7 | class MathTools 8 | { 9 | public static inline function ilog(n:Int) 10 | { 11 | var log2_4 = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4]; 12 | 13 | // 2 compares if n < 16, 3 compares otherwise (4 if signed or n > 1<<29) 14 | return if (n < (1 << 14)) { 15 | if (n < (1 << 4)) { 16 | 0 + log2_4[n]; 17 | } else if (n < (1 << 9)) { 18 | 5 + log2_4[n >> 5]; 19 | } else { 20 | 10 + log2_4[n >> 10]; 21 | } 22 | } else if (n < (1 << 24)) { 23 | if (n < (1 << 19)) { 24 | 15 + log2_4[n >> 15]; 25 | } else { 26 | 20 + log2_4[n >> 20]; 27 | } 28 | } else if (n < (1 << 29)) { 29 | 25 + log2_4[n >> 25]; 30 | } else if (n < (1 << 31)) { 31 | 30 + log2_4[n >> 30]; 32 | } else { 33 | 0; // signed n returns 0 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Sources/kha/audio2/ogg/vorbis/data/IntPoint.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2.ogg.vorbis.data; 2 | 3 | /** 4 | * ... 5 | * @author shohei909 6 | */ 7 | class IntPoint 8 | { 9 | public var x:Int; 10 | public var y:Int; 11 | 12 | public function new() { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/audio2/ogg/vorbis/data/Mode.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2.ogg.vorbis.data; 2 | import haxe.io.Input; 3 | import kha.audio2.ogg.vorbis.VorbisDecodeState; 4 | 5 | class Mode 6 | { 7 | public var blockflag:Bool; // uint8 8 | public var mapping:Int; // uint8 9 | public var windowtype:Int; // uint16 10 | public var transformtype:Int; // uint16 11 | 12 | public function new() { 13 | } 14 | 15 | public static function read(decodeState:VorbisDecodeState) { 16 | var m = new Mode(); 17 | m.blockflag = (decodeState.readBits(1) != 0); 18 | m.windowtype = decodeState.readBits(16); 19 | m.transformtype = decodeState.readBits(16); 20 | m.mapping = decodeState.readBits(8); 21 | if (m.windowtype != 0) { 22 | throw new ReaderError(INVALID_SETUP); 23 | } 24 | if (m.transformtype != 0) { 25 | throw new ReaderError(INVALID_SETUP); 26 | } 27 | return m; 28 | } 29 | } -------------------------------------------------------------------------------- /Sources/kha/audio2/ogg/vorbis/data/ProbedPage.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2.ogg.vorbis.data; 2 | 3 | /** 4 | * ... 5 | * @author shohei909 6 | */ 7 | 8 | class ProbedPage 9 | { 10 | public var pageStart:Int; 11 | public var pageEnd:Int; 12 | public var afterPreviousPageStart:Int; 13 | public var firstDecodedSample:Null; 14 | public var lastDecodedSample:Null; 15 | 16 | public function new() { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sources/kha/audio2/ogg/vorbis/data/Setting.hx: -------------------------------------------------------------------------------- 1 | package kha.audio2.ogg.vorbis.data; 2 | 3 | /** 4 | * ... 5 | * @author shohei909 6 | */ 7 | class Setting 8 | { 9 | static public inline var MAX_CHANNELS = 16; 10 | static public inline var PUSHDATA_CRC_COUNT = 4; 11 | static public inline var FAST_HUFFMAN_LENGTH = 10; 12 | static public inline var FAST_HUFFMAN_TABLE_SIZE = (1 << FAST_HUFFMAN_LENGTH); 13 | static public inline var FAST_HUFFMAN_TABLE_MASK = FAST_HUFFMAN_TABLE_SIZE - 1; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/capture/AudioCapture.hx: -------------------------------------------------------------------------------- 1 | package kha.capture; 2 | 3 | import kha.audio2.Buffer; 4 | 5 | extern class AudioCapture { 6 | public static var audioCallback: Int->Buffer->Void; 7 | public static function init(initialized: Void->Void, error: Void->Void): Void; 8 | } 9 | -------------------------------------------------------------------------------- /Sources/kha/capture/VideoCapture.hx: -------------------------------------------------------------------------------- 1 | package kha.capture; 2 | 3 | extern class VideoCapture { 4 | public static function init(initialized: kha.Video->Void, error: Void->Void): Void; 5 | } 6 | -------------------------------------------------------------------------------- /Sources/kha/graphics1/Graphics.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics1; 2 | 3 | import kha.Color; 4 | 5 | /** 6 | * Basic graphical interface.
7 | * Represent old devices with only pixel pushing operations. 8 | */ 9 | interface Graphics { 10 | /** 11 | * Begin the graphic operations. 12 | * You MUST call this. 13 | */ 14 | function begin(): Void; 15 | 16 | /** 17 | * Terminate all graphical operations and apply them. 18 | * You MUST call this at the end. 19 | */ 20 | function end(): Void; 21 | 22 | /** 23 | * Set the pixel color at a specific position. 24 | */ 25 | function setPixel(x: Int, y: Int, color: Color): Void; 26 | } 27 | -------------------------------------------------------------------------------- /Sources/kha/graphics2/HorTextAlignment.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics2; 2 | 3 | enum abstract HorTextAlignment(Int) { 4 | var TextLeft; 5 | var TextCenter; 6 | var TextRight; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics2/ImageScaleQuality.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics2; 2 | 3 | enum abstract ImageScaleQuality(Int) { 4 | var Low; // usually point filter 5 | var High; // usually bilinear filter 6 | } 7 | -------------------------------------------------------------------------------- /Sources/kha/graphics2/VerTextAlignment.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics2; 2 | 3 | enum abstract VerTextAlignment(Int) { 4 | var TextTop; 5 | var TextMiddle; 6 | var TextBottom; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/BlendingFactor.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract BlendingFactor(Int) to Int { 4 | var Undefined = 0; 5 | var BlendOne = 1; 6 | var BlendZero = 2; 7 | var SourceAlpha = 3; 8 | var DestinationAlpha = 4; 9 | var InverseSourceAlpha = 5; 10 | var InverseDestinationAlpha = 6; 11 | var SourceColor = 7; 12 | var DestinationColor = 8; 13 | var InverseSourceColor = 9; 14 | var InverseDestinationColor = 10; 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/BlendingOperation.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract BlendingOperation(Int) to Int { 4 | var Add = 0; 5 | var Subtract = 1; 6 | var ReverseSubtract = 2; 7 | var Min = 3; 8 | var Max = 4; 9 | } 10 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/CompareMode.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract CompareMode(Int) to Int { 4 | var Always = 0; 5 | var Never = 1; 6 | var Equal = 2; 7 | var NotEqual = 3; 8 | var Less = 4; 9 | var LessEqual = 5; 10 | var Greater = 6; 11 | var GreaterEqual = 7; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/ComputeShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | extern class Shader { 6 | public function new(sources: Array, files: Array); 7 | public function delete(): Void; 8 | public function getConstantLocation(name: String): ConstantLocation; 9 | public function getTextureUnit(name: String): TextureUnit; 10 | } 11 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | interface ConstantLocation {} 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import haxe.io.Bytes; 4 | 5 | extern class CubeMap implements Canvas implements Resource { 6 | public static function createRenderTarget(size: Int, format: TextureFormat = TextureFormat.RGBA32, 7 | depthStencil: DepthStencilFormat = NoDepthAndStencil): CubeMap; 8 | 9 | public function unload(): Void; 10 | public function lock(level: Int = 0): Bytes; 11 | public function unlock(): Void; 12 | 13 | public var width(get, null): Int; 14 | public var height(get, null): Int; 15 | 16 | public var g1(get, null): kha.graphics1.Graphics; 17 | public var g2(get, null): kha.graphics2.Graphics; 18 | public var g4(get, null): kha.graphics4.Graphics; 19 | } 20 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/CullMode.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract CullMode(Int) to Int { 4 | var Clockwise = 0; 5 | var CounterClockwise = 1; 6 | var None = 2; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/DepthStencilFormat.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract DepthStencilFormat(Int) to Int { 4 | var NoDepthAndStencil = 0; 5 | var DepthOnly = 1; 6 | var DepthAutoStencilAuto = 2; 7 | // This is platform specific, use with care! 8 | var Depth24Stencil8 = 3; 9 | var Depth32Stencil8 = 4; 10 | var Depth16 = 5; 11 | // var StencilOnlyIndex1 = 5; 12 | // var StencilOnlyIndex4 = 6; 13 | // var StencilOnlyIndex8 = 7; 14 | // var StencilOnlyIndex16 = 8; 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | extern class FragmentShader { 6 | public function new(sources: Array, files: Array); 7 | public function delete(): Void; 8 | 9 | /** 10 | Beware: This function is not portable. 11 | **/ 12 | public static function fromSource(source: String): FragmentShader; 13 | } 14 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/GeometryShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | #if cpp 6 | extern class GeometryShader { 7 | public function new(sources: Array); 8 | public function delete(): Void; 9 | } 10 | #else 11 | class GeometryShader { 12 | public function new(sources: Array) {} 13 | 14 | public function delete(): Void {} 15 | } 16 | #end 17 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.arrays.Uint32Array; 4 | 5 | extern class IndexBuffer { 6 | public function new(indexCount: Int, usage: Usage, canRead: Bool = false); 7 | public function delete(): Void; 8 | public function lock(?start: Int, ?count: Int): Uint32Array; 9 | public function unlock(?count: Int): Void; 10 | public function set(): Void; 11 | public function count(): Int; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/MipMapFilter.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract MipMapFilter(Int) to Int { 4 | var NoMipFilter = 0; 5 | var PointMipFilter = 1; 6 | var LinearMipFilter = 2; // linear texture filter + linear mip filter -> trilinear filter 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/PipelineState.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | extern class PipelineState extends PipelineStateBase { 4 | public function new(); 5 | public function delete(): Void; 6 | public function compile(): Void; 7 | public function getConstantLocation(name: String): ConstantLocation; 8 | public function getTextureUnit(name: String): TextureUnit; 9 | } 10 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/ShaderStorageBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | extern class ShaderStorageBuffer { 4 | public function new(indexCount: Int, type: VertexData); 5 | public function delete(): Void; 6 | public function lock(): Array; 7 | public function unlock(): Void; 8 | public function set(): Void; 9 | public function count(): Int; 10 | } 11 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/StencilAction.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract StencilAction(Int) to Int { 4 | var Keep = 0; 5 | var Zero = 1; 6 | var Replace = 2; 7 | var Increment = 3; 8 | var IncrementWrap = 4; 9 | var Decrement = 5; 10 | var DecrementWrap = 6; 11 | var Invert = 7; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/StencilValue.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum StencilValue { 4 | Dynamic; 5 | Static(value: Int); 6 | } 7 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TessellationControlShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | #if cpp 6 | extern class TessellationControlShader { 7 | public function new(sources: Array, files: Array); 8 | public function delete(); 9 | } 10 | #else 11 | class TessellationControlShader { 12 | public function new(sources: Array, files: Array) {} 13 | 14 | public function delete(): Void {} 15 | } 16 | #end 17 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TessellationEvaluationShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | #if cpp 6 | extern class TessellationEvaluationShader { 7 | public function new(sources: Array, files: Array); 8 | public function delete(); 9 | } 10 | #else 11 | class TessellationEvaluationShader { 12 | public function new(sources: Array, files: Array) {} 13 | 14 | public function delete(): Void {} 15 | } 16 | #end 17 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TexDir.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract TexDir(Int) to Int { 4 | var U = 0; 5 | var V = 1; 6 | } 7 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TextureAddressing.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract TextureAddressing(Int) to Int { 4 | var Repeat = 0; 5 | var Mirror = 1; 6 | var Clamp = 2; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TextureFilter.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract TextureFilter(Int) to Int { 4 | var PointFilter = 0; 5 | var LinearFilter = 1; 6 | var AnisotropicFilter = 2; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TextureFormat.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract TextureFormat(Int) to Int { 4 | var RGBA32 = 0; 5 | var L8 = 1; 6 | var RGBA128 = 2; // Floats 7 | var DEPTH16 = 3; 8 | var RGBA64 = 4; // Half floats 9 | var A32 = 5; // Float 10 | var A16 = 6; // Half float 11 | } 12 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | interface TextureUnit {} 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/Usage.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | enum abstract Usage(Int) to Int { 4 | var StaticUsage = 0; 5 | var DynamicUsage = 1; // Just calling it Dynamic causes problems in C++ 6 | var ReadableUsage = 2; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/VertexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.arrays.Float32Array; 4 | 5 | extern class VertexBuffer { 6 | public function new(vertexCount: Int, structure: VertexStructure, usage: Usage, instanceDataStepRate: Int = 0, canRead: Bool = false); 7 | public function delete(): Void; 8 | public function lock(?start: Int, ?count: Int): Float32Array; 9 | public function unlock(?count: Int): Void; 10 | public function count(): Int; 11 | public function stride(): Int; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/VertexElement.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | class VertexElement { 4 | public var name: String; 5 | public var data: VertexData; 6 | 7 | public function new(name: String, data: VertexData) { 8 | this.name = name; 9 | this.data = data; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/kha/graphics4/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics4; 2 | 3 | import kha.Blob; 4 | 5 | extern class VertexShader { 6 | public function new(sources: Array, files: Array); 7 | public function delete(): Void; 8 | 9 | /** 10 | Beware: This function is not portable. 11 | **/ 12 | public static function fromSource(source: String): VertexShader; 13 | } 14 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/AccelerationStructure.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | interface AccelerationStructure {} 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/BlendingFactor.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef BlendingFactor = kha.graphics4.BlendingFactor; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/BlendingOperation.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef BlendingOperation = kha.graphics4.BlendingOperation; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/CompareMode.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef CompareMode = kha.graphics4.CompareMode; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/ConstantLocation.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef ConstantLocation = kha.graphics4.ConstantLocation; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/CubeMap.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef CubeMap = kha.graphics4.CubeMap; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/CullMode.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef CullMode = kha.graphics4.CullMode; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/FragmentShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef FragmentShader = kha.graphics4.FragmentShader; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/GeometryShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef GeometryShader = kha.graphics4.GeometryShader; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/Graphics.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | interface Graphics { 4 | function begin(target: RenderTarget): Void; 5 | function end(): Void; 6 | function swapBuffers(): Void; 7 | #if kha_dxr 8 | function setAccelerationStructure(accel: AccelerationStructure): Void; 9 | function setRayTracePipeline(pipe: RayTracePipeline): Void; 10 | function setRayTraceTarget(target: RayTraceTarget): Void; 11 | function dispatchRays(commandList: CommandList): Void; 12 | function copyRayTraceTarget(commandList: CommandList, renderTarget: RenderTarget, output: RayTraceTarget): Void; 13 | #end 14 | } 15 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/IndexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef IndexBuffer = kha.graphics4.IndexBuffer; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/MipMapFilter.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef MipMapFilter = kha.graphics4.MipMapFilter; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/PipelineState.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef PipelineState = kha.graphics4.PipelineState; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/RenderTarget.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | interface RenderTarget {} 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/StencilAction.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef StencilAction = kha.graphics4.StencilAction; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/TessellationControlShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef TessellationControlShader = kha.graphics4.TessellationControlShader; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/TessellationEvaluationShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef TessellationEvaluationShader = kha.graphics4.TessellationEvaluationShader; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/TextureAddressing.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef TextureAddressing = kha.graphics4.TextureAddressing; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/TextureFilter.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef TextureFilter = kha.graphics4.TextureFilter; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/TextureFormat.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef TextureFormat = kha.graphics4.TextureFormat; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/TextureUnit.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef TextureUnit = kha.graphics4.TextureUnit; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/Usage.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef Usage = kha.graphics4.Usage; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/VertexBuffer.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef VertexBuffer = kha.graphics4.VertexBuffer; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/VertexData.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef VertexData = kha.graphics4.VertexData; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/VertexElement.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef VertexElement = kha.graphics4.VertexElement; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/VertexShader.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef VertexShader = kha.graphics4.VertexShader; 4 | -------------------------------------------------------------------------------- /Sources/kha/graphics5_/VertexStructure.hx: -------------------------------------------------------------------------------- 1 | package kha.graphics5_; 2 | 3 | typedef VertexStructure = kha.graphics4.VertexStructure; 4 | -------------------------------------------------------------------------------- /Sources/kha/input/Sensor.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | #if (cpp || hl) 4 | extern class Sensor { 5 | public static function get(type: SensorType): Sensor; 6 | 7 | public function notify(listener: Float->Float->Float->Void): Void; 8 | } 9 | #else 10 | class Sensor { 11 | public static function get(type: SensorType): Sensor { 12 | return null; 13 | } 14 | 15 | public function notify(listener: Float->Float->Float->Void): Void {} 16 | } 17 | #end 18 | -------------------------------------------------------------------------------- /Sources/kha/input/SensorType.hx: -------------------------------------------------------------------------------- 1 | package kha.input; 2 | 3 | enum abstract SensorType(Int) { 4 | var Accelerometer = 0; 5 | var Gyroscope = 1; 6 | } 7 | -------------------------------------------------------------------------------- /Sources/kha/internal/AssetErrorCallback.hx: -------------------------------------------------------------------------------- 1 | package kha.internal; 2 | 3 | typedef AssetErrorCallback = AssetError->Void; 4 | -------------------------------------------------------------------------------- /Sources/kha/internal/IntBox.hx: -------------------------------------------------------------------------------- 1 | package kha.internal; 2 | 3 | class IntBox { 4 | public var value: Int; 5 | 6 | public function new(value: Int) { 7 | this.value = value; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Sources/kha/internal/IntCallback.hx: -------------------------------------------------------------------------------- 1 | package kha.internal; 2 | 3 | typedef IntCallback = Int->Void; 4 | -------------------------------------------------------------------------------- /Sources/kha/internal/VoidCallback.hx: -------------------------------------------------------------------------------- 1 | package kha.internal; 2 | 3 | typedef VoidCallback = Void->Void; 4 | -------------------------------------------------------------------------------- /Sources/kha/math/Vector2i.hx: -------------------------------------------------------------------------------- 1 | package kha.math; 2 | 3 | @:structInit 4 | class Vector2i { 5 | public inline function new(x: Int = 0, y: Int = 0): Void { 6 | this.x = x; 7 | this.y = y; 8 | } 9 | 10 | public var x: Int; 11 | public var y: Int; 12 | 13 | extern public inline function setFrom(v: Vector2i): Void { 14 | this.x = v.x; 15 | this.y = v.y; 16 | } 17 | 18 | extern public inline function add(vec: Vector2i): Vector2i { 19 | return new Vector2i(x + vec.x, y + vec.y); 20 | } 21 | 22 | extern public inline function sub(vec: Vector2i): Vector2i { 23 | return new Vector2i(x - vec.x, y - vec.y); 24 | } 25 | 26 | extern public inline function mult(value: Int): Vector2i { 27 | return new Vector2i(x * value, y * value); 28 | } 29 | 30 | extern public inline function div(value: Int): Vector2i { 31 | return new Vector2i(Std.int(x / value), Std.int(y / value)); 32 | } 33 | 34 | extern public inline function dot(v: Vector2i): Float { 35 | return x * v.x + y * v.y; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/kha/netsync/Client.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | interface Client { 6 | var id(get, null): Int; 7 | function send(bytes: Bytes, mandatory: Bool): Void; 8 | function receive(receiver: Bytes->Void): Void; 9 | function onClose(close: Void->Void): Void; 10 | } 11 | -------------------------------------------------------------------------------- /Sources/kha/netsync/Controller.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | @:autoBuild(kha.netsync.ControllerBuilder.build()) 6 | class Controller { 7 | var __id: Int; 8 | 9 | public var _inputBufferIndex: Int; 10 | public var _inputBuffer: Bytes; 11 | 12 | public function new() { 13 | __id = ControllerBuilder.nextId++; 14 | _inputBuffer = Bytes.alloc(1); 15 | } 16 | 17 | public function _id(): Int { 18 | return __id; 19 | } 20 | 21 | public function _receive(bytes: Bytes): Void {} 22 | } 23 | -------------------------------------------------------------------------------- /Sources/kha/netsync/Entity.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | @:autoBuild(kha.netsync.EntityBuilder.build()) 6 | interface Entity { 7 | function _id(): Int; 8 | function _size(): Int; 9 | function _send(offset: Int, bytes: Bytes): Int; 10 | function _receive(offset: Int, bytes: Bytes): Int; 11 | } 12 | -------------------------------------------------------------------------------- /Sources/kha/netsync/Example.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | class Example implements Entity { 4 | @replicated 5 | var test: Float; 6 | @replicated 7 | var bla: Int; 8 | 9 | public function new() { 10 | // super(); 11 | test = 3; 12 | } 13 | 14 | public function simulate(tdif: Float): Void {} 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/netsync/LocalClient.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class LocalClient implements Client { 6 | var myId: Int; 7 | 8 | public function new(id: Int) { 9 | myId = id; 10 | } 11 | 12 | public function send(bytes: Bytes, mandatory: Bool): Void {} 13 | 14 | public function receive(receiver: Bytes->Void): Void {} 15 | 16 | public function onClose(close: Void->Void): Void {} 17 | 18 | public var controllers(get, null): Array; 19 | 20 | function get_controllers(): Array { 21 | return null; 22 | } 23 | 24 | public var id(get, null): Int; 25 | 26 | function get_id(): Int { 27 | return myId; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/kha/netsync/Network.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | extern class Network { 6 | public function new(url: String, port: Int, errorCallback: Void->Void, closeCallback: Void->Void); 7 | public function send(bytes: Bytes, mandatory: Bool): Void; 8 | public function listen(listener: Bytes->Void): Void; 9 | } 10 | -------------------------------------------------------------------------------- /Sources/kha/netsync/Sync.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | @:autoBuild(kha.netsync.SyncBuilder.build()) 4 | interface Sync { 5 | function _syncId(): Int; 6 | } 7 | -------------------------------------------------------------------------------- /Sources/kha/netsync/WebSocketClient.hx: -------------------------------------------------------------------------------- 1 | package kha.netsync; 2 | 3 | import haxe.io.Bytes; 4 | 5 | class WebSocketClient implements Client { 6 | var myId: Int; 7 | var socket: Dynamic; 8 | 9 | public function new(id: Int, socket: Dynamic) { 10 | myId = id; 11 | this.socket = socket; 12 | } 13 | 14 | public function send(bytes: Bytes, mandatory: Bool): Void { 15 | socket.send(bytes.getData()); 16 | // socket.send(bytes.getData(), {binary: true}); 17 | } 18 | 19 | public function receive(receiver: Bytes->Void): Void { 20 | socket.on('message', function(message) { 21 | // js.Node.console.log(message); 22 | receiver(Bytes.ofData(message)); 23 | }); 24 | } 25 | 26 | public function onClose(close: Void->Void): Void { 27 | socket.onclose = function() { 28 | close(); 29 | }; 30 | } 31 | 32 | public var controllers(get, null): Array; 33 | 34 | function get_controllers(): Array { 35 | return null; 36 | } 37 | 38 | public var id(get, null): Int; 39 | 40 | function get_id(): Int { 41 | return myId; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Sources/kha/network/Http.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | import haxe.io.Bytes; 4 | 5 | extern class Http { 6 | public static function request(url: String, path: String, data: String, port: Int, secure: Bool, method: HttpMethod, headers: Map, 7 | callback: Int->Int->String->Void /*error, response, body*/): Void; 8 | } 9 | -------------------------------------------------------------------------------- /Sources/kha/network/HttpMethod.hx: -------------------------------------------------------------------------------- 1 | package kha.network; 2 | 3 | enum abstract HttpMethod(Int) to Int { 4 | var Get = 0; 5 | var Post = 1; 6 | var Put = 2; 7 | var Delete = 3; 8 | } 9 | -------------------------------------------------------------------------------- /Sources/kha/vr/Pose.hx: -------------------------------------------------------------------------------- 1 | package kha.vr; 2 | 3 | import kha.math.Quaternion; 4 | import kha.math.Vector3; 5 | 6 | // Position and orientation together. 7 | class Pose { 8 | public var Orientation: Quaternion; 9 | public var Position: Vector3; 10 | 11 | public function new() { 12 | Orientation = new Quaternion(); 13 | Position = new Vector3(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sources/kha/vr/PoseState.hx: -------------------------------------------------------------------------------- 1 | package kha.vr; 2 | 3 | import kha.math.Vector3; 4 | 5 | // Full pose (rigid body) configuration with first and second derivatives. 6 | class PoseState { 7 | public var Pose: Pose; 8 | 9 | public var AngularVelocity: Vector3; 10 | public var LinearVelocity: Vector3; 11 | public var AngularAcceleration: Vector3; 12 | public var LinearAcceleration: Vector3; 13 | public var TimeInSeconds: Float; // Absolute time of this state sample. 14 | 15 | public function new() {} 16 | } 17 | -------------------------------------------------------------------------------- /Sources/kha/vr/SensorState.hx: -------------------------------------------------------------------------------- 1 | package kha.vr; 2 | 3 | // State of the sensor at a given absolute time. 4 | class SensorState { 5 | // Predicted pose configuration at requested absolute time. 6 | // One can determine the time difference between predicted and actual 7 | // readings by comparing ovrPoseState.TimeInSeconds. 8 | public var Predicted: PoseState; 9 | 10 | // Actual recorded pose configuration based on the sensor sample at a 11 | // moment closest to the requested time. 12 | public var Recorded: PoseState; 13 | 14 | // Sensor temperature reading, in degrees Celsius, as sample time. 15 | public var Temperature: Float; 16 | // Sensor status described by ovrStatusBits. 17 | public var Status: Int; 18 | 19 | public function new() {} 20 | } 21 | -------------------------------------------------------------------------------- /Tests/Empty/Sources/Main.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import kha.Assets; 4 | import kha.Framebuffer; 5 | import kha.Scheduler; 6 | import kha.System; 7 | 8 | class Main { 9 | static function update(): Void { 10 | 11 | } 12 | 13 | static function render(frames: Array): Void { 14 | 15 | } 16 | 17 | public static function main() { 18 | System.start({title: "Test", width: 1024, height: 768}, function (_) { 19 | // Just loading everything is ok for small projects 20 | Assets.loadEverything(function () { 21 | // Avoid passing update/render directly, 22 | // so replacing them via code injection works 23 | Scheduler.addTimeTask(function () { update(); }, 0, 1 / 60); 24 | System.notifyOnFrames(function (frames) { render(frames); }); 25 | }); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tests/Empty/khafile.js: -------------------------------------------------------------------------------- 1 | let project = new Project('Empty'); 2 | 3 | if (platform !== 'empty') { 4 | project.addParameter('-dce full'); 5 | } 6 | 7 | project.addSources('Sources'); 8 | 9 | resolve(project); 10 | -------------------------------------------------------------------------------- /Tests/Gamepads/configure-msvc2010-opengl.cmd: -------------------------------------------------------------------------------- 1 | @node ../../make --target windows --kha ../.. --visualstudio vs2010 --graphics opengl 2 | -------------------------------------------------------------------------------- /Tests/Gamepads/khafile.js: -------------------------------------------------------------------------------- 1 | let project = new Project('Gamepads'); 2 | 3 | project.addSources('src'); 4 | 5 | resolve(project); 6 | -------------------------------------------------------------------------------- /Tests/Gamepads/src/Main.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | class PadExample { 4 | public function new() { 5 | kha.System.notifyOnRender(render); 6 | } 7 | 8 | function render( fb : kha.Framebuffer ) { 9 | var g = fb.g2; 10 | 11 | g.begin(true, kha.Color.Purple); 12 | for (pad in pads) { 13 | pad.render(g); 14 | } 15 | g.end(); 16 | } 17 | 18 | var pads = [new AnalogPadDisplay(0, 32, 32), new AnalogPadDisplay(1, 448, 32), new AnalogPadDisplay(2, 32, 352), new AnalogPadDisplay(3, 448, 352)]; 19 | } 20 | 21 | class Main { 22 | public static function main() { 23 | kha.System.init({ title : 'PadExample', width : 1024, height : 704 }, kha.Assets.loadEverything.bind(assets_loadedHandler)); 24 | } 25 | 26 | static function assets_loadedHandler() { 27 | new PadExample(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tools/platform.sh: -------------------------------------------------------------------------------- 1 | if [[ "$OSTYPE" == "linux-gnu"* ]]; then 2 | MACHINE_TYPE=`uname -m` 3 | if [[ "$MACHINE_TYPE" == "aarch64"* ]]; then 4 | KINC_PLATFORM=linux_arm64 5 | elif [[ "$MACHINE_TYPE" == "x86_64"* ]]; then 6 | KINC_PLATFORM=linux_x64 7 | else 8 | echo "Unknown Linux machine '$MACHINE_TYPE', please edit Tools/platform.sh" 9 | exit 1 10 | fi 11 | elif [[ "$OSTYPE" == "darwin"* ]]; then 12 | KINC_PLATFORM=macos 13 | elif [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* ]]; then 14 | KINC_PLATFORM=windows_x64 15 | KINC_EXE_SUFFIX=.exe 16 | else 17 | echo "Unknown platform '$OSTYPE', please edit Tools/platform.sh" 18 | exit 1 19 | fi 20 | -------------------------------------------------------------------------------- /checkstyle-exclude.json: -------------------------------------------------------------------------------- 1 | { 2 | "all": [ 3 | "kha.audio2.ogg", 4 | "kha.graphics2.truetype", 5 | "kha.graphics4.hxsl", 6 | "js", 7 | "hxcpp", 8 | "kha.flash.utils" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /checkstyle.bat: -------------------------------------------------------------------------------- 1 | haxelib run checkstyle -s Sources -s Backends -------------------------------------------------------------------------------- /checkstyle.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "INFO", 3 | "checks": [ 4 | { 5 | "type": "UnusedLocalVar" 6 | }, 7 | { 8 | "type": "UnnecessaryConstructor" 9 | }, 10 | { 11 | "type": "AvoidStarImport" 12 | }, 13 | { 14 | "type": "PublicAccessor" 15 | }, 16 | { 17 | "type": "RedundantModifier" 18 | }, 19 | { 20 | "type": "StringLiteral", 21 | "props": { 22 | "policy": "doubleAndInterpolation" 23 | } 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /get_dlc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git -C `dirname "$0"` submodule update --init Tools/khamake 4 | git -C `dirname "$0"` submodule update --init Backends/Kore-hxcpp/khacpp 5 | 6 | if [[ "$OSTYPE" == "linux-gnu"* ]]; then 7 | MACHINE_TYPE=`uname -m` 8 | if [[ "$MACHINE_TYPE" == "armv"* ]]; then 9 | git -C `dirname "$0"` submodule update --depth 1 --init Tools/linux_arm 10 | elif [[ "$MACHINE_TYPE" == "aarch64"* ]]; then 11 | git -C `dirname "$0"` submodule update --depth 1 --init Tools/linux_arm64 12 | else 13 | git -C `dirname "$0"` submodule update --depth 1 --init Tools/linux_x64 14 | fi 15 | elif [[ "$OSTYPE" == "darwin"* ]]; then 16 | git -C `dirname "$0"` submodule update --depth 1 --init Tools/macos 17 | elif [[ "$OSTYPE" == "FreeBSD"* ]]; then 18 | git -C `dirname "$0"` submodule update --depth 1 --init Tools/freebsd_x64 19 | fi 20 | 21 | git -C `dirname "$0"` submodule update --init Kore 22 | bash `dirname "$0"`/Kore/get_dlc 23 | -------------------------------------------------------------------------------- /get_dlc.bat: -------------------------------------------------------------------------------- 1 | @pushd "%~dp0" 2 | @git submodule update --init Tools/khamake 3 | @git submodule update --init Backends/Kore-hxcpp/khacpp 4 | @git submodule update --depth 1 --init Tools/windows_x64 5 | @git submodule update --init Kore 6 | @call Kore\get_dlc.bat 7 | @popd -------------------------------------------------------------------------------- /get_dlc_dangerously.bat: -------------------------------------------------------------------------------- 1 | @pushd "%~dp0" 2 | @if exist Tools\khamake\khamake.js ( 3 | @git submodule update --remote --merge Tools/khamake 4 | ) else ( 5 | @git submodule update --init --remote Tools/khamake 6 | @git -C Tools/khamake checkout main 7 | ) 8 | @if exist Backends\Kore-hxcpp\khacpp\LICENSE.txt ( 9 | @git submodule update --remote --merge Backends/Kore-hxcpp/khacpp 10 | ) else ( 11 | @git submodule update --init --remote Backends/Kore-hxcpp/khacpp 12 | @git -C Backends/Kore-hxcpp/khacpp checkout main 13 | ) 14 | @if exist Tools\windows_x64\LICENSE.txt ( 15 | @git submodule update --remote --merge Tools/windows_x64 16 | ) else ( 17 | @git submodule update --init --remote Tools/windows_x64 18 | @git -C Tools/windows_x64 checkout main 19 | ) 20 | @if exist Kore\get_dlc_dangerously ( 21 | @git submodule update --remote --merge Kore 22 | ) else ( 23 | @git submodule update --init --remote Kore 24 | @git -C Kore checkout main 25 | ) 26 | @call Kore\get_dlc_dangerously.bat 27 | @popd -------------------------------------------------------------------------------- /hxformat.json: -------------------------------------------------------------------------------- 1 | { 2 | "whitespace": { 3 | "typeHintColonPolicy": "after" 4 | }, 5 | "sameLine": { 6 | "ifElse": "next", 7 | "tryCatch": "next" 8 | }, 9 | "excludes": [ 10 | "\\/hxsl\\/.*", 11 | "\\/ogg\\/.*", 12 | "\\/truetype\\/.*", 13 | "\\/khacpp\\/.*", 14 | "\\/Node\\/js\\/.*" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 the Kha Development Team 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source distribution. 20 | -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @node %~dp0make.js %* -------------------------------------------------------------------------------- /make.js: -------------------------------------------------------------------------------- 1 | require('./Tools/khamake/khamake.js'); 2 | -------------------------------------------------------------------------------- /make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | directory=$(dirname "$BASH_SOURCE") 3 | makejs=$directory 4 | makejs+="/make.js" 5 | node "$makejs" "$@" -------------------------------------------------------------------------------- /updates.md: -------------------------------------------------------------------------------- 1 | * 2024-01-19: The compute API has been moved into G4, see https://github.com/Kha-Samples/ComputeShader/commit/17c9e07d73743283846e03aadfd07585a56c878c for an example of how to update your code. 2 | * 2022-06-06: The stencil-API changed a little to support separate stencil-settings for front-sides and back-sides. 3 | * 2019-09-15: CompilerDefines was removed, if you're interested in it, please grab rblsb's fixed up version in https://github.com/Kode/Kha/pull/1010. 4 | --------------------------------------------------------------------------------