allow to get the default screen instance

Instead of being forced to always specify the type
The screen_js constructor now behaves properly
(reusing already initialized screens properly ...so also the ones
not created by the javascript, where jsobj is still NULL while
initilized is true)
This commit is contained in:
Xant
2009-09-13 04:06:18 +02:00
parent 61fc4c566a
commit 71fca9cfa7
2 changed files with 25 additions and 20 deletions
+5 -5
View File
@@ -3,8 +3,6 @@
// it also shows the usage of keyboard controller
// press 'q' to quit while running
W = get_width();
H = get_height();
x = 100;
y = 100;
@@ -15,9 +13,11 @@ PI = 3.141592654;
c = PI * 2;
o = -PI / 2;
scr = new Screen("sdl");
scr.init(W,H);
add_screen(scr);
scr = new Screen();
W = get_width();
H = get_height();
//scr.init(W,H);
//add_screen(scr);
function drawStar(lay, s_mul, s2_mul) {
s = s_mul / 0.383;