FileDocCategorySizeDatePackage
EGLContextImpl.javaAPI DocphoneME MR2 API (J2ME)3968Wed May 02 18:00:48 BST 2007javax.microedition.khronos.egl

EGLContextImpl

public final class EGLContextImpl extends EGLContext implements com.sun.jsr239.ContextAccess

Fields Summary
private static final Hashtable
byId
private javax.microedition.khronos.opengles.GL
gl
private int
nativeId
private Thread
boundThread
private EGLDisplayImpl
display
private EGLSurface
drawSurface
private EGLSurface
readSurface
private boolean
destroyed
Constructors Summary
public EGLContextImpl(int nativeId)


       
        synchronized (byId) {
            this.nativeId = nativeId;
            byId.put(new Integer(nativeId), new WeakReference(this));
        }
    
Methods Summary
public voiddispose()

	synchronized (byId) {
	    byId.remove(new Integer(nativeId));
	    this.nativeId = 0;
	}
    
public java.lang.ThreadgetBoundThread()

        return boundThread;
    
public EGLDisplaygetDisplay()

        return display;
    
public EGLSurfacegetDrawSurface()

        return drawSurface;
    
EGLSurfaceImplgetDrawSurfaceImpl()

        return (EGLSurfaceImpl)getDrawSurface();
    
public javax.microedition.khronos.opengles.GLgetGL()

	synchronized (this) {
	    if (gl == null) {
                if (!GLConfiguration.supportsGL11) {
                    gl = new GL10Impl(this);
                } else {
                    gl = new GL11Impl(this);
                }
	    }
	    return gl;
	}
    
public static javax.microedition.khronos.egl.EGLContextImplgetInstance(int nativeId)

        synchronized (byId) {
            WeakReference ref = (WeakReference)byId.get(new Integer(nativeId));
            EGLContextImpl context = ref != null ?
                    (EGLContextImpl)ref.get() : null;
            if (context == null) {
                return new EGLContextImpl(nativeId);
            } else {
                return context;
            }
        }
    
public EGLSurfacegetReadSurface()

        return readSurface;
    
public booleanisDestroyed()

        return destroyed;
    
public intnativeId()

	return nativeId;
    
public voidsetBoundThread(java.lang.Thread boundThread)

        this.boundThread = boundThread;
    
public voidsetDestroyed(boolean destroyed)

        this.destroyed = destroyed;
    
public voidsetDisplay(EGLDisplayImpl display)

        this.display = display;
    
public voidsetDrawSurface(EGLSurfaceImpl drawSurface)

        this.drawSurface = drawSurface;
    
public voidsetReadSurface(EGLSurfaceImpl readSurface)

        this.readSurface = readSurface;
    
public java.lang.StringtoString()
For debugging purposes, prints the native context ID.

  	return "EGLContextImpl[" + nativeId + "]";