forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
54
Kha/Backends/Node/kha/js/EmptyFont.hx
Normal file
54
Kha/Backends/Node/kha/js/EmptyFont.hx
Normal file
@ -0,0 +1,54 @@
|
||||
package kha.js;
|
||||
|
||||
import kha.Font;
|
||||
import kha.FontStyle;
|
||||
|
||||
class EmptyFont implements Font {
|
||||
var myName: String;
|
||||
var myStyle: FontStyle;
|
||||
var mySize: Float;
|
||||
|
||||
public function new(name: String, style: FontStyle, size: Float) {
|
||||
myName = name;
|
||||
myStyle = style;
|
||||
mySize = size;
|
||||
}
|
||||
|
||||
public var name(get, never): String;
|
||||
|
||||
function get_name(): String {
|
||||
return myName;
|
||||
}
|
||||
|
||||
public var style(get, never): FontStyle;
|
||||
|
||||
function get_style(): FontStyle {
|
||||
return myStyle;
|
||||
}
|
||||
|
||||
public var size(get, never): Float;
|
||||
|
||||
function get_size(): Float {
|
||||
return mySize;
|
||||
}
|
||||
|
||||
public function getHeight(): Float {
|
||||
return mySize;
|
||||
}
|
||||
|
||||
public function charWidth(ch: String): Float {
|
||||
return mySize / 2;
|
||||
}
|
||||
|
||||
public function charsWidth(ch: String, offset: Int, length: Int): Float {
|
||||
return mySize / 2 * length;
|
||||
}
|
||||
|
||||
public function stringWidth(str: String): Float {
|
||||
return mySize / 2 * str.length;
|
||||
}
|
||||
|
||||
public function getBaselinePosition(): Float {
|
||||
return mySize / 3 * 2;
|
||||
}
|
||||
}
|
13
Kha/Backends/Node/kha/js/EmptyGraphics1.hx
Normal file
13
Kha/Backends/Node/kha/js/EmptyGraphics1.hx
Normal file
@ -0,0 +1,13 @@
|
||||
package kha.js;
|
||||
|
||||
import kha.graphics1.Graphics;
|
||||
|
||||
class EmptyGraphics1 implements Graphics {
|
||||
public function new(width: Int, height: Int) {}
|
||||
|
||||
public function begin(): Void {}
|
||||
|
||||
public function end(): Void {}
|
||||
|
||||
public function setPixel(x: Int, y: Int, color: Color): Void {}
|
||||
}
|
42
Kha/Backends/Node/kha/js/EmptyGraphics2.hx
Normal file
42
Kha/Backends/Node/kha/js/EmptyGraphics2.hx
Normal file
@ -0,0 +1,42 @@
|
||||
package kha.js;
|
||||
|
||||
import js.Browser;
|
||||
import kha.Color;
|
||||
import kha.FontStyle;
|
||||
import kha.graphics2.Graphics;
|
||||
import kha.Kravur;
|
||||
import kha.math.Matrix3;
|
||||
import kha.Rotation;
|
||||
|
||||
class EmptyGraphics2 extends Graphics {
|
||||
var width: Int;
|
||||
var height: Int;
|
||||
var myColor: Color;
|
||||
var myFont: kha.Font;
|
||||
|
||||
static var instance: EmptyGraphics2;
|
||||
|
||||
public function new(width: Int, height: Int) {
|
||||
super();
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
instance = this;
|
||||
myColor = Color.fromBytes(0, 0, 0);
|
||||
}
|
||||
|
||||
override function set_color(color: Color): Color {
|
||||
return myColor = color;
|
||||
}
|
||||
|
||||
override function get_color(): Color {
|
||||
return myColor;
|
||||
}
|
||||
|
||||
override function set_font(font: kha.Font): kha.Font {
|
||||
return myFont = font;
|
||||
}
|
||||
|
||||
override function get_font(): kha.Font {
|
||||
return myFont;
|
||||
}
|
||||
}
|
147
Kha/Backends/Node/kha/js/EmptyGraphics4.hx
Normal file
147
Kha/Backends/Node/kha/js/EmptyGraphics4.hx
Normal file
@ -0,0 +1,147 @@
|
||||
package kha.js;
|
||||
|
||||
import kha.arrays.Float32Array;
|
||||
import kha.graphics4.BlendingOperation;
|
||||
import kha.graphics4.CompareMode;
|
||||
import kha.graphics4.ConstantLocation;
|
||||
import kha.graphics4.CubeMap;
|
||||
import kha.graphics4.CullMode;
|
||||
import kha.graphics4.Graphics;
|
||||
import kha.graphics4.IndexBuffer;
|
||||
import kha.graphics4.MipMapFilter;
|
||||
import kha.graphics4.PipelineState;
|
||||
import kha.graphics4.StencilAction;
|
||||
import kha.graphics4.TextureAddressing;
|
||||
import kha.graphics4.TextureFilter;
|
||||
import kha.graphics4.TextureFormat;
|
||||
import kha.graphics4.TextureUnit;
|
||||
import kha.graphics4.Usage;
|
||||
import kha.graphics4.VertexBuffer;
|
||||
import kha.math.FastMatrix3;
|
||||
import kha.math.FastMatrix4;
|
||||
import kha.math.FastVector2;
|
||||
import kha.math.FastVector3;
|
||||
import kha.math.FastVector4;
|
||||
import kha.math.Matrix4;
|
||||
import kha.math.Vector2;
|
||||
import kha.math.Vector3;
|
||||
import kha.math.Vector4;
|
||||
|
||||
class EmptyGraphics4 implements Graphics {
|
||||
public function new(width: Int, height: Int) {}
|
||||
|
||||
public function init(?backbufferFormat: TextureFormat, antiAliasingSamples: Int = 1): Void {}
|
||||
|
||||
public function begin(additionalRenderTargets: Array<Canvas> = null): Void {}
|
||||
|
||||
public function beginFace(face: Int): Void {}
|
||||
|
||||
public function beginEye(eye: Int): Void {}
|
||||
|
||||
public function end(): Void {}
|
||||
|
||||
public function flush(): Void {}
|
||||
|
||||
public function vsynced(): Bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function refreshRate(): Int {
|
||||
return 60;
|
||||
}
|
||||
|
||||
public function maxBoundTextures(): Int {
|
||||
return 8;
|
||||
}
|
||||
|
||||
public function clear(?color: Color, ?depth: Float, ?stencil: Int): Void {}
|
||||
|
||||
public function viewport(x: Int, y: Int, width: Int, height: Int): Void {}
|
||||
|
||||
public function setCullMode(mode: CullMode): Void {}
|
||||
|
||||
public function setDepthMode(write: Bool, mode: CompareMode): Void {}
|
||||
|
||||
public function setBlendingMode(source: BlendingOperation, destination: BlendingOperation): Void {}
|
||||
|
||||
public function setStencilParameters(compareMode: CompareMode, bothPass: StencilAction, depthFail: StencilAction, stencilFail: StencilAction,
|
||||
referenceValue: Int, readMask: Int = 0xff, writeMask: Int = 0xff): Void {}
|
||||
|
||||
public function setStencilReferenceValue(value: Int) {}
|
||||
|
||||
public function scissor(x: Int, y: Int, width: Int, height: Int): Void {}
|
||||
|
||||
public function disableScissor(): Void {}
|
||||
|
||||
public function setVertexBuffer(vertexBuffer: VertexBuffer): Void {}
|
||||
|
||||
public function setVertexBuffers(vertexBuffers: Array<kha.graphics4.VertexBuffer>): Void {}
|
||||
|
||||
public function setIndexBuffer(indexBuffer: IndexBuffer): Void {}
|
||||
|
||||
public function setTexture(unit: TextureUnit, texture: Image): Void {}
|
||||
|
||||
public function setTextureArray(unit: TextureUnit, texture: kha.Image): Void {}
|
||||
|
||||
public function setTextureDepth(unit: TextureUnit, texture: Image): Void {}
|
||||
|
||||
public function setVideoTexture(unit: kha.graphics4.TextureUnit, texture: kha.Video): Void {}
|
||||
|
||||
public function setImageTexture(unit: kha.graphics4.TextureUnit, texture: kha.Image): Void {}
|
||||
|
||||
public function setTextureParameters(texunit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing,
|
||||
minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void {}
|
||||
|
||||
public function setTexture3DParameters(texunit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing,
|
||||
wAddressing: TextureAddressing, minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void {}
|
||||
|
||||
public function setTextureCompareMode(texunit: TextureUnit, enabled: Bool): Void {}
|
||||
|
||||
public function setCubeMapCompareMode(texunit: TextureUnit, enabled: Bool): Void {}
|
||||
|
||||
public function setCubeMap(stage: kha.graphics4.TextureUnit, cubeMap: kha.graphics4.CubeMap): Void {}
|
||||
|
||||
public function setCubeMapDepth(stage: kha.graphics4.TextureUnit, cubeMap: kha.graphics4.CubeMap): Void {}
|
||||
|
||||
public function setPipeline(pipeline: PipelineState): Void {}
|
||||
|
||||
public function setBool(location: ConstantLocation, value: Bool): Void {}
|
||||
|
||||
public function setInt(location: ConstantLocation, value: Int): Void {}
|
||||
|
||||
public function setInt2(location: ConstantLocation, value1: Int, value2: Int): Void {}
|
||||
|
||||
public function setInt3(location: ConstantLocation, value1: Int, value2: Int, value3: Int): Void {}
|
||||
|
||||
public function setInt4(location: ConstantLocation, value1: Int, value2: Int, value3: Int, value4: Int): Void {}
|
||||
|
||||
public function setInts(location: ConstantLocation, values: kha.arrays.Int32Array): Void {}
|
||||
|
||||
public function setFloat(location: ConstantLocation, value: Float): Void {}
|
||||
|
||||
public function setFloat2(location: ConstantLocation, value1: Float, value2: Float): Void {}
|
||||
|
||||
public function setFloat3(location: ConstantLocation, value1: Float, value2: Float, value3: Float): Void {}
|
||||
|
||||
public function setFloat4(location: ConstantLocation, value1: Float, value2: Float, value3: Float, value4: Float): Void {}
|
||||
|
||||
public function setFloats(location: ConstantLocation, floats: Float32Array): Void {}
|
||||
|
||||
public function setVector2(location: ConstantLocation, value: FastVector2): Void {}
|
||||
|
||||
public function setVector3(location: ConstantLocation, value: FastVector3): Void {}
|
||||
|
||||
public function setVector4(location: ConstantLocation, value: FastVector4): Void {}
|
||||
|
||||
public function setMatrix(location: ConstantLocation, value: FastMatrix4): Void {}
|
||||
|
||||
public function setMatrix3(location: ConstantLocation, value: FastMatrix3): Void {}
|
||||
|
||||
public function drawIndexedVertices(start: Int = 0, count: Int = -1): Void {}
|
||||
|
||||
public function instancedRenderingAvailable(): Bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function drawIndexedVerticesInstanced(instanceCount: Int, start: Int = 0, count: Int = -1): Void {}
|
||||
}
|
22
Kha/Backends/Node/kha/js/Mouse.hx
Normal file
22
Kha/Backends/Node/kha/js/Mouse.hx
Normal file
@ -0,0 +1,22 @@
|
||||
package kha.js;
|
||||
|
||||
import js.Browser;
|
||||
import js.html.CanvasElement;
|
||||
import kha.Cursor;
|
||||
import kha.Image;
|
||||
|
||||
class Mouse extends kha.Mouse {
|
||||
public static var SystemCursor: String = "default";
|
||||
|
||||
public static function UpdateSystemCursor() {}
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
}
|
||||
|
||||
override function hideSystemCursor(): Void {}
|
||||
|
||||
override function showSystemCursor(): Void {}
|
||||
|
||||
override public function update(): Void {}
|
||||
}
|
16
Kha/Backends/Node/kha/js/Music.hx
Normal file
16
Kha/Backends/Node/kha/js/Music.hx
Normal file
@ -0,0 +1,16 @@
|
||||
package kha.js;
|
||||
|
||||
import js.Browser;
|
||||
import js.html.AudioElement;
|
||||
import js.html.ErrorEvent;
|
||||
import js.html.Event;
|
||||
import js.html.MediaError;
|
||||
import js.Lib;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class Music extends kha.Music {
|
||||
public function new() {
|
||||
super();
|
||||
}
|
||||
}
|
31
Kha/Backends/Node/kha/js/Sound.hx
Normal file
31
Kha/Backends/Node/kha/js/Sound.hx
Normal file
@ -0,0 +1,31 @@
|
||||
package kha.js;
|
||||
|
||||
class SoundChannel extends kha.SoundChannel {
|
||||
public function new() {
|
||||
super();
|
||||
}
|
||||
|
||||
override public function play(): Void {
|
||||
super.play();
|
||||
}
|
||||
|
||||
override public function pause(): Void {}
|
||||
|
||||
override public function stop(): Void {
|
||||
super.stop();
|
||||
}
|
||||
|
||||
override public function getCurrentPos(): Int {
|
||||
return 0;
|
||||
}
|
||||
|
||||
override public function getLength(): Int {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
class Sound extends kha.Sound {
|
||||
public function new() {
|
||||
super();
|
||||
}
|
||||
}
|
7
Kha/Backends/Node/kha/js/Video.hx
Normal file
7
Kha/Backends/Node/kha/js/Video.hx
Normal file
@ -0,0 +1,7 @@
|
||||
package kha.js;
|
||||
|
||||
class Video extends kha.Video {
|
||||
public function new() {
|
||||
super();
|
||||
}
|
||||
}
|
5
Kha/Backends/Node/kha/js/graphics4/ConstantLocation.hx
Normal file
5
Kha/Backends/Node/kha/js/graphics4/ConstantLocation.hx
Normal file
@ -0,0 +1,5 @@
|
||||
package kha.js.graphics4;
|
||||
|
||||
class ConstantLocation implements kha.graphics4.ConstantLocation {
|
||||
public function new() {}
|
||||
}
|
5
Kha/Backends/Node/kha/js/graphics4/TextureUnit.hx
Normal file
5
Kha/Backends/Node/kha/js/graphics4/TextureUnit.hx
Normal file
@ -0,0 +1,5 @@
|
||||
package kha.js.graphics4;
|
||||
|
||||
class TextureUnit implements kha.graphics4.TextureUnit {
|
||||
public function new() {}
|
||||
}
|
Reference in New Issue
Block a user