#Region Project Attributes
#ApplicationLabel: b4aOpenGlesPhotoCube
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
' Marc Removed
'#AdditionalRes: ..\DemoRes
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private gls1 As glSurfaceView
' Added by Marc
Private Facelist As List
Private mbm(6) As Bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Facelist.Initialize
'add 6 images to (List) facelist - one for each of the faces of the cube
mbm(0).Initialize(File.DirAssets,"aacube1.png")
Facelist.Add(mbm(0))
mbm(1).Initialize(File.DirAssets,"aacube1.png")
Facelist.Add(mbm(1))
mbm(2).Initialize(File.DirAssets,"aacube1.png")
Facelist.Add(mbm(2))
mbm(3).Initialize(File.DirAssets,"aacube1.png")
Facelist.Add(mbm(3))
mbm(4).Initialize(File.DirAssets,"aacube1.png")
Facelist.Add(mbm(4))
mbm(5).Initialize(File.DirAssets,"aacube1.png")
Facelist.Add(mbm(5))
gls1.SixFaces = Facelist
gls1.setCubeBackgroundColor(0.1f, 0.1f, 0.0f, 0.0f) 'set the background color of the cube - note that values should be between 0.0f and 0.1f
gls1.LightingEnabled = False
gls1.CubeHalfSize = 1.2f 'set the gap between the 6 faces of the cube(1 => face align perfectly, < 1 => faces overlap, > 1 => faces spaced outwards and can see inside the cube)
gls1.CubeSpeed = -2.5f 'set the cube rotation speed (positive value => CCW, negative value => CW)
gls1.ZoomInOut = True 'if true then zoom in and out, if false then don't zoom in and out
gls1.setFace_1_Color(0.0f, 0.0f, 1.0f, 1.0f) 'blue
gls1.setFace_2_Color(1.0f, 0.0f, 0.0f, 1.0f) 'red
gls1.setFace_3_Color(0.0f, 1.0f, 0.0f, 1.0f) 'green
gls1.setFace_4_Color(1.0f, 1.0f, 0.0f, 1.0f) 'yellow
gls1.setFace_5_Color(0.0f, 1.0f, 1.0f, 1.0f) 'cyan
gls1.setFace_6_Color(1.0f, 0.0f, 1.0f, 1.0f) 'magenta
End Sub
Sub Activity_Resume
If gls1.IsInitialized Then
' this line from the original demo crashes every time
' gls1.RESUME
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
gls1.PAUSE
End Sub