MiniB3D on Android

SLotman

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jul 3, 2017
Messages
233
I was experimenting with miniB3D on Android - and everything seemed really fine... until I got a warning on screen about something.

Obviously the game was suspended, and when it returned, the screen was blank. The game was still running on the background (I could hear sounds), but nothing shows on screen.

In the logs, I could find this: E/ViewRootImpl( 762): sendUserActionEvent() mView == null - don't know if its related.

Have anyone found similar issue? If so, how to fix this?
 

SLotman

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jul 3, 2017
Messages
233
Found a workaround: copied this from the source into "OnResume":

Code:
        Graphics3DInit ()
        ReloadAllSurfaces ()
        ReloadAllTextures ()
        TShader.ResetDefaultShader()

And now it works as it should :)
 

MikeHart

Administrator
CX Code Contributor
3rd Party Module Dev
3rd Party Target Dev
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
3,453
Great find. Where does someone find a current version of MiniB3d?
 

magic

Active member
3rd Party Module Dev
3rd Party Tool Dev
Joined
Mar 5, 2018
Messages
234
thank you @SLotman

Html run:
Got error "Native OS Module not implemented"
 
Last edited:

grant

Member
CX Code Contributor
3rd Party Module Dev
3rd Party Tool Dev
Joined
Nov 19, 2019
Messages
80
Found a workaround: copied this from the source into "OnResume":

Code:
        Graphics3DInit ()
        ReloadAllSurfaces ()
        ReloadAllTextures ()
        TShader.ResetDefaultShader()

And now it works as it should :)
Thanks, but adding this directly inside OnResume didn't work completely for me. The lighting was broken on one Android device and on the other device it would crash.

Looking at the MiniB3D's source code for app.cxs they call those functions inside OnRender once after OnResume was triggered.

Code:
    Field _was_suspended:Bool = False

    Method OnRender()
        If _was_suspended
            #If TARGET="android" Or TARGET="ios" Or TARGET="winrt"
                Graphics3DInit ()
                ReloadAllSurfaces ()
                ReloadAllTextures ()
                TShader.ResetDefaultShader()
            #Endif
            _was_suspended = False
        End
        'Do your render code...
    End

    Method OnResume:Int()
        _was_suspended = True
        Return 0
    End

Tested by modifying animation_test.cxs that comes with MiniB3D.
 
Top Bottom