File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,13 @@ var cocos2dApp = cc.Application.extend({
40
40
alert ( "Browser doesn't support WebGL" ) ;
41
41
return false ;
42
42
}
43
- // initialize director
44
- var director = cc . Director . getInstance ( ) ;
45
43
46
44
cc . EGLView . getInstance ( ) . resizeWithBrowserSize ( true ) ;
47
45
cc . EGLView . getInstance ( ) . setDesignResolutionSize ( 800 , 450 , cc . RESOLUTION_POLICY . SHOW_ALL ) ;
48
46
47
+ // initialize director
48
+ var director = cc . Director . getInstance ( ) ;
49
+
49
50
// turn on display FPS
50
51
director . setDisplayStats ( this . config [ 'showFPS' ] ) ;
51
52
Original file line number Diff line number Diff line change @@ -828,7 +828,10 @@ cc.EGLView = cc.Class.extend(/** @lends cc.EGLView# */{
828
828
829
829
cc . EGLView . getInstance = function ( ) {
830
830
if ( ! this . _instance ) {
831
- this . _instance = new cc . EGLView ( ) ;
831
+ // First init director
832
+ cc . Director . getInstance ( ) ;
833
+
834
+ this . _instance = this . _instance || new cc . EGLView ( ) ;
832
835
this . _instance . initialize ( ) ;
833
836
}
834
837
return this . _instance ;
You can’t perform that action at this time.
0 commit comments