File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,22 @@ function framebuffer:init()
54
54
-- we present this buffer to the outside
55
55
self .bb = BB .new (android .screen .width , android .screen .height , BB .TYPE_BBRGB32 )
56
56
self .invert_bb = BB .new (android .screen .width , android .screen .height , BB .TYPE_BBRGB32 )
57
- -- TODO: should we better use these?
58
- -- android.lib.ANativeWindow_getWidth(window)
59
- -- android.lib.ANativeWindow_getHeight(window)
60
57
self .bb :fill (BB .COLOR_WHITE )
61
58
self :_updateWindow ()
62
-
63
59
framebuffer .parent .init (self )
64
60
end
65
61
62
+ -- resize on rotation or split view.
63
+ function framebuffer :resize ()
64
+ android .screen .width = android .getScreenWidth ()
65
+ android .screen .height = android .getScreenHeight ()
66
+ self .bb :free ()
67
+ self .bb = BB .new (android .screen .width , android .screen .height , BB .TYPE_BBRGB32 )
68
+ self .invert_bb = BB .new (android .screen .width , android .screen .height , BB .TYPE_BBRGB32 )
69
+ self .bb :fill (BB .COLOR_WHITE )
70
+ self :_updateWindow ()
71
+ end
72
+
66
73
function framebuffer :_updateWindow ()
67
74
if android .app .window == nil then
68
75
android .LOGW (" cannot blit: no window" )
You can’t perform that action at this time.
0 commit comments