Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,3 @@
package kha;
typedef Blob = kha.internal.BytesBlob;

View File

@ -0,0 +1,75 @@
package kha;
class Display {
static var instance: Display = new Display();
function new() {}
public static function init(): Void {}
public static var primary(get, never): Display;
static function get_primary(): Display {
return instance;
}
public static var all(get, never): Array<Display>;
static function get_all(): Array<Display> {
return [primary];
}
public var available(get, never): Bool;
function get_available(): Bool {
return true;
}
public var name(get, never): String;
function get_name(): String {
return "Display";
}
public var x(get, never): Int;
function get_x(): Int {
return 0;
}
public var y(get, never): Int;
function get_y(): Int {
return 0;
}
public var width(get, never): Int;
function get_width(): Int {
return 1920;
}
public var height(get, never): Int;
function get_height(): Int {
return 1080;
}
public var frequency(get, never): Int;
function get_frequency(): Int {
return 60;
}
public var pixelsPerInch(get, never): Int;
function get_pixelsPerInch(): Int {
return 96;
}
public var modes(get, never): Array<DisplayMode>;
function get_modes(): Array<DisplayMode> {
return [];
}
}

View File

@ -0,0 +1,27 @@
package kha;
class DisplayImpl {
public static function count(): Int {
return 1;
}
public static function width(index: Int): Int {
return -1;
}
public static function height(index: Int): Int {
return -1;
}
public static function x(index: Int): Int {
return -1;
}
public static function y(index: Int): Int {
return -1;
}
public static function isPrimary(index: Int): Bool {
return true;
}
}

View File

@ -0,0 +1,7 @@
package kha;
class EnvironmentVariables {
public static function get(name: String): String {
return null;
}
}

View File

@ -0,0 +1,3 @@
package kha;
typedef Font = kha.Kravur;

View File

@ -0,0 +1,173 @@
package kha;
import haxe.io.Bytes;
import kha.graphics4.DepthStencilFormat;
import kha.graphics4.TextureFormat;
import kha.graphics4.Usage;
class Image implements Canvas implements Resource {
public static function create(width: Int, height: Int, format: TextureFormat = null, usage: Usage = null): Image {
return null;
}
public static function create3D(width: Int, height: Int, depth: Int, format: TextureFormat = null, usage: Usage = null): Image {
return null;
}
public static function createRenderTarget(width: Int, height: Int, format: TextureFormat = null,
depthStencil: DepthStencilFormat = DepthStencilFormat.NoDepthAndStencil, antiAliasingSamples: Int = 1): Image {
return null;
}
public static function fromBytes(bytes: Bytes, width: Int, height: Int, format: TextureFormat = null, usage: Usage = null): Image {
return null;
}
public static function fromBytes3D(bytes: Bytes, width: Int, height: Int, depth: Int, format: TextureFormat = null, usage: Usage = null): Image {
return null;
}
public static var maxSize(get, never): Int;
static function get_maxSize(): Int {
return 0;
}
public static var nonPow2Supported(get, never): Bool;
static function get_nonPow2Supported(): Bool {
return false;
}
public static function renderTargetsInvertedY(): Bool {
return false;
}
public function isOpaque(x: Int, y: Int): Bool {
return false;
}
/**
* Returns the color of a pixel identified by its x/y-coordinates. This only works for images for which
* the readable flag is set to true because by default images only exist in video-memory. To load images
* which are readable use a line ala project.addAssets('Assets/image.png', { readable: true }); in
* your khafile.
* For reading the content of render-targets use getPixels() instead.
*/
public function at(x: Int, y: Int): Color {
return Color.Black;
}
public function unload(): Void {}
/**
* Returns a writable Bytes object. Once unlock() is called the content of the Bytes object
* is written into the image.
* This can not be used to read the current content of an image - for this use at() or getPixels() instead.
*/
public function lock(level: Int = 0): Bytes {
return null;
}
public function unlock(): Void {}
/**
* Returns the content of an image. This only works if the image is a render-target and it is very slow
* because data will be copied from video-memory to main-memory. This is useful for making screenshots
* but please avoid using it for regular rendering.
* For reading the content of images which are not render-targets use at() instead.
*/
public function getPixels(): Bytes {
return null;
}
public function generateMipmaps(levels: Int): Void {}
public function setMipmaps(mipmaps: Array<Image>): Void {}
public function setDepthStencilFrom(image: Image): Void {}
public function clear(x: Int, y: Int, z: Int, width: Int, height: Int, depth: Int, color: Color): Void {}
/**
* Returns the original width of the image.
*/
public var width(get, never): Int;
function get_width(): Int {
return 0;
}
/**
* Returns the original height of the image.
*/
public var height(get, never): Int;
function get_height(): Int {
return 0;
}
public var depth(get, never): Int;
function get_depth(): Int {
return 1;
}
public var format(get, never): TextureFormat;
function get_format(): TextureFormat {
return TextureFormat.RGBA32;
}
/**
* Very old GPUs only supported power of two texture-widths.
* When an Image is created on such a GPU, Kha automatically increases
* its size to a power of two and realWidth returns this new, internal
* size. Knowing the real size is important for calculating
* texture-coordinates correctly but all of this is irrelevant unless
* you really want to support very very old GPUs.
*/
public var realWidth(get, never): Int;
function get_realWidth(): Int {
return 0;
}
/**
* Very old GPUs only supported power of two texture-heights.
* When an Image is created on such a GPU, Kha automatically increases
* its size to a power of two and realHeight returns this new, internal
* size. Knowing the real size is important for calculating
* texture-coordinates correctly but all of this is irrelevant unless
* you really want to support very very old GPUs.
*/
public var realHeight(get, never): Int;
function get_realHeight(): Int {
return 0;
}
public var stride(get, never): Int;
function get_stride(): Int {
return 0;
}
public var g1(get, never): kha.graphics1.Graphics;
function get_g1(): kha.graphics1.Graphics {
return null;
}
public var g2(get, never): kha.graphics2.Graphics;
function get_g2(): kha.graphics2.Graphics {
return null;
}
public var g4(get, never): kha.graphics4.Graphics;
function get_g4(): kha.graphics4.Graphics {
return null;
}
}

View File

@ -0,0 +1,31 @@
package kha;
import kha.FontStyle;
import kha.Blob;
import kha.Kravur;
import haxe.io.Bytes;
import haxe.io.BytesData;
class LoaderImpl {
public static function getImageFormats(): Array<String> {
return ["png", "jpg"];
}
public static function loadImageFromDescription(desc: Dynamic, done: kha.Image->Void, failed: AssetError->Void) {}
public static function getSoundFormats(): Array<String> {
return ["mp4", "ogg"];
}
public static function loadSoundFromDescription(desc: Dynamic, done: kha.Sound->Void, failed: AssetError->Void) {}
public static function getVideoFormats(): Array<String> {
return ["mp4", "webm"];
}
public static function loadVideoFromDescription(desc: Dynamic, done: kha.Video->Void, failed: AssetError->Void): Void {}
public static function loadBlobFromDescription(desc: Dynamic, done: Blob->Void, failed: AssetError->Void) {}
public static function loadFontFromDescription(desc: Dynamic, done: Font->Void, failed: AssetError->Void): Void {}
}

View File

@ -0,0 +1,15 @@
package kha;
import haxe.io.Bytes;
import haxe.io.BytesBuffer;
import haxe.io.BytesData;
class Storage {
public static function namedFile(name: String): StorageFile {
return null;
}
public static function defaultFile(): StorageFile {
return namedFile("default.kha");
}
}

View File

@ -0,0 +1,139 @@
package kha;
import kha.graphics4.TextureFormat;
import kha.input.Gamepad;
import kha.input.Keyboard;
import kha.input.Mouse;
import kha.input.MouseImpl;
import kha.input.Surface;
import kha.System;
class SystemImpl {
public static function init(options: SystemOptions, callback: Window->Void): Void {}
public static function getScreenRotation(): ScreenRotation {
return ScreenRotation.RotationNone;
}
public static function getTime(): Float {
return 0;
}
public static function windowWidth(id: Int): Int {
return 640;
}
public static function windowHeight(id: Int): Int {
return 480;
}
public static function screenDpi(): Int {
return 96;
}
public static function getVsync(): Bool {
return true;
}
public static function getRefreshRate(): Int {
return 60;
}
public static function getSystemId(): String {
return "Empty";
}
public static function vibrate(ms: Int): Void {}
public static function getLanguage(): String {
return "en";
}
public static function requestShutdown(): Bool {
return true;
}
public static function getMouse(num: Int): Mouse {
return null;
}
public static function getKeyboard(num: Int): Keyboard {
return null;
}
public static function lockMouse(): Void {}
public static function unlockMouse(): Void {}
public static function canLockMouse(): Bool {
return false;
}
public static function isMouseLocked(): Bool {
return false;
}
public static function notifyOfMouseLockChange(func: Void->Void, error: Void->Void): Void {}
public static function removeFromMouseLockChange(func: Void->Void, error: Void->Void): Void {}
static function unload(): Void {}
public static function canSwitchFullscreen(): Bool {
return false;
}
public static function isFullscreen(): Bool {
return false;
}
public static function requestFullscreen(): Void {}
public static function exitFullscreen(): Void {}
public static function notifyOfFullscreenChange(func: Void->Void, error: Void->Void): Void {}
public static function removeFromFullscreenChange(func: Void->Void, error: Void->Void): Void {}
public static function changeResolution(width: Int, height: Int): Void {}
public static function setKeepScreenOn(on: Bool): Void {}
public static function loadUrl(url: String): Void {}
public static function getGamepadId(index: Int): String {
return "unknown";
}
public static function getGamepadVendor(index: Int): String {
return "unknown";
}
public static function setGamepadRumble(index: Int, leftAmount: Float, rightAmount: Float) {}
public static function getPen(num: Int): kha.input.Pen {
return null;
}
public static function safeZone(): Float {
return 1.0;
}
public static function login(): Void {}
public static function automaticSafeZone(): Bool {
return true;
}
public static function setSafeZone(value: Float): Void {}
public static function unlockAchievement(id: Int): Void {}
public static function waitingForLogin(): Bool {
return false;
}
public static function disallowUserChange(): Void {}
public static function allowUserChange(): Void {}
}

View File

@ -0,0 +1,134 @@
package kha;
class Window {
static var windows: Array<Window> = [];
var defaultWidth: Int;
var defaultHeight: Int;
@:noCompletion
@:noDoc
public function new(defaultWidth: Int, defaultHeight: Int) {
windows.push(this);
}
public static function create(win: WindowOptions = null, frame: FramebufferOptions = null): Window {
return null;
}
public static function destroy(window: Window): Void {}
public static function get(index: Int): Window {
return windows[index];
}
public static var all(get, never): Array<Window>;
static function get_all(): Array<Window> {
return windows;
}
public function resize(width: Int, height: Int): Void {}
public function move(x: Int, y: Int): Void {}
public function changeWindowFeatures(features: Int): Void {}
public function changeFramebuffer(frame: FramebufferOptions): Void {}
public var x(get, set): Int;
function get_x(): Int {
return 0;
}
function set_x(value: Int): Int {
return 0;
}
public var y(get, set): Int;
function get_y(): Int {
return 0;
}
function set_y(value: Int): Int {
return 0;
}
public var width(get, set): Int;
function get_width(): Int {
return 800;
}
function set_width(value: Int): Int {
return 800;
}
public var height(get, set): Int;
function get_height(): Int {
return 600;
}
function set_height(value: Int): Int {
return 600;
}
public var mode(get, set): WindowMode;
function get_mode(): WindowMode {
return Windowed;
}
function set_mode(mode: WindowMode): WindowMode {
if (mode == Fullscreen || mode == ExclusiveFullscreen) {
if (!isFullscreen()) {
requestFullscreen();
}
}
else {
if (isFullscreen()) {
exitFullscreen();
}
}
return mode;
}
function isFullscreen(): Bool {
return false;
}
function requestFullscreen(): Void {}
function exitFullscreen(): Void {}
public var visible(get, set): Bool;
function get_visible(): Bool {
return true;
}
function set_visible(value: Bool): Bool {
return true;
}
public var title(get, set): String;
function get_title(): String {
return "Kha";
}
function set_title(value: String): String {
return "Kha";
}
public function notifyOnResize(callback: Int->Int->Void): Void {}
public var vSynced(get, never): Bool;
function get_vSynced(): Bool {
return true;
}
}

View File

@ -0,0 +1,153 @@
package kha.arrays;
import kha.FastFloat;
class ByteArray {
public var buffer(get, never): ByteBuffer;
inline function get_buffer(): ByteBuffer {
return null;
}
public function new(buffer: ByteBuffer, ?byteOffset: Int, ?byteLength: Int) {}
static public function make(byteLength: Int): ByteArray {
return null;
}
public var byteLength(get, never): Int;
inline function get_byteLength(): Int {
return 0;
}
public var byteOffset(get, never): Int;
inline function get_byteOffset(): Int {
return 0;
}
public inline function getInt8(byteOffset: Int): Int {
return 0;
}
public inline function getUint8(byteOffset: Int): Int {
return 0;
}
public inline function getInt16(byteOffset: Int): Int {
return 0;
}
public inline function getUint16(byteOffset: Int): Int {
return 0;
}
public inline function getInt32(byteOffset: Int): Int {
return 0;
}
public inline function getUint32(byteOffset: Int): Int {
return 0;
}
public inline function getFloat32(byteOffset: Int): FastFloat {
return 0;
}
public inline function getFloat64(byteOffset: Int): Float {
return 0;
}
public inline function setInt8(byteOffset: Int, value: Int): Void {}
public inline function setUint8(byteOffset: Int, value: Int): Void {}
public inline function setInt16(byteOffset: Int, value: Int): Void {}
public inline function setUint16(byteOffset: Int, value: Int): Void {}
public inline function setInt32(byteOffset: Int, value: Int): Void {}
public inline function setUint32(byteOffset: Int, value: Int): Void {}
public inline function setFloat32(byteOffset: Int, value: FastFloat): Void {}
public inline function setFloat64(byteOffset: Int, value: Float): Void {}
public inline function getInt16LE(byteOffset: Int): Int {
return 0;
}
public inline function getUint16LE(byteOffset: Int): Int {
return 0;
}
public inline function getInt32LE(byteOffset: Int): Int {
return 0;
}
public inline function getUint32LE(byteOffset: Int): Int {
return 0;
}
public inline function getFloat32LE(byteOffset: Int): FastFloat {
return 0;
}
public inline function getFloat64LE(byteOffset: Int): Float {
return 0;
}
public inline function setInt16LE(byteOffset: Int, value: Int): Void {}
public inline function setUint16LE(byteOffset: Int, value: Int): Void {}
public inline function setInt32LE(byteOffset: Int, value: Int): Void {}
public inline function setUint32LE(byteOffset: Int, value: Int): Void {}
public inline function setFloat32LE(byteOffset: Int, value: FastFloat): Void {}
public inline function setFloat64LE(byteOffset: Int, value: Float): Void {}
public inline function getInt16BE(byteOffset: Int): Int {
return 0;
}
public inline function getUint16BE(byteOffset: Int): Int {
return 0;
}
public inline function getInt32BE(byteOffset: Int): Int {
return 0;
}
public inline function getUint32BE(byteOffset: Int): Int {
return 0;
}
public inline function getFloat32BE(byteOffset: Int): FastFloat {
return 0;
}
public inline function getFloat64BE(byteOffset: Int): Float {
return 0;
}
public inline function setInt16BE(byteOffset: Int, value: Int): Void {}
public inline function setUint16BE(byteOffset: Int, value: Int): Void {}
public inline function setInt32BE(byteOffset: Int, value: Int): Void {}
public inline function setUint32BE(byteOffset: Int, value: Int): Void {}
public inline function setFloat32BE(byteOffset: Int, value: FastFloat): Void {}
public inline function setFloat64BE(byteOffset: Int, value: Float): Void {}
public inline function subarray(start: Int, ?end: Int): ByteArray {
return new ByteArray(buffer, start, end != null ? end - start : null);
}
}

View File

@ -0,0 +1,9 @@
package kha.arrays;
class ByteBuffer {
public static function create(length: Int): ByteBuffer {
return null;
}
function new(length: Int) {}
}

View File

@ -0,0 +1,23 @@
package kha.audio1;
import kha.Sound;
class Audio {
/**
* Plays a sound immediately.
* @param sound
* The sound to play
* @param loop
* Whether or not to automatically loop the sound
* @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.
*/
public static function play(sound: Sound, loop: Bool = false): AudioChannel {
return null;
}
public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel {
return null;
}
public static function _playAgain(channel: kha.audio2.AudioChannel): Void {}
}

View File

@ -0,0 +1,14 @@
package kha.audio2;
import kha.Sound;
import kha.internal.IntBox;
class Audio {
public static var disableGcInteractions = false;
public static var samplesPerSecond: Int;
public static var audioCallback: IntBox->Buffer->Void;
public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel {
return null;
}
}

View File

@ -0,0 +1,47 @@
package kha.graphics4;
import haxe.io.Bytes;
class CubeMap implements Canvas implements Resource {
public static function createRenderTarget(size: Int, format: TextureFormat = null, depthStencil: DepthStencilFormat = null): CubeMap {
return null;
}
public function unload(): Void {}
public function lock(level: Int = 0): Bytes {
return null;
}
public function unlock(): Void {}
public var width(get, never): Int;
function get_width(): Int {
return 0;
}
public var height(get, never): Int;
function get_height(): Int {
return 0;
}
public var g1(get, never): kha.graphics1.Graphics;
function get_g1(): kha.graphics1.Graphics {
return null;
}
public var g2(get, never): kha.graphics2.Graphics;
function get_g2(): kha.graphics2.Graphics {
return null;
}
public var g4(get, never): kha.graphics4.Graphics;
function get_g4(): kha.graphics4.Graphics {
return null;
}
}

View File

@ -0,0 +1,19 @@
package kha.graphics4;
class FragmentShader {
public var sources: Array<String>;
public var type: Dynamic;
public var shader: Dynamic;
public var files: Array<String>;
public function new(sources: Array<Blob>, files: Array<String>) {}
public static function fromSource(source: String): FragmentShader {
return null;
}
public function delete(): Void {
shader = null;
sources = null;
}
}

View File

@ -0,0 +1,19 @@
package kha.graphics4;
import kha.graphics4.Usage;
class IndexBuffer {
public function new(indexCount: Int, usage: Usage, canRead: Bool = false) {}
public function lock(?start: Int, ?count: Int): Array<Int> {
return null;
}
public function unlock(?count: Int): Void {}
public function set(): Void {}
public function count(): Int {
return 0;
}
}

View File

@ -0,0 +1,24 @@
package kha.graphics4;
import kha.graphics4.FragmentShader;
import kha.graphics4.VertexData;
import kha.graphics4.VertexShader;
import kha.graphics4.VertexStructure;
class PipelineState extends PipelineStateBase {
public function new() {
super();
}
public function compile(): Void {}
public function set(): Void {}
public function getConstantLocation(name: String): kha.graphics4.ConstantLocation {
return null;
}
public function getTextureUnit(name: String): kha.graphics4.TextureUnit {
return null;
}
}

View File

@ -0,0 +1,28 @@
package kha.graphics4;
import kha.arrays.Float32Array;
import kha.graphics4.Usage;
import kha.graphics4.VertexStructure;
import kha.graphics4.VertexData;
class VertexBuffer {
public function new(vertexCount: Int, structure: VertexStructure, usage: Usage, instanceDataStepRate: Int = 0, canRead: Bool = false) {}
public function lock(?start: Int, ?count: Int): Float32Array {
return null;
}
public function unlock(?count: Int): Void {}
public function stride(): Int {
return 0;
}
public function count(): Int {
return 0;
}
public function set(offset: Int): Int {
return 0;
}
}

View File

@ -0,0 +1,19 @@
package kha.graphics4;
class VertexShader {
public var sources: Array<String>;
public var type: Dynamic;
public var shader: Dynamic;
public var files: Array<String>;
public function new(sources: Array<Blob>, files: Array<String>) {}
public static function fromSource(source: String): FragmentShader {
return null;
}
public function delete(): Void {
shader = null;
sources = null;
}
}

View File

@ -0,0 +1,7 @@
package kha.input;
class MouseImpl extends kha.input.Mouse {
public function new() {
super();
}
}

View File

@ -0,0 +1,11 @@
package kha.netsync;
import haxe.io.Bytes;
class Network {
public function new(url: String, port: Int, errorCallback: Void->Void, closeCallback: Void->Void) {}
public function send(bytes: Bytes, mandatory: Bool): Void {}
public function listen(listener: Bytes->Void): Void {}
}

View File

@ -0,0 +1,8 @@
package kha.network;
import haxe.io.Bytes;
class Http {
public static function request(url: String, path: String, data: String, port: Int, secure: Bool, method: HttpMethod, headers: Map<String, String>,
callback: Int->Int->String->Void /*error, response, body*/): Void {}
}