Hey guys,
I'm building a program that switches between 2 different screens (one expensive to draw, the other not.) I create the screen that holds the cheap one to stack on top of the expensive one, and when I'm done try to pop it off of the stack and see the expensive screen without having to rerender everything. However, this doesn't seem to work. I've created a test program to illustrate the issue.
Any help would be greatly appreciated.
Thanks!
Function main () as void
player_rect = {x: 460, y: 36, w: 756, h: 425 }
player = CreateObject("roVideoPlayer")
player.SetPositionNotificationPeriod(1)
player.SetContentList([
{
Stream : { url :"http://video.ted.com/talks/podcast/ImogenHeap_WaitItOut_2009G_480.mp4" }
StreamFormat : "mp4"
}
])
player.SetDestinationRect( player_rect )
player.Play()
port = CreateObject("roMessagePort")
'set up first screen
screen0 = CreateObject("roScreen", true)
screen0.SetMessagePort(port)
screen0.setAlphaEnable(true)
screen0.Clear(&h00000000)
screen0.DrawRect( 0, 0, 300, 720, &hff0000ff )
screen0.SwapBuffers()
screen0.Clear(&h00000000)
screen0.DrawRect( 0, 0, 300, 720, &hff0000ff )
screen0.SwapBuffers()
msg = wait(0, port)
msg = wait(0, port)
'set up first screen
screen1 = CreateObject("roScreen", true)
screen1.SetMessagePort(port)
screen1.setAlphaEnable(true)
screen1.Clear(&h00000000)
screen1.DrawRect( 300, 0, 300, 720, &h00ff00ff )
screen1.SwapBuffers()
screen1.Clear(&h00000000)
screen1.DrawRect( 300, 0, 300, 720, &h00ff00ff )
screen1.SwapBuffers()
msg = wait(0, port)
msg = wait(0, port)
'destroy new screen
screen1 = invalid
while(true)
end while
End Function