Tidying constructor calls and passing nmegl reference through ready instead for now

This commit is contained in:
underscorediscovery
2013-06-23 15:20:41 -02:30
parent 7911fae295
commit edf15b6806
4 changed files with 10 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ class ApplicationMain {
//Create the runtime
_nmegl = new NMEGL();
//Create the game class, give it the runtime
_main_ = new ::APP_MAIN::( _nmegl );
_main_ = new ::APP_MAIN::();
var config = {
width : ::WIN_WIDTH::,

View File

@@ -97,16 +97,12 @@ class Main {
private var startTime:Dynamic;
private var vertexPosition:Dynamic;
public function new( _nmegl : NMEGL) {
public function new() {}
lib = _nmegl;
//NOTE : You cannot do anything before creating the actual window, which will call ready() for you when it is done
}
public function ready() {
public function ready( _nmegl : NMEGL ) {
lib = _nmegl;
// Init the shaders and view
init();

View File

@@ -27,15 +27,12 @@ class Main {
private var red_direction : Int = 1;
public function new( _nmegl : NMEGL) {
public function new() { }
lib = _nmegl;
public function ready( _nmegl : NMEGL ) {
//NOTE : You cannot do anything before creating the actual window, which will call ready() for you when it is done
}
public function ready() {
//Store a reference
lib = _nmegl;
// Init the shaders and view
init();

View File

@@ -97,7 +97,7 @@ class NMEGL {
//Tell the host application we are ready
if(host.ready != null) {
host.ready();
host.ready(this);
}
} //on_main_frame_created