Tidying constructor calls and passing nmegl reference through ready instead for now
This commit is contained in:
@@ -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::,
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user