Jelajahi Sumber

more api documentation for base classes

Nicolas Cannasse 7 tahun lalu
induk
melakukan
64f6cd720b
9 mengubah file dengan 294 tambahan dan 13 penghapusan
  1. 39 1
      h2d/Anim.hx
  2. 10 0
      h2d/Bitmap.hx
  3. 50 0
      h2d/Drawable.hx
  4. 5 0
      h2d/Object.hx
  5. 79 2
      h2d/Scene.hx
  6. 39 1
      h3d/prim/Primitive.hx
  7. 24 6
      h3d/scene/Mesh.hx
  8. 5 0
      h3d/scene/Object.hx
  9. 43 3
      h3d/scene/Scene.hx

+ 39 - 1
h2d/Anim.hx

@@ -1,11 +1,34 @@
 package h2d;
 
+/**
+	h2d.Anim is used to display an animated sequence of bitmap tiles on the screen.
+**/
 class Anim extends Drawable {
 
-	public var frames : Array<Tile>;
+	/**
+		The current animation, as a list of tile frames to display.
+		If the frames are empty or if a tile is frames is null, a pink 5x5 bitmap will be displayed instead. Use remove() or visible=false to hide a h2d.Anim
+	**/
+	public var frames(default,null) : Array<Tile>;
+
+	/**
+		The current frame the animation is currently playing. Always in `[0,frames.length]` range
+	**/
 	public var currentFrame(get,set) : Float;
+
+	/**
+		The speed (in frames per second) at which the animation is playing (default 15.)
+	**/
 	public var speed : Float;
+
+	/**
+		Setting pause will pause the animation, preventing any automatic change to currentFrame.
+	**/
 	public var pause : Bool = false;
+
+	/**
+		Disabling loop will stop the animation at the last frame (default : true)
+	**/
 	public var loop : Bool = true;
 
 	/**
@@ -14,8 +37,12 @@ class Anim extends Drawable {
 		This can be used to have smoother animation on some effects.
 	**/
 	public var fading : Bool = false;
+
 	var curFrame : Float;
 
+	/**
+		Create a new animation with the specified frames, speed and parent object
+	**/
 	public function new( ?frames : Array<Tile>, ?speed : Float, ?parent : h2d.Object ) {
 		super(parent);
 		this.frames = frames == null ? [] : frames;
@@ -27,12 +54,20 @@ class Anim extends Drawable {
 		return curFrame;
 	}
 
+	/**
+		Change the currently playing animation and unset the pause if it was set.
+	**/
 	public function play( frames : Array<Tile>, atFrame = 0. ) {
 		this.frames = frames == null ? [] : frames;
 		currentFrame = atFrame;
 		pause = false;
 	}
 
+	/**
+		onAnimEnd is automatically called each time the animation will reach past the last frame.
+		If loop is true, it is called everytime the animation loops.
+		If loop is false, it is called once when the animation reachs `currentFrame == frames.length`
+	**/
 	public dynamic function onAnimEnd() {
 	}
 
@@ -67,6 +102,9 @@ class Anim extends Drawable {
 		}
 	}
 
+	/**
+		Return the tile at current frame.
+	**/
 	public function getFrame() : Tile {
 		var i = Std.int(curFrame);
 		if( i == frames.length ) i--;

+ 10 - 0
h2d/Bitmap.hx

@@ -1,9 +1,19 @@
 package h2d;
 
+/**
+	h2d.Bitmap is used to display a single bitmap Tile on the screen.
+**/
 class Bitmap extends Drawable {
 
+	/**
+		The tile to display see `h2d.Tile` documentation for details.
+		If the tile is null, a pink 5x5 bitmap will be displayed instead. Use remove() or visible=false to hide a h2d.Bitmap
+	**/
 	public var tile : Tile;
 
+	/**
+		Create a Bitmap with specified tile and parent object.
+	**/
 	public function new( ?tile : Tile, ?parent : h2d.Object ) {
 		super(parent);
 		this.tile = tile;

+ 50 - 0
h2d/Drawable.hx

@@ -8,14 +8,46 @@ typedef ColorAdjust = {
 	?gain : { color : Int, alpha : Float },
 };
 
+/**
+	h2d.Drawable is the base class for all 2D objects that will draw something on screen.
+	Unlike Object base class, all properties of Drawable only apply to the current object and are not inherited by its children.
+**/
 class Drawable extends Object {
 
+	/**
+		The color multiplier for the object. Can be used to adjust individually each of the four channels R,G,B,A (default [1,1,1,1])
+	**/
 	public var color(default,default) : h3d.Vector;
+
+	/**
+		The blendMode of the object (default Alpha)
+	**/
 	public var blendMode : BlendMode;
+
+	/**
+		By enabling smoothing, scaling the object up or down will use hardware bilinear filtering resulting in less crisp aspect.
+		By default smooth is null and then Scene.defaultSmooth value is used.
+	**/
 	public var smooth : Null<Bool>;
+
+	/**
+		By enabling tile wrapping, you can have tiles which size exceed the texture size and will repeat instead of displaying clamped pixels.
+	**/
 	public var tileWrap(default, set) : Bool;
+
+	/**
+		Setting a colorKey color value will discard all pixels that have this exact color in the tile.
+	**/
 	public var colorKey(default, set) : Null<Int>;
+
+	/**
+		Setting a colorMatrix will apply a color transformation. See also `adjustColor`.
+	**/
 	public var colorMatrix(get, set) : Null<h3d.Matrix>;
+
+	/**
+		Setting colorAdd will add the amount of color of each channel R,G,B,A to the object pixels.
+	**/
 	public var colorAdd(get, set) : Null<h3d.Vector>;
 
 	var shaders : hxsl.ShaderList;
@@ -65,6 +97,9 @@ class Drawable extends Object {
 		return colorKey = v;
 	}
 
+	/**
+		Set the `colorMatrix` value by specifying which effects to apply. Calling adjustColor() reset the colorMatrix to `null`
+	**/
 	public function adjustColor( ?col : ColorAdjust ) : Void {
 		if( col == null )
 			colorMatrix = null;
@@ -104,6 +139,9 @@ class Drawable extends Object {
 		return m;
 	}
 
+	/**
+		Return the built shader code, can be used for debugging shader assembly
+	**/
 	public function getDebugShaderCode( toHxsl = true ) {
 		var shader = @:privateAccess {
 			var ctx = getScene().ctx;
@@ -117,6 +155,9 @@ class Drawable extends Object {
 		}
 	}
 
+	/**
+		Return the first shader of the given shader class among the object shaders
+	**/
 	public function getShader< T:hxsl.Shader >( stype : Class<T> ) : T {
 		if (shaders != null) for( s in shaders ) {
 			var s = Std.instance(s, stype);
@@ -126,16 +167,25 @@ class Drawable extends Object {
 		return null;
 	}
 
+	/**
+		Return all object shaders
+	**/
 	public inline function getShaders() {
 		return shaders.iterator();
 	}
 
+	/**
+		Add a shader to the object shaders
+	**/
 	public function addShader<T:hxsl.Shader>( s : T ) : T {
 		if( s == null ) throw "Can't add null shader";
 		shaders = hxsl.ShaderList.addSort(s, shaders);
 		return s;
 	}
 
+	/**
+		Remove a shader from the object shaders, returns true if found or false if it was not part of our shaders.
+	**/
 	public function removeShader( s : hxsl.Shader ) {
 		var prev = null, cur = shaders;
 		while( cur != null ) {

+ 5 - 0
h2d/Object.hx

@@ -1,6 +1,11 @@
 package h2d;
 import hxd.Math;
 
+/**
+	h2d.Object is the base 2D class that all scene tree elements inherit from.
+	It can be used to create a virtual container that does not display anything but can contain other objects
+	so the various transforms are inherited to its children.
+**/
 @:allow(h2d.Tools)
 class Object {
 

+ 79 - 2
h2d/Scene.hx

@@ -1,16 +1,45 @@
 package h2d;
 import hxd.Math;
 
+/**
+	h2d.Scene is the root class for a 2D scene. All root objects are added to it before being drawn on screen.
+**/
 class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.InteractiveScene {
 
+	/**
+		The current width (in pixels) of the scene. Can change if the screen gets resized.
+	**/
 	public var width(default,null) : Int;
+
+	/**
+		The current height (in pixels) of the scene. Can change if the screen gets resized.
+	**/
 	public var height(default, null) : Int;
 
+	/**
+		The current mouse X coordinates (in pixel) relative to the scene.
+	**/
 	public var mouseX(get, null) : Float;
+
+	/**
+		The current mouse Y coordinates (in pixel) relative to the scene.
+	**/
 	public var mouseY(get, null) : Float;
 
+	/**
+		The zoom factor of the scene, allows to set a fixed x2, x4 etc. zoom for pixel art
+		When setting a zoom > 0, the scene resize will be automaticaly managed.
+	**/
 	public var zoom(get, set) : Int;
+
+	/**
+		Set the default value for `h2d.Drawable.smooth` (default: false)
+	**/
 	public var defaultSmooth(get, set) : Bool;
+
+	/**
+		The scene current renderer. Can be customized.
+	**/
 	public var renderer(get, set) : RenderContext;
 
 	var fixedSize : Bool;
@@ -21,6 +50,9 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	@:allow(h2d.Interactive)
 	var events : hxd.SceneEvents;
 
+	/**
+		Create a new scene. A default 2D scene is already available in `hxd.App.s2d`
+	**/
 	public function new() {
 		super(null);
 		var e = h3d.Engine.getCurrent();
@@ -36,6 +68,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	inline function get_defaultSmooth() return ctx.defaultSmooth;
 	inline function set_defaultSmooth(v) return ctx.defaultSmooth = v;
 
+	@:dox(hide) @:noCompletion
 	public function setEvents(events : hxd.SceneEvents) {
 		this.events = events;
 	}
@@ -60,6 +93,9 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	function get_renderer() return ctx;
 	function set_renderer(v) { ctx = v; return v; }
 
+	/**
+		Set the fixed size for the scene, will prevent automatic scene resizing when screen size changes.
+	**/
 	public function setFixedSize( w : Int, h : Int ) {
 		width = w;
 		height = h;
@@ -67,6 +103,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		posChanged = true;
 	}
 
+	@:dox(hide) @:noCompletion
 	public function checkResize() {
 		if( fixedSize ) return;
 		var engine = h3d.Engine.getCurrent();
@@ -93,6 +130,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		return screenYToLocal(stage.mouseY);
 	}
 
+	@:dox(hide) @:noCompletion
 	public function dispatchListeners( event : hxd.Event ) {
 		screenToLocal(event);
 		for( l in eventListeners ) {
@@ -101,6 +139,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		}
 	}
 
+	@:dox(hide) @:noCompletion
 	public function isInteractiveVisible( i : hxd.SceneEvents.Interactive ) : Bool {
 		var s : Object = cast i;
 		while( s != null ) {
@@ -110,6 +149,9 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		return true;
 	}
 
+	/**
+		Return the topmost visible Interactive at the specific coordinates
+	**/
 	public function getInteractive( x : Float, y : Float ) : Interactive {
 		var rx = x * matA + y * matB + absX;
 		var ry = x * matC + y * matD + absY;
@@ -166,6 +208,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		e.relY = ry;
 	}
 
+	@:dox(hide) @:noCompletion
 	public function dispatchEvent( event : hxd.Event, to : hxd.SceneEvents.Interactive ) {
 		var i : Interactive = cast to;
 		screenToLocal(event);
@@ -192,6 +235,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		i.handleEvent(event);
 	}
 
+	@:dox(hide) @:noCompletion
 	public function handleEvent( event : hxd.Event, last : hxd.SceneEvents.Interactive ) : hxd.SceneEvents.Interactive {
 		screenToLocal(event);
 		var rx = event.relX;
@@ -253,10 +297,16 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		return null;
 	}
 
+	/**
+		Add an event listener that will capture all events not caught by an h2d.Interactive
+	**/
 	public function addEventListener( f : hxd.Event -> Void ) {
 		eventListeners.push(f);
 	}
 
+	/**
+		Remove a previously added event listener, return false it was not part of our event listeners.
+	**/
 	public function removeEventListener( f : hxd.Event -> Void ) {
 		for( e in eventListeners )
 			if( Reflect.compareMethods(e, f) ) {
@@ -266,17 +316,28 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		return false;
 	}
 
-	public function startDrag( f : hxd.Event -> Void, ?onCancel : Void -> Void, ?refEvent : hxd.Event ) {
+	/**
+		Start a drag and drop operation, sending all events to `onEvent` instead of the scene until `stopDrag()` is called.
+		@param	onCancel	If defined, will be called when stopDrag is called
+		@param	refEvent	For touch events, only capture events that matches the reference event touchId
+	**/
+	public function startDrag( onEvent : hxd.Event -> Void, ?onCancel : Void -> Void, ?refEvent : hxd.Event ) {
 		events.startDrag(function(e) {
 			screenToLocal(e);
-			f(e);
+			onEvent(e);
 		},onCancel, refEvent);
 	}
 
+	/**
+		Stop the current drag and drop operation
+	**/
 	public function stopDrag() {
 		events.stopDrag();
 	}
 
+	/**
+		Get the currently focused Interactive
+	**/
 	public function getFocus() : Interactive {
 		if( events == null )
 			return null;
@@ -348,12 +409,19 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 			@:privateAccess events.onRemove(i);
 	}
 
+	/**
+		Dispose the scene and all its children, freeing used GPU memory
+	**/
 	public function dispose() {
 		if( allocated )
 			onRemove();
 		ctx.dispose();
 	}
 
+	/**
+		Before render() or sync() are called, allow to set how much time has elapsed (in seconds) since the last frame in order to update scene animations.
+		This is managed automatically by hxd.App
+	**/
 	public function setElapsedTime( v : Float ) {
 		ctx.elapsedTime = v;
 	}
@@ -374,6 +442,9 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		ctx.engine.frameCount--;
 	}
 
+	/**
+		Synchronize the scene without rendering, updating all objects and animations by the given amount of time, in seconds.
+	**/
 	public function syncOnly( et : Float ) {
 		var engine = h3d.Engine.getCurrent();
 		setElapsedTime(et);
@@ -384,6 +455,9 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		sync(ctx);
 	}
 
+	/**
+		Render the scene on screen. Internal usage only.
+	**/
 	public function render( engine : h3d.Engine ) {
 		ctx.engine = engine;
 		ctx.frame++;
@@ -407,6 +481,9 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		super.sync(ctx);
 	}
 
+	/**
+		Capture the scene into a texture and render the resulting Bitmap
+	**/
 	public function captureBitmap( ?target : Tile ) {
 		var engine = h3d.Engine.getCurrent();
 		if( target == null ) {

+ 39 - 1
h3d/prim/Primitive.hx

@@ -1,40 +1,72 @@
 package h3d.prim;
 
+/**
+	h3d.prim.Primitive is the base class for all 3D primitives.
+	You can't create an instance of it and need to use one of its subclasses.
+**/
 class Primitive implements hxd.impl.Serializable {
 
+	/**
+		The primitive vertex buffer, holding its vertexes data.
+	**/
 	public var buffer : Buffer;
+
+	/**
+		The primitive indexes buffer, holding its triangles indices.
+	**/
 	public var indexes : Indexes;
 
+	/**
+		The number of triangles the primitive has.
+	**/
 	public function triCount() {
 		return if( indexes != null ) Std.int(indexes.count / 3) else if( buffer == null ) 0 else Std.int(buffer.totalVertices() / 3);
 	}
 
+	/**
+		The number of vertexes the primitive has.
+	**/
 	public function vertexCount() {
 		return 0;
 	}
 
+	/**
+		Return a local collider for the primitive
+	**/
 	public function getCollider() : h3d.col.Collider {
 		throw "not implemented for "+this;
 		return null;
 	}
 
+	/**
+		Return the bounds for the primitive
+	**/
 	public function getBounds() : h3d.col.Bounds {
 		throw "not implemented for "+this;
 		return null;
 	}
 
+	/**
+		Allocate the primitive on GPU. Used for internal usage.
+	**/
 	public function alloc( engine : h3d.Engine ) {
 		throw "not implemented";
 	}
 
+	/**
+		Select the specified sub material before drawin. Used for internal usage.
+	**/
 	public function selectMaterial( material : Int ) {
 	}
 
-	public function buildNormalsDisplay() : Primitive {
+	@:noCompletion public function buildNormalsDisplay() : Primitive {
 		throw "not implemented for "+this;
 		return null;
 	}
 
+	/**
+		Render the primitive. Used for internal usage.
+	**/
 	public function render( engine : h3d.Engine ) {
 		if( buffer == null || buffer.isDisposed() ) alloc(engine);
 		if( indexes == null ) {
@@ -46,6 +78,9 @@ class Primitive implements hxd.impl.Serializable {
 			engine.renderIndexed(buffer,indexes);
 	}
 
+	/**
+		Dispose the primitive, freeing the GPU memory it uses.
+	**/
 	public function dispose() {
 		if( buffer != null ) {
 			buffer.dispose();
@@ -57,6 +92,9 @@ class Primitive implements hxd.impl.Serializable {
 		}
 	}
 
+	/**
+		Return the primitive type.
+	**/
 	public function toString() {
 		return Type.getClassName(Type.getClass(this)).split(".").pop();
 	}

+ 24 - 6
h3d/scene/Mesh.hx

@@ -1,20 +1,38 @@
 package h3d.scene;
 
+/**
+	h3d.scene.Mesh is the base class for all 3D objects displayed on screen.
+	Unlike Object base class, all properties of Mesh only apply to the current object and are not inherited by its children.
+**/
 class Mesh extends Object {
 
+	/**
+		The primitive of the mesh: the list of vertexes and indices necessary to display the mesh.
+	**/
 	public var primitive : h3d.prim.Primitive;
+
+	/**
+		The material of the mesh: the properties used to display it (texture, color, shaders, etc.)
+	**/
 	public var material : h3d.mat.Material;
 
-	public function new( prim, ?mat, ?parent ) {
+	/**
+		Creates a new mesh with given primitive, material and parent object.
+		If material is not specified, a new default material is created for the current renderer.
+	**/
+	public function new( primitive, ?material, ?parent ) {
 		super(parent);
-		this.primitive = prim;
-		if( mat == null ) {
-			mat = h3d.mat.MaterialSetup.current.createMaterial();
-			mat.props = mat.getDefaultProps();
+		this.primitive = primitive;
+		if( material == null ) {
+			material = h3d.mat.MaterialSetup.current.createMaterial();
+			material.props = material.getDefaultProps();
 		}
-		this.material = mat;
+		this.material = material;
 	}
 
+	/**
+		Return all materials for the current object.
+	**/
 	public function getMeshMaterials() {
 		return [material];
 	}

+ 5 - 0
h3d/scene/Object.hx

@@ -24,6 +24,11 @@ package h3d.scene;
 	}
 }
 
+/**
+	h3d.scene.Object is the base 3D class that all scene tree elements inherit from.
+	It can be used to create a virtual container that does not display anything but can contain other objects
+	so the various transforms are inherited to its children.
+**/
 class Object implements hxd.impl.Serializable {
 
 	static inline var ROT2RAD = -0.017453292519943295769236907684886;

+ 43 - 3
h3d/scene/Scene.hx

@@ -1,10 +1,25 @@
 package h3d.scene;
 
+/**
+	h3d.scene.Scene is the root class for a 3D scene. All root objects are added to it before being drawn on screen.
+**/
 class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.InteractiveScene {
 
+	/**
+		The scene current camera.
+	**/
 	public var camera : h3d.Camera;
+
+	/**
+		The scene light system. Can be customized.
+	**/
 	public var lightSystem : LightSystem;
+
+	/**
+		The scene renderer. Can be customized.
+	**/
 	public var renderer(default,set) : Renderer;
+
 	var ctx : RenderContext;
 	var interactives : Array<Interactive>;
 	@:allow(h3d.scene.Interactive)
@@ -13,6 +28,9 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 	var eventListeners : Array<hxd.Event -> Void>;
 	var stage : hxd.Stage;
 
+	/**
+		Create a new scene. A default 3D scene is already available in `hxd.App.s3d`
+	**/
 	public function new() {
 		super(null);
 		stage = hxd.Stage.getInstance();
@@ -29,14 +47,20 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		lightSystem = h3d.mat.MaterialSetup.current.createLightSystem();
 	}
 
-	@:noCompletion public function setEvents(events) {
+	@:noCompletion @:dox(hide) public function setEvents(events) {
 		this.events = events;
 	}
 
+	/**
+		Add an event listener that will capture all events not caught by an h2d.Interactive
+	**/
 	public function addEventListener( f : hxd.Event -> Void ) {
 		eventListeners.push(f);
 	}
 
+	/**
+		Remove a previously added event listener, return false it was not part of our event listeners.
+	**/
 	public function removeEventListener( f : hxd.Event -> Void ) {
 		for( e in eventListeners )
 			if( Reflect.compareMethods(e, f) ) {
@@ -46,6 +70,7 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		return false;
 	}
 
+	@:dox(hide) @:noCompletion
 	public function dispatchListeners(event:hxd.Event) {
 		for( l in eventListeners ) {
 			l(event);
@@ -67,12 +92,14 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		return 1;
 	}
 
+	@:dox(hide) @:noCompletion
 	public function dispatchEvent( event : hxd.Event, to : hxd.SceneEvents.Interactive ) {
 		var i : Interactive = cast to;
 		// TODO : compute relX/Y/Z
 		i.handleEvent(event);
 	}
 
+	@:dox(hide) @:noCompletion
 	public function isInteractiveVisible( i : hxd.SceneEvents.Interactive ) {
 		var o : Object = cast i;
 		while( o != null ) {
@@ -82,6 +109,7 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		return true;
 	}
 
+	@:dox(hide) @:noCompletion
 	public function handleEvent( event : hxd.Event, last : hxd.SceneEvents.Interactive ) {
 
 		if( interactives.length == 0 )
@@ -225,6 +253,10 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 			@:privateAccess events.onRemove(i);
 	}
 
+	/**
+		Before render() or sync() are called, allow to set how much time has elapsed (in seconds) since the last frame in order to update scene animations.
+		This is managed automatically by hxd.App
+	**/
 	public function setElapsedTime( elapsedTime ) {
 		ctx.elapsedTime = elapsedTime;
 	}
@@ -289,7 +321,7 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 	}
 
 	/**
-		Only sync without rendering
+		Synchronize the scene without rendering, updating all objects and animations by the given amount of time, in seconds.
 	**/
 	public function syncOnly( et : Float ) {
 		var engine = h3d.Engine.getCurrent();
@@ -310,6 +342,9 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		ctx.scene = null;
 	}
 
+	/**
+		Perform a rendering with `RendererContext.computingStatic=true`, allowing the computation of static shadow maps, etc.
+	**/
 	public function computeStatic() {
 		var old = ctx.elapsedTime;
 		ctx.elapsedTime = 0;
@@ -319,6 +354,9 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		ctx.elapsedTime = old;
 	}
 
+	/**
+		Render the scene on screen. Internal usage only.
+	**/
 	@:access(h3d.mat.Pass)
 	@:access(h3d.scene.RenderContext)
 	public function render( engine : h3d.Engine ) {
@@ -393,7 +431,9 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 		ctx.engine = null;
 	}
 
-
+	/**
+		Serialize the scene content as HSD bytes (see hxd.fmt.hsd package). Requires -lib hxbit
+	**/
 	public function serializeScene() : haxe.io.Bytes {
 		#if hxbit
 		var s = new hxd.fmt.hsd.Serializer();