Found an issue in SpiderBasic ? Please report it here !
falsam
 
Posts: 275
Joined: Mon May 05, 2014 9:49 pm
Location: France

[SB 2.00] Android - 2D Rendering : Black Screen

by falsam Sun Oct 30, 2016 5:45 pm

[Beta 4]

Hello Team.

I continue to test Android applications generated with SpiderBasic.
Here is a simple code that colors a screen and displays a sprite created by the application.
The code works well with a browser but does not work when it is generated for Android.
The screen is not colored and the sprite is not displayed.

■ Code Test
Code: Select all
OpenScreen(1024, 768, 32, "Test")

Procedure RenderFrame()
  Protected k
  Static x, y
 
  ClearScreen(RGB(255, 215, 0)) 
 
  DisplaySprite(0, 100, 100)
  DisplaySprite(1, 50, 50) ;Comment un un-comment this line.
 
  FlipBuffers()
EndProcedure

Procedure Loading(Type, Filename$, ObjectId)
  Static NbLoadedElements
 
  NbLoadedElements+1
  If NbLoadedElements = 1
    If CreateSprite(1, 64, 64)
      StartDrawing(SpriteOutput(1))
      Box(0, 0, 64, 64, RGB(46, 139, 87))
      StopDrawing()
    EndIf
   
    FlipBuffers();
  EndIf
EndProcedure

Procedure LoadingError(Type, Filename$, ObjectId)
  Debug Filename$ + ": loading error"
EndProcedure

; Register the loading event before calling any resource load command
BindEvent(#PB_Event_Loading, @Loading())
BindEvent(#PB_Event_LoadingError, @LoadingError())
BindEvent(#PB_Event_RenderFrame, @RenderFrame())

LoadSprite(0, "data/Spider.png")
Last edited by falsam on Sun Nov 06, 2016 10:34 am, edited 3 times in total.

➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
http://falsam.com

Sorry for my poor english
User avatar
MrTAToad
 
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by MrTAToad Sun Oct 30, 2016 7:34 pm

Might be worth checking the procedures to see if they are returning any errors...
falsam
 
Posts: 275
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by falsam Sun Oct 30, 2016 10:24 pm

No MrTAToad. This code works if I generates a web-app. I should have the same result with the Android application.

➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
http://falsam.com

Sorry for my poor english
Sirius-2337
 
Posts: 34
Joined: Wed Mar 26, 2014 5:47 pm

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by Sirius-2337 Mon Oct 31, 2016 7:39 am

This code works as expected on my device.
SB Beta2 - Windows7 x64
Android 4.1.2
falsam
 
Posts: 275
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by falsam Tue Nov 01, 2016 4:07 pm

Sirius-2337 wrote:This code works as expected on my device.
Strange. With an APK ?

Maybe the apk has a WebGL rendering. And in this case it does not work on my Android terminal !

➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
http://falsam.com

Sorry for my poor english
Fred
Site Admin
 
Posts: 1134
Joined: Mon Feb 24, 2014 10:51 am

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by Fred Tue Nov 01, 2016 5:33 pm

Yes your device has to handle WebGL or it won't work.
falsam
 
Posts: 275
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by falsam Tue Nov 01, 2016 5:41 pm

Fred wrote:Yes your device has to handle WebGL or it won't work.
This is not good news. Most Android devices do not support rendering webgl.

Pixi also works with a rendering canvas. Having the choice made is it possible?

➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
http://falsam.com

Sorry for my poor english
Fred
Site Admin
 
Posts: 1134
Joined: Mon Feb 24, 2014 10:51 am

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by Fred Tue Nov 01, 2016 6:07 pm

Your device just have to handle OpenGL, it's fairly common amonst Android device. Which device do you have ?
falsam
 
Posts: 275
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by falsam Tue Nov 01, 2016 6:23 pm

Fred wrote:Your device just have to handle OpenGL, it's fairly common amonst Android device. Which device do you have ?

Samsung Galaxy Note 2014 Edition

-CPU Type Double Processeur Quad Core - Vitesse du processeur Quad 1.9 GHz + Quad 1.3 GHZ
-Version Android 5.1.1
-GPU Mali T-628 (API OpenGL® ES 1.1, 2.0, 3.0, 3.1 - OpenCL™ 1.1 - DirectX® 11)

OpenGL works fine with my browser (Android), but the APK does not work.

➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
http://falsam.com

Sorry for my poor english
Fred
Site Admin
 
Posts: 1134
Joined: Mon Feb 24, 2014 10:51 am

Re: [SB 2.00] Android - 2D Rendering : Black Screen

by Fred Tue Nov 01, 2016 6:37 pm

Strange, it should. I will take a closer look as canvas will be slow for fast realtime operations
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 3 guests