2004/01/19 05:51:38
[org.ibex.core.git] / src / org / xwt / plat / OpenGL.java
index 8abd903..c18d09c 100644 (file)
@@ -29,7 +29,7 @@ abstract class OpenGL {
         }
     }
     
-    // This MUST be called after OpenGL is instansiated (and activateSharedInterpreter is functioning)
+    // This MUST be called after OpenGL is instansiated (and activateSharedContext is functioning)
     public void init() throws NotSupportedException {
         natInit();
         glVersion = parseVersion(version);
@@ -47,7 +47,7 @@ abstract class OpenGL {
         Log.diag(this,"Max rectangular texture size: " + maxRectTexSize);
     }
     
-    protected abstract void activateSharedInterpreter();
+    protected abstract void activateSharedContext();
 
     public static class NotSupportedException extends Exception {
         public NotSupportedException(String s) { super(s); }
@@ -67,7 +67,7 @@ abstract class OpenGL {
         }
         
         // This should activate the drawing context and prepare the double buffer for drawing
-        protected abstract void activateInterpreter();
+        protected abstract void activateContext();
         
         protected static native void drawableInit(int w, int h);
         
@@ -89,7 +89,7 @@ abstract class OpenGL {
         }
 
         private void drawPicture_(Picture source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int color) {
-            activateInterpreter();
+            activateContext();
             setColor(color);
             GLPicture p = getInnerPicture(source, gl);
             p.draw(dx,dy,cx1,cy1,cx2,cy2);
@@ -119,7 +119,7 @@ abstract class OpenGL {
         return oglp.realPicture;
     }
     
-    public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, alphaOnly); }
+    public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, false); }
 
     public static class OpenGLPicture extends Picture {
         public OpenGLPicture(JS r, boolean a) { super(r); alphaOnly = a; }
@@ -127,24 +127,8 @@ abstract class OpenGL {
         GLPicture realPicture = null;
     }
 
-    public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new OpenGLGlyph(f, c); }
+    public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new org.xwt.Platform.DefaultGlyph(f, c); }
     
-    public static class OpenGLGlyph extends Font.Glyph {
-        private Picture p = null;
-        public OpenGLGlyph(org.xwt.Font f, char c) { super(f, c); }
-        Picture getPicture() {
-            if (p == null && isLoaded) {
-                p = new OpenGLPicture(null, true);
-                p.data = new int[data.length];
-                for(int i=0; i<data.length; i++) p.data[i] = (data[i] & 0xff) << 24;
-                data = null;
-                p.width = this.width;
-                p.height = this.height;
-            }
-            return p;
-        }
-    }
-
     private native void natDeleteTexture(int tex);
     public void deleteTexture(final int tex) {
         // CHECKME: Is this safe to do from finalize()?