com.sun.lwuit
Class M3G

java.lang.Object
  extended by com.sun.lwuit.M3G

Deprecated. this class isn't portable, its functionality will move to an external package in the future

public class M3G
extends java.lang.Object

Support for binding the 3D graphics M3G API (JSR 184), this allows us to integrate 2D UI's with 3D special effects and transitions while keeping the rendering pipelines in sync.

This class is a singleton that includes a callback interface which abstracts the separation between the 2D and 3D pipelines. For more on the difference between 2D and 3D rendering pipelines please consult the M3G documentation.


Nested Class Summary
static interface M3G.Callback
          Deprecated. Callback interface that allows rendering of 3D graphics on top/bellow the current form.
 
Method Summary
static int closestHigherPowerOf2(int x)
          Deprecated. Helper method returns the closest power of two larger than X
static int closestLowerPowerOf2(int x)
          Deprecated. Helper method returns the closest power of two smaller than X
static M3G getInstance()
          Deprecated. Returns the singleton instance of this class
 int getMaxTextureDimension()
          Deprecated. Returns the maximum size for a texture according to the underlying graphics engine
static boolean isM3GSupported()
          Deprecated. Returns true if the M3G (JSR 184) API is supported on this device
 void renderM3G(Graphics g, boolean depth, int arguments, M3G.Callback c)
          Deprecated. Binds the Graphics3D object to the current graphics context and invokes callback to perform the rendering.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static M3G getInstance()
Deprecated. 
Returns the singleton instance of this class

Returns:
the singleton instance of this class

isM3GSupported

public static boolean isM3GSupported()
Deprecated. 
Returns true if the M3G (JSR 184) API is supported on this device

Returns:
True if this device supports M3G

getMaxTextureDimension

public int getMaxTextureDimension()
Deprecated. 
Returns the maximum size for a texture according to the underlying graphics engine

Returns:
the size of the largest possible texture on the device

closestLowerPowerOf2

public static int closestLowerPowerOf2(int x)
Deprecated. 
Helper method returns the closest power of two smaller than X

Parameters:
x - number
Returns:
a power of 2 smaller than X

closestHigherPowerOf2

public static int closestHigherPowerOf2(int x)
Deprecated. 
Helper method returns the closest power of two larger than X

Parameters:
x - number
Returns:
a power of 2 smaller than X

renderM3G

public void renderM3G(Graphics g,
                      boolean depth,
                      int arguments,
                      M3G.Callback c)
Deprecated. 
Binds the Graphics3D object to the current graphics context and invokes callback to perform the rendering. This method is responsible for flushing the graphics3D object and buffer to avoid problems related to 2D/3D rendering pipeline collision.

Parameters:
g - Graphics context to draw on, notice that translate and clipping might be ignored
depth - should depth buffering be used in the graphics context bind method
arguments - arguments to the Graphics3D bind method
c - the callback invoked to perform the actual 3D rendering