X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FOpenGL.java;h=3d0e7cda83fed521e3630fc19ff511044be60d59;hb=6eaf54fa906754ce35a7db0e8207fc6bbde5464d;hp=51ef708e869d99f48d12e19abe1ca000cd3af624;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104;p=org.ibex.core.git diff --git a/src/org/ibex/plat/OpenGL.java b/src/org/ibex/plat/OpenGL.java index 51ef708..3d0e7cd 100644 --- a/src/org/ibex/plat/OpenGL.java +++ b/src/org/ibex/plat/OpenGL.java @@ -1,10 +1,15 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL] +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the GNU General Public License version 2 ("the License"). +// You may not use this file except in compliance with the License. + // Author: Brian Alliet package org.ibex.plat; -import org.ibex.*; import org.ibex.js.*; import org.ibex.util.*; +import org.ibex.graphics.*; +import org.ibex.core.*; +import org.ibex.net.*; abstract class OpenGL { static final boolean pretendToBeACrappyVideoCard = false; @@ -81,8 +86,8 @@ abstract class OpenGL { //System.out.println("drawString(): " + text); } - public void drawGlyph(org.ibex.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) { - drawPicture_(((org.ibex.Platform.DefaultGlyph)source).getPicture(), dx, dy, cx1, cy1, cx2, cy2, rgb); + public void drawGlyph(org.ibex.graphics.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) { + drawPicture_(((org.ibex.plat.Platform.DefaultGlyph)source).getPicture(), dx, dy, cx1, cy1, cx2, cy2, rgb); } public void drawPicture(Picture source, int dx, int dy, int cx1, int cy1, int cx2, int cy2) { drawPicture_(source, dx, dy, cx1, cy1, cx2, cy2, 0xffffffff); @@ -127,13 +132,13 @@ abstract class OpenGL { GLPicture realPicture = null; } - public Font.Glyph _createGlyph(org.ibex.Font f, char c) { return new org.ibex.Platform.DefaultGlyph(f, c); } + public Font.Glyph _createGlyph(org.ibex.graphics.Font f, char c) { return new org.ibex.plat.Platform.DefaultGlyph(f, c); } private native void natDeleteTexture(int tex); public void deleteTexture(final int tex) { // CHECKME: Is this safe to do from finalize()? // natDeleteTexture MUST be run from the message queue thread - Scheduler.add(new Scheduler.Task() { public void perform() { natDeleteTexture(tex); }}); + Scheduler.add(new Callable() { public Object run(Object o) { natDeleteTexture(tex); return null; }}); } private static abstract class GLPicture { @@ -190,8 +195,6 @@ abstract class OpenGL { } private static class MosaicGLPicture extends GLPicture { - private static final int overlap = 8; - int psize; GLPicture[][] pics; @@ -253,8 +256,6 @@ abstract class OpenGL { private static final int min(int a, int b) { return a < b ? a : b; } public void draw(int dx, int dy, int cx1, int cy1, int cx2, int cy2) { - int totalWidth = width; - int totalHeight = height; // *{x,y}{1,2} key: d=dest s=src, p=bounds of this picture, i=intersection of s and p, pd = dest of this pic for(int i=0;i