forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
47
Kha/Backends/Node/kha/graphics4/CubeMap.hx
Normal file
47
Kha/Backends/Node/kha/graphics4/CubeMap.hx
Normal 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;
|
||||
}
|
||||
}
|
13
Kha/Backends/Node/kha/graphics4/FragmentShader.hx
Normal file
13
Kha/Backends/Node/kha/graphics4/FragmentShader.hx
Normal file
@ -0,0 +1,13 @@
|
||||
package kha.graphics4;
|
||||
|
||||
import kha.Blob;
|
||||
|
||||
class FragmentShader {
|
||||
public function new(sources: Array<Blob>, files: Array<String>) {}
|
||||
|
||||
public static function fromSource(source: String): FragmentShader {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function delete(): Void {}
|
||||
}
|
30
Kha/Backends/Node/kha/graphics4/IndexBuffer.hx
Normal file
30
Kha/Backends/Node/kha/graphics4/IndexBuffer.hx
Normal file
@ -0,0 +1,30 @@
|
||||
package kha.graphics4;
|
||||
|
||||
import kha.graphics4.Usage;
|
||||
|
||||
class IndexBuffer {
|
||||
var data: Array<Int>;
|
||||
var mySize: Int;
|
||||
|
||||
public function new(indexCount: Int, usage: Usage, canRead: Bool = false) {
|
||||
mySize = indexCount;
|
||||
data = new Array<Int>();
|
||||
data[indexCount - 1] = 0;
|
||||
}
|
||||
|
||||
public function delete(): Void {
|
||||
data = null;
|
||||
}
|
||||
|
||||
public function lock(?start: Int, ?count: Int): Array<Int> {
|
||||
return data;
|
||||
}
|
||||
|
||||
public function unlock(?count: Int): Void {}
|
||||
|
||||
public function set(): Void {}
|
||||
|
||||
public function count(): Int {
|
||||
return mySize;
|
||||
}
|
||||
}
|
26
Kha/Backends/Node/kha/graphics4/PipelineState.hx
Normal file
26
Kha/Backends/Node/kha/graphics4/PipelineState.hx
Normal file
@ -0,0 +1,26 @@
|
||||
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 delete(): Void {}
|
||||
|
||||
public function compile(): Void {}
|
||||
|
||||
public function set(): Void {}
|
||||
|
||||
public function getConstantLocation(name: String): kha.graphics4.ConstantLocation {
|
||||
return new kha.js.graphics4.ConstantLocation();
|
||||
}
|
||||
|
||||
public function getTextureUnit(name: String): kha.graphics4.TextureUnit {
|
||||
return new kha.js.graphics4.TextureUnit();
|
||||
}
|
||||
}
|
44
Kha/Backends/Node/kha/graphics4/VertexBuffer.hx
Normal file
44
Kha/Backends/Node/kha/graphics4/VertexBuffer.hx
Normal file
@ -0,0 +1,44 @@
|
||||
package kha.graphics4;
|
||||
|
||||
import kha.arrays.Float32Array;
|
||||
import kha.graphics4.Usage;
|
||||
import kha.graphics4.VertexStructure;
|
||||
import kha.graphics4.VertexData;
|
||||
|
||||
class VertexBuffer {
|
||||
var data: Float32Array;
|
||||
var mySize: Int;
|
||||
var myStride: Int;
|
||||
|
||||
public function new(vertexCount: Int, structure: VertexStructure, usage: Usage, instanceDataStepRate: Int = 0, canRead: Bool = false) {
|
||||
mySize = vertexCount;
|
||||
myStride = 0;
|
||||
for (element in structure.elements) {
|
||||
myStride += VertexData.getStride(element.data);
|
||||
}
|
||||
|
||||
data = new Float32Array(Std.int(vertexCount * myStride / 4));
|
||||
}
|
||||
|
||||
public function delete(): Void {
|
||||
data = null;
|
||||
}
|
||||
|
||||
public function lock(?start: Int, ?count: Int): Float32Array {
|
||||
return data;
|
||||
}
|
||||
|
||||
public function unlock(?count: Int): Void {}
|
||||
|
||||
public function stride(): Int {
|
||||
return myStride;
|
||||
}
|
||||
|
||||
public function count(): Int {
|
||||
return mySize;
|
||||
}
|
||||
|
||||
public function set(offset: Int): Int {
|
||||
return 0;
|
||||
}
|
||||
}
|
13
Kha/Backends/Node/kha/graphics4/VertexShader.hx
Normal file
13
Kha/Backends/Node/kha/graphics4/VertexShader.hx
Normal file
@ -0,0 +1,13 @@
|
||||
package kha.graphics4;
|
||||
|
||||
import kha.Blob;
|
||||
|
||||
class VertexShader {
|
||||
public function new(sources: Array<Blob>, files: Array<String>) {}
|
||||
|
||||
public static function fromSource(source: String): VertexShader {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function delete(): Void {}
|
||||
}
|
Reference in New Issue
Block a user