CONTEXT3D_CREATE and ErrorEvent.ERROR events on stage3d

Software: Away3D 4.x

michel, Newbie
Posted: 17 October 2011 09:36 AM   Total Posts: 10

Is there a way to listen to the CONTEXT3D_CREATE event and the ERROR in away3d?

Or does away3d has a different way to test if the hardware is available?
See think link for what i want to test: http://www.bytearray.org/?p=3443

   

wagster, Member
Posted: 21 October 2011 09:09 PM   Total Posts: 68   [ # 1 ]

I’m doing this:

if (view3D.stage3DProxy.context3D.driverInfo.toLowerCase().indexOf("software") != -1)
   
{
    
var message:String appConfig.messages.softwareModeAlert.toString();
    var 
alert:AlertBox = new AlertBox(messageappConfig.backgroundColour);
    
alert.stage.stageWidth/alert.width/2;
    
alert.stage.stageHeight/alert.height/2;
    
stage.addChild(alert);
   

(found the same post!) but I think I’m having the same issue as yourself - sometimes Context3D is null.  It would be great to be notified when it shows up.

   

michel, Newbie
Posted: 22 October 2011 07:31 AM   Total Posts: 10   [ # 2 ]

Yes i also use that way but at the moment i check in an enter_frame loop if the Context3D != null and when it is i remove the loop and do the check.
But i see that as kind of a dirty hack so i rather have an event smile

   

wagster, Member
Posted: 22 October 2011 09:03 AM   Total Posts: 68   [ # 3 ]

Same here.  There has to be a better way.

   

wagster, Member
Posted: 22 October 2011 07:15 PM   Total Posts: 68   [ # 4 ]

Ok, Stage3DProxy should be redispatching the CONTEXT3D_CREATE event as it has a onContext3DUpdate() method that is supposed to do exactly that.  Maybe the listener is being added too late or something, but this looks like a bug so it’s going on the list.

   

wagster, Member
Posted: 22 October 2011 07:32 PM   Total Posts: 68   [ # 5 ]

There is a better way:

view.stage3DProxy.addEventListener(Stage3DEvent.CONTEXT3D_CREATED, onContext3DCreate);

That does the trick.

   

michel, Newbie
Posted: 24 October 2011 06:47 AM   Total Posts: 10   [ # 6 ]

Ah yes thanks! that is the one i am looking for smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X