Detecting if wmode is set to “direct”

Software: Away3D 4.x

Kodremus, Newbie
Posted: 02 December 2012 10:45 PM   Total Posts: 3

I recently completed a game using Away3D 4.0. However, I noticed that on some websites they don’t put wmode=direct, so the view3D doesn’t get displayed (it just stays all black).

I was wondering if there is a way to detect if wmode is set to “direct” so that I can at least display a message to the user when it isn’t.

   

Qbrain, Member
Posted: 03 December 2012 12:15 PM   Total Posts: 92   [ # 1 ]

Away3D dispatches an event when the context is created. In this event, a variable called “usesSoftwareRendering” is set to true of false.

So you basicly need to add an eventlistener to check the variable when the context is created. Then you can display the message if the variable is set to true.

this is way better than to check for wmode=direct because you just check
inside away3D if you use software rendering or hardware acc.
(if you use this, someone who is on a site with wmode=direct but does not support hardware acc. will also get your message.)

hope this helps smile

-Q

edit:

quote by Richard Olsson in another topic:

You can check the View3D.stage3DProxy.usesSoftwareRendering property which will be true when the renderer has fallen back on software rendering instead of hardware accelerated rendering (GPU.) Note that it will only be set after a Context3D has been returned. When that happens, the proxy will dispatch a Stage3DEvent (CONTEXT_CREATED). So listen for that event and then check the property to make sure you get an accurate value.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X