X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FOpenGL.java;h=3b8d68965938d65ea47d55d44693e7453b5c9d70;hb=b213eae7072297f9121511fa671062f9b07fcc59;hp=b403bdfe9d27c6618289fbf5883c6000c27b959f;hpb=e2dedbcad71fdf6df74abe5c43516a4d88d145d3;p=org.ibex.core.git diff --git a/src/org/xwt/plat/OpenGL.java b/src/org/xwt/plat/OpenGL.java index b403bdf..3b8d689 100644 --- a/src/org/xwt/plat/OpenGL.java +++ b/src/org/xwt/plat/OpenGL.java @@ -1,8 +1,9 @@ -// Copyright 2003 Adam Megacz, see the COPYING file for licensing [LGPL] +// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL] // Author: Brian Alliet package org.xwt.plat; import org.xwt.*; +import org.xwt.js.*; import org.xwt.util.*; abstract class OpenGL { @@ -28,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); @@ -38,15 +39,15 @@ abstract class OpenGL { maxRectTexSize = 0; rectangularTextures = false; } - Log.info(this,"Renderer: " + renderer); - Log.info(this,"Version: " + version); - Log.info(this,"Vendor: " + vendor); - Log.info(this,"Rectangular textures: " + (rectangularTextures ? "supported" : "unsupported")); - Log.info(this,"Max texture size: " + maxTexSize); - Log.info(this,"Max rectangular texture size: " + maxRectTexSize); + Log.diag(this,"Renderer: " + renderer); + Log.diag(this,"Version: " + version); + Log.diag(this,"Vendor: " + vendor); + Log.diag(this,"Rectangular textures: " + (rectangularTextures ? "supported" : "unsupported")); + Log.diag(this,"Max texture size: " + maxTexSize); + 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); } @@ -66,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); @@ -88,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); @@ -118,10 +119,10 @@ abstract class OpenGL { return oglp.realPicture; } - public Picture _createPicture(boolean alphaOnly) { return new OpenGLPicture(alphaOnly); } + public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, alphaOnly); } public static class OpenGLPicture extends Picture { - public OpenGLPicture(boolean a) { alphaOnly = a; } + public OpenGLPicture(JS r, boolean a) { super(r); alphaOnly = a; } boolean alphaOnly; GLPicture realPicture = null; } @@ -133,7 +134,7 @@ abstract class OpenGL { public OpenGLGlyph(org.xwt.Font f, char c) { super(f, c); } Picture getPicture() { if (p == null && isLoaded) { - p = new OpenGLPicture(true); + p = new OpenGLPicture(null, true); p.data = new int[data.length]; for(int i=0; i