actionscript 3 - AS3 Starling custom shader crash "Error #3600: No valid program set" when computer is locked or put to sleep -


i'm working on flash game using starling, , have started coming across issue render crashes after put pc sleep/lock , turn on. error i'm getting is:

error #3600: no valid program set

i not able find advice online on how prevent this/re-initialize appropriately. i'm assuming part of wider issue how flash/starling handles computer being put sleep/locked.

things have tried far:

  • catching error , re-uploading shader programs.
  • setting starling.handlelostcontext true

has come across issue before? help/pointers appreciated.

it sounds game losing gpu context.

on context loss, gpu data lost. have restore textures, vertex buffers, etc. starling handles of when set handlelostcontext true, still have handle textures.

if use assetmanager, handle re-uploading textures you, easiest way go. automatically creates texture.root.onrestore callback function starling calls after re-creates context, , attempt re-load textures wherever first loaded them from, whether disk, embedded asset, or url.

you can manually define function yourself, though more complicated , article mentions, gotchas involved.

more information: http://wiki.starling-framework.org/manual/context_loss


Comments