Nicolas Cannasse 11 lat temu
rodzic
commit
eefe1f6b6f
2 zmienionych plików z 0 dodań i 188 usunięć
  1. 0 68
      h3d/impl/DebugGL.hx
  2. 0 120
      h3d/impl/NullDriver.hx

+ 0 - 68
h3d/impl/DebugGL.hx

@@ -1,68 +0,0 @@
-package h3d.impl;
-
-#if js
-private typedef GL = js.html.webgl.GL;
-#elseif cpp
-import openfl.gl.GL;
-#end
-
-#if (!macro && (js || cpp))
-@:build(h3d.impl.DebugGL.buildProxy())
-#end
-class DebugGL {
-	
-	
-	#if macro
-	static function buildProxy() {
-		var gl = haxe.macro.Context.getType("GL");
-		var fields = [];
-		var pos = haxe.macro.Context.currentPos();
-		switch( gl ) {
-		case TInst(cl, _):
-			for( f in cl.get().statics.get() ) {
-				var fname = f.name;
-				if( !f.isPublic ) continue;
-				switch( f.kind ) {
-				case FVar(_):
-					if( fname.toUpperCase() == fname )
-						fields.push((macro class { public static var $fname = GL.$fname; } ).fields[0] );
-				case FMethod(_):
-					switch( haxe.macro.Context.follow(f.type) ) {
-					case TFun(args, ret):
-						var eargs = [for( a in args ) macro $i { a.name } ];
-						var expr = if( haxe.macro.TypeTools.toString(haxe.macro.Context.follow(ret)) == "Void" )
-							macro {
-								GL.$fname($a{eargs});
-								haxe.Log.trace($v { fname } + ([$a { eargs } ] : Array<Dynamic>), _pos);
-							};
-						else
-							macro {
-								var r = GL.$fname($a { eargs } );
-								haxe.Log.trace($v{fname} + ([$a{eargs}] : Array<Dynamic>) + "=" + r, _pos);
-								return r;
-							};
-						var fargs = [for( a in args ) { name : a.name, opt : false, type : null, value : null } ];
-						fargs.push( { name : "_pos", opt : true, type : macro : haxe.PosInfos, value : null } );
-						fields.push({
-							name : fname,
-							access : [APublic, AStatic],
-							meta : [],
-							pos : pos,
-							kind : FFun( {
-								ret : null,
-								args : fargs,
-								params : [],
-								expr : expr,
-							}),
-						});
-					default:
-					}
-				}
-			}
-		default:
-		}
-		return fields;
-	}
-	#end
-	
-}

+ 0 - 120
h3d/impl/NullDriver.hx

@@ -1,120 +0,0 @@
-package h3d.impl;
-import h3d.impl.Driver;
-
-class NullDriver extends Driver {
-
-	public var driver : Driver;
-	
-	public function new( driver ) {
-		this.driver = driver;
-	}
-	
-	override function isDisposed() {
-		return driver.isDisposed();
-	}
-	
-	override function dispose() {
-		driver.dispose();
-	}
-
-	override function reset() {
-		driver.reset();
-	}
-
-	override function present() {
-		driver.present();
-	}
-
-	override function clear( r : Float, g : Float, b : Float, a : Float ) {
-		driver.clear(r, g, b, a);
-	}
-	
-	override function getDriverName( details : Bool ) {
-		return "Null Driver - " + driver.getDriverName(details);
-	}
-	
-	override function init( onCreate : Bool -> Void, forceSoftware = false ) {
-		driver.init(onCreate, forceSoftware);
-	}
-
-	override function resize( width : Int, height : Int ) {
-		driver.resize(width, height);
-	}
-
-	override function selectMaterial( mbits : Int ) {
-		driver.selectMaterial(mbits);
-	}
-	
-	override function selectShader( shader : Shader ) : Bool {
-		return driver.selectShader(shader);
-	}
-	
-	override function getShaderInputNames() : Array<String> {
-		return driver.getShaderInputNames();
-	}
-	
-	override function isHardware() {
-		return driver.isHardware();
-	}
-	
-	override function setDebug( b : Bool ) {
-		driver.setDebug(b);
-	}
-	
-	override function allocTexture( t : h3d.mat.Texture ) : Texture {
-		return driver.allocTexture(t);
-	}
-
-	override function allocIndexes( count : Int ) : IndexBuffer {
-		return driver.allocIndexes(count);
-	}
-
-	override function allocVertex( count : Int, stride : Int ) : VertexBuffer {
-		return driver.allocVertex(count,stride);
-	}
-	
-	override function disposeTexture( t : Texture ) {
-		driver.disposeTexture(t);
-	}
-	
-	override function disposeIndexes( i : IndexBuffer ) {
-		driver.disposeIndexes(i);
-	}
-	
-	override function disposeVertex( v : VertexBuffer ) {
-		driver.disposeVertex(v);
-	}
-	
-	override function uploadIndexesBuffer( i : IndexBuffer, startIndice : Int, indiceCount : Int, buf : hxd.IndexBuffer, bufPos : Int ) {
-		driver.uploadIndexesBuffer(i, startIndice, indiceCount, buf, bufPos);
-	}
-
-	override function uploadIndexesBytes( i : IndexBuffer, startIndice : Int, indiceCount : Int, buf : haxe.io.Bytes , bufPos : Int ) {
-		driver.uploadIndexesBytes(i, startIndice, indiceCount, buf, bufPos);
-	}
-	
-	override function uploadVertexBuffer( v : VertexBuffer, startVertex : Int, vertexCount : Int, buf : hxd.FloatBuffer, bufPos : Int ) {
-		driver.uploadVertexBuffer(v, startVertex, vertexCount, buf, bufPos);
-	}
-
-	override function uploadVertexBytes( v : VertexBuffer, startVertex : Int, vertexCount : Int, buf : haxe.io.Bytes, bufPos : Int ) {
-		driver.uploadVertexBytes(v, startVertex, vertexCount, buf, bufPos);
-	}
-	
-	override function uploadTextureBitmap( t : h3d.mat.Texture, bmp : hxd.BitmapData, mipLevel : Int, side : Int ) {
-		driver.uploadTextureBitmap(t, bmp, mipLevel, side);
-	}
-
-	override function uploadTexturePixels( t : h3d.mat.Texture, pixels : hxd.Pixels, mipLevel : Int, side : Int ) {
-		driver.uploadTexturePixels(t, pixels, mipLevel, side);
-	}
-
-	/*
-	public function selectBuffer( buffer : VertexBuffer )
-	public function selectMultiBuffers( buffers : Array<Buffer.BufferOffset> )
-	public function draw( ibuf : IndexBuffer, startIndex : Int, ntriangles : Int )
-	public function setRenderZone( x : Int, y : Int, width : Int, height : Int )
-	public function setRenderTarget( tex : Null<Texture>, useDepth : Bool, clearColor : Int )
-	*/
-	
-}