You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
(1) |
|
3
|
4
|
5
|
6
|
7
|
8
(1) |
9
(2) |
|
10
(8) |
11
(3) |
12
(13) |
13
(4) |
14
(2) |
15
|
16
(6) |
|
17
(1) |
18
|
19
|
20
|
21
(1) |
22
(2) |
23
(2) |
|
24
(1) |
25
|
26
|
27
|
28
|
29
(1) |
30
|
|
31
|
|
|
|
|
|
|
|
From: <ka...@us...> - 2011-07-13 22:15:41
|
Revision: 3586
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3586&view=rev
Author: kappa1
Date: 2011-07-13 22:15:35 +0000 (Wed, 13 Jul 2011)
Log Message:
-----------
Implement Resizing Display API for OS X
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -93,6 +93,12 @@
* unlike GL, where it is typically at the bottom of the display.
*/
private static int y = -1;
+
+ /** the width of the Display window */
+ private static int width = 0;
+
+ /** the height of the Display window */
+ private static int height = 0;
/** Title of the window (never null) */
private static String title = "Game";
@@ -109,6 +115,10 @@
private static boolean window_created;
private static boolean parent_resized;
+
+ private static boolean window_resized;
+
+ private static boolean window_resizable;
/** Initial Background Color of Display */
private static float r, g, b;
@@ -295,6 +305,9 @@
DisplayMode mode = getEffectiveMode();
display_impl.createWindow(drawable, mode, tmp_parent, getWindowX(), getWindowY());
window_created = true;
+
+ width = Display.getDisplayMode().getWidth();
+ height = Display.getDisplayMode().getHeight();
setTitle(title);
initControls();
@@ -661,6 +674,13 @@
throw new RuntimeException(e);
}
}
+
+ window_resized = !isFullscreen() && parent == null && display_impl.wasResized();
+
+ if ( window_resized ) {
+ width = display_impl.getWidth();
+ height = display_impl.getHeight();
+ }
if ( parent_resized ) {
reshape();
@@ -1257,14 +1277,17 @@
* false to disable resizing on the Display window.
*/
public static void setResizable(boolean resizable) {
-
+ window_resizable = resizable;
+ if ( isCreated() ) {
+ display_impl.setResizable(resizable);
+ }
}
/**
* @return true if the Display window is resizable.
*/
public static boolean isResizable() {
- return false;
+ return window_resizable;
}
/**
@@ -1274,7 +1297,7 @@
* This will return false if running in fullscreen or with Display.setParent(Canvas parent)
*/
public static boolean wasResized() {
- return false;
+ return window_resized;
}
/**
@@ -1287,7 +1310,16 @@
* This value will be updated after a call to Display.update().
*/
public static int getWidth() {
- return 0;
+
+ if (Display.isFullscreen()) {
+ return Display.getDisplayMode().getWidth();
+ }
+
+ if (parent != null) {
+ return parent.getWidth();
+ }
+
+ return width;
}
/**
@@ -1300,6 +1332,15 @@
* This value will be updated after a call to Display.update().
*/
public static int getHeight() {
- return 0;
+
+ if (Display.isFullscreen()) {
+ return Display.getDisplayMode().getHeight();
+ }
+
+ if (parent != null) {
+ return parent.getHeight();
+ }
+
+ return height;
}
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -169,13 +169,8 @@
void setResizable(boolean resizable);
/**
- * @return true if the Display window is resizable.
+ * @return true if the Display window has been resized since this method was last called.
*/
- boolean isResizable();
-
- /**
- * @return true if the Display window has been resized.
- */
boolean wasResized();
/**
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -1361,10 +1361,6 @@
}
- public boolean isResizable() {
- return false;
- }
-
public boolean wasResized() {
return false;
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -47,6 +47,7 @@
private int width;
private int height;
private boolean context_update;
+ private boolean resized;
MacOSXCanvasListener(Canvas canvas) {
this.canvas = canvas;
@@ -102,6 +103,7 @@
public void componentResized(ComponentEvent e) {
setUpdate();
+ resized = true;
}
public void componentMoved(ComponentEvent e) {
@@ -111,4 +113,13 @@
public void hierarchyChanged(HierarchyEvent e) {
setUpdate();
}
+
+ public boolean wasResized() {
+ if (resized) {
+ resized = false;
+ return true;
+ }
+
+ return false;
+ }
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -497,11 +497,11 @@
}
public int getWidth() {
- return Display.getDisplayMode().getWidth();
+ return frame.getWidth();
}
public int getHeight() {
- return Display.getDisplayMode().getHeight();
+ return frame.getHeight();
}
public boolean isInsideWindow() {
@@ -509,15 +509,11 @@
}
public void setResizable(boolean resizable) {
-
+ frame.setResizable(resizable);
}
- public boolean isResizable() {
- return false;
- }
-
public boolean wasResized() {
- return false;
+ return canvas_listener.wasResized();
}
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -68,7 +68,7 @@
private boolean should_release_cursor;
MacOSXFrame(DisplayMode mode, final java.awt.DisplayMode requested_mode, boolean fullscreen, int x, int y) throws LWJGLException {
- setResizable(false);
+ setResizable(Display.isResizable());
addWindowListener(this);
addComponentListener(this);
canvas = new MacOSXGLCanvas();
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-07-13 22:15:25 UTC (rev 3585)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-07-13 22:15:35 UTC (rev 3586)
@@ -945,10 +945,6 @@
}
- public boolean isResizable() {
- return false;
- }
-
public boolean wasResized() {
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2011-07-13 22:15:32
|
Revision: 3585
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3585&view=rev
Author: spasi
Date: 2011-07-13 22:15:25 +0000 (Wed, 13 Jul 2011)
Log Message:
-----------
Removed stride and .configure. Mapped object view updates are now 50% faster. [Riven]
org.lwjgl.util.mapped.PrintBytecode is now functional. [Riven]
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java
trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests2.java
trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectWithLibrary.java
trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java
Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -59,8 +59,8 @@
{
MappedFloat vecs1 = MappedFloat.malloc(1234);
- assert (vecs1.stride == MappedFloat.SIZEOF);
- assert (vecs1.stride * 1234 == vecs1.backingByteBuffer().capacity());
+ assert (vecs1.sizeof == MappedFloat.SIZEOF);
+ assert (vecs1.sizeof * 1234 == vecs1.backingByteBuffer().capacity());
assert (MappedFloat.SIZEOF * 1234 == vecs1.backingByteBuffer().capacity());
}
@@ -132,31 +132,6 @@
}
}
- // test dup
- {
- int newStride = 16;
- int doOffset = 0;
-
- vecs.view = 0;
- MappedFloat.configure(vecs, newStride, doOffset);
- MappedFloat dec2 = vecs.dup();
- MappedFloat.configure(dec2, newStride, doOffset);
-
- String s1 = vecs.baseAddress + "," + vecs.viewAddress + "," + vecs.stride + "," + vecs.SIZEOF;
- String s2 = dec2.baseAddress + "," + dec2.viewAddress + "," + dec2.stride + "," + dec2.SIZEOF;
- // System.out.println(s1);
- // System.out.println(s2);
- assert (s1.equals(s2));
-
- dec2.view++;
-
- String s3 = vecs.baseAddress + "," + vecs.viewAddress + "," + vecs.stride + "," + vecs.SIZEOF;
- String s4 = dec2.baseAddress + "," + dec2.viewAddress + "," + dec2.stride + "," + dec2.SIZEOF;
- // System.out.println(s3);
- // System.out.println(s4);
- assert (!s3.equals(s4));
- }
-
// test newBuffer
{
long addr1 = MappedObjectUnsafe.getBufferBaseAddress(bb);
Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests2.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests2.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests2.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -91,40 +91,8 @@
vecs.view = 1;
long a2 = vecs.viewAddress;
assert (a2 - a1 == MappedVec3.SIZEOF);
- assert (a2 - a1 == vecs.stride);
+ assert (a2 - a1 == vecs.sizeof);
vecs.view = 0;
}
-
- int newStride = 16;
-
- MappedVec3.configure(vecs, newStride, +4);
- assert (vecs.z == 0.1234f); // vecs[1].x ended up in vecs[0].z due to 1float offset
-
- MappedVec3.configure(vecs, newStride, +8);
- assert (vecs.z == 0.0000f); // vecs[1].z ended up in vecs[0].z due to 2float offset
-
- // test new stride
- {
- long a1 = vecs.viewAddress;
- vecs.view = 1;
- long a2 = vecs.viewAddress;
- assert (a2 - a1 == newStride);
- vecs.view = 0;
- }
-
- // example: GPU => VBO => VTN
- {
- MappedVec3 v = MappedVec3.map(bb);
- MappedVec2 t = MappedVec2.map(bb);
- MappedVec3 n = MappedVec3.map(bb);
-
- int stride = MappedVec3.SIZEOF + MappedVec2.SIZEOF + MappedVec3.SIZEOF;
- assert (stride == 32);
-
- MappedVec3.configure(v, stride, 0);
- MappedVec2.configure(t, stride, MappedVec3.SIZEOF);
- MappedVec3.configure(n, stride, MappedVec3.SIZEOF + MappedVec2.SIZEOF);
- }
}
-
}
\ No newline at end of file
Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectWithLibrary.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectWithLibrary.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectWithLibrary.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -4,15 +4,14 @@
package org.lwjgl.test.mapped;
+import org.lwjgl.opengl.Display;
+
import java.io.File;
-import org.lwjgl.opengl.Display;
+public class MappedObjectWithLibrary {
-public class MappedObjectWithLibrary
-{
- public static void testLWJGL() throws Exception
- {
- System.out.println(new File(System.getProperty("java.library.path")).getCanonicalPath());
- Display.create();
- }
+ public static void testLWJGL() throws Exception {
+ System.out.println(new File(System.getProperty("java.library.path")).getCanonicalPath());
+ Display.create();
+ }
}
Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -35,6 +35,7 @@
import org.lwjgl.util.mapped.MappedObjectTransformer;
/** @author Riven */
+@SuppressWarnings("static-access")
public class TestMappedObject {
static {
@@ -49,7 +50,6 @@
MappedObjectTransformer.register(MappedVec2.class);
MappedObjectTransformer.register(MappedVec3.class);
MappedObjectTransformer.register(MappedSomething.class);
-
MappedObjectTransformer.register(MappedObjectTests3.Xyz.class);
if ( MappedObjectClassLoader.fork(TestMappedObject.class, args) ) {
@@ -70,8 +70,8 @@
MappedObjectTests3.testForeach();
MappedObjectTests3.testConstructor();
MappedObjectTests3.testMappedSet();
-
- MappedObjectWithLibrary.testLWJGL();
+
+ System.out.println("done");
}
}
\ No newline at end of file
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -58,7 +58,7 @@
}
public T next() {
- MappedHelper.put_view(mapped, this.index++);
+ MappedHelper.put_view(mapped, this.index++, mapped.sizeof);
return mapped;
}
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -58,7 +58,7 @@
if ( sizeof % align != 0 )
throw new IllegalStateException("sizeof not a multiple of alignment");
- mo.stride = sizeof;
+ mo.sizeof = sizeof;
long addr = MappedObjectUnsafe.getBufferBaseAddress(buffer) + buffer.position();
if ( addr % align != 0 )
@@ -79,19 +79,19 @@
set.view(view);
}
- public static void put_view(MappedObject mapped, int view) {
- mapped.setViewAddress(mapped.baseAddress + view * mapped.stride);
+ public static void put_view(MappedObject mapped, int view, int sizeof) {
+ mapped.setViewAddress(mapped.baseAddress + view * sizeof);
}
- public static int get_view(MappedObject mapped) {
- return (int)(mapped.viewAddress - mapped.baseAddress) / mapped.stride;
+ public static int get_view(MappedObject mapped, int sizeof) {
+ return (int)(mapped.viewAddress - mapped.baseAddress) / sizeof;
}
public static MappedObject dup(MappedObject src, MappedObject dst) {
dst.baseAddress = src.baseAddress;
dst.viewAddress = src.viewAddress;
- dst.stride = src.stride;
dst.align = src.align;
+ dst.sizeof = src.sizeof;
dst.preventGC = src.preventGC;
return dst;
}
@@ -99,8 +99,8 @@
public static MappedObject slice(MappedObject src, MappedObject dst) {
dst.baseAddress = src.viewAddress; // !
dst.viewAddress = src.viewAddress;
- dst.stride = src.stride;
dst.align = src.align;
+ dst.sizeof = src.sizeof;
dst.preventGC = src.preventGC;
return dst;
}
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -63,12 +63,12 @@
/** The mapped object view memory address, in bytes. Read-only. */
public long viewAddress;
- /** The mapped object stride, in bytes. Read-only. */
- public int stride;
-
/** The mapped object memory alignment, in bytes. Read-only. */
public int align;
+ /** The mapped object memory sizeof, in bytes. Read-only. */
+ public int sizeof;
+
/**
* Holds the value of sizeof of the sub-type of this MappedObject<br>
* <br>
@@ -88,7 +88,7 @@
/** Moves the current view to the next element. */
public final void next() {
- setViewAddress(this.viewAddress + this.stride);
+ setViewAddress(this.viewAddress + this.sizeof);
}
final void setViewAddress(final long address) {
@@ -99,7 +99,7 @@
final void checkAddress(final long address) {
final long base = MappedObjectUnsafe.getBufferBaseAddress(preventGC);
- if ( address < base || preventGC.capacity() < (address - base + stride) )
+ if ( address < base || preventGC.capacity() < (address - base + this.sizeof) )
throw new IndexOutOfBoundsException();
}
@@ -218,32 +218,6 @@
return new MappedForeach<T>(mapped, elementCount);
}
- /**
- * Configures a newly initiated mapped object with the specified stride and offset.
- *
- * @throws IllegalStateException if view is not at index 0
- */
- public static <T extends MappedObject> T configure(T mapped, int stride, int offset) {
- if ( mapped.baseAddress != mapped.viewAddress )
- throw new IllegalStateException("view must be zero");
-
- if ( offset < 0 )
- throw new IllegalStateException("offset must not be negative: " + offset);
- if ( offset % mapped.align != 0 )
- throw new IllegalStateException("offset not a multiple of alignment: " + offset);
-
- if ( stride < mapped.stride )
- throw new IllegalStateException("new stride must not be smaller than current stride: " + stride);
- if ( stride % mapped.align != 0 )
- throw new IllegalStateException("stride not a multiple of alignment: " + stride);
-
- mapped.baseAddress += offset;
- mapped.viewAddress += offset;
- mapped.stride = stride;
-
- return mapped;
- }
-
ByteBuffer preventGC;
/**
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -34,7 +34,7 @@
static final boolean PRINT_TIMING = LWJGLUtil.DEBUG && LWJGLUtil.getPrivilegedBoolean("org.lwjgl.util.mapped.PrintTiming");
static final boolean PRINT_ACTIVITY = LWJGLUtil.DEBUG && LWJGLUtil.getPrivilegedBoolean("org.lwjgl.util.mapped.PrintActivity");
- static final boolean PRINT_BYTECODE = false; //LWJGLUtil.DEBUG && LWJGLUtil.getPrivilegedBoolean("org.lwjgl.util.mapped.PrintBytecode");
+ static final boolean PRINT_BYTECODE = LWJGLUtil.DEBUG && LWJGLUtil.getPrivilegedBoolean("org.lwjgl.util.mapped.PrintBytecode");
static final Map<String, MappedSubtypeInfo> className_to_subtype;
@@ -372,6 +372,7 @@
if ( mappedSubtype == null ) {
String mappedSetPrefix = jvmClassName(MappedSet.class);
+ // MappedSet.view
outer:
if ( "view".equals(fieldName) && className.startsWith(mappedSetPrefix) ) {
if ( opcode == GETFIELD )
@@ -418,17 +419,23 @@
if ( opcode == GETFIELD ) {
// stack: instance
- super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "get_view", "(L" + jvmClassName(MappedObject.class) + ";)I");
+ pushInt(super.mv, mappedSubtype.sizeof);
+ // stack: sizeof, instance
+ super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "get_view", "(L" + jvmClassName(MappedObject.class) + ";I)I");
+ // stack: view
return;
}
if ( opcode == PUTFIELD ) {
- // stack: int, instance
- super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "put_view", "(L" + jvmClassName(MappedObject.class) + ";I)V");
+ // stack: view, instance
+ pushInt(super.mv, mappedSubtype.sizeof);
+ // stack: sizeof, view, instance
+ super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "put_view", "(L" + jvmClassName(MappedObject.class) + ";II)V");
+ // stack: -
return;
}
}
- if ( "align".equals(fieldName) ) {
+ if ( "align".equals(fieldName) || "sizeof".equals(fieldName) ) {
if ( !"I".equals(typeName) )
throw new IllegalStateException();
@@ -436,7 +443,10 @@
// stack: instance
super.visitInsn(POP);
// stack: -
- pushInt(super.mv, mappedSubtype.align);
+ if ( "sizeof".equals(fieldName) )
+ pushInt(super.mv, mappedSubtype.sizeof);
+ else if ( "align".equals(fieldName) )
+ pushInt(super.mv, mappedSubtype.align);
// stack: int
return;
}
@@ -445,18 +455,6 @@
}
}
- if ( "stride".equals(fieldName) ) {
- if ( !"I".equals(typeName) )
- throw new IllegalStateException();
-
- if ( opcode == GETFIELD ) {
- // do not change a thing
- }
- if ( opcode == PUTFIELD ) {
- throwAccessErrorOnReadOnlyField(className, fieldName);
- }
- }
-
if ( "baseAddress".equals(fieldName) || "viewAddress".equals(fieldName) ) {
if ( !"J".equals(typeName) )
throw new IllegalStateException();
@@ -476,6 +474,8 @@
return;
}
+ // now we're going to transform ByteBuffer-typed field access
+
if ( typeName.equals("L" + jvmClassName(ByteBuffer.class) + ";") ) {
if ( opcode == PUTFIELD ) {
throwAccessErrorOnReadOnlyField(className, fieldName);
@@ -500,30 +500,34 @@
}
}
+ // we're now going to transform the field access
+
if ( opcode == PUTFIELD ) {
// stack: value, ref
super.visitInsn(SWAP);
// stack: ref, value
super.visitFieldInsn(GETFIELD, mappedSubtype.className, "viewAddress", "J");
- // stack: long, value
+ // stack: viewAddr, value
super.visitLdcInsn(fieldOffset);
- // stack: long, long, value
+ // stack: offset, viewAddr, value
super.visitInsn(LADD);
- // stack: long, value
+ // stack: fieldAddr, value
super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), typeName.toLowerCase() + "put", "(" + typeName + "J)V");
// stack -
+
return;
}
if ( opcode == GETFIELD ) {
// stack: ref
super.visitFieldInsn(GETFIELD, mappedSubtype.className, "viewAddress", "J");
- // stack: long
+ // stack: viewAddr
super.visitLdcInsn(fieldOffset);
- // stack: long, long
+ // stack: fieldOffset, viewAddr
super.visitInsn(LADD);
- // stack: long
+ // stack: fieldAddr
super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), typeName.toLowerCase() + "get", "(J)" + typeName);
// stack: value
+
return;
}
@@ -553,7 +557,7 @@
else if ( value >= Short.MIN_VALUE && value <= Short.MAX_VALUE )
mv.visitIntInsn(SIPUSH, value);
else
- mv.visitLdcInsn(Integer.valueOf(value));
+ mv.visitLdcInsn(value);
}
static String jvmClassName(Class<?> type) {
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -44,8 +44,8 @@
public int view;
void view(int view) {
- MappedHelper.put_view(this.a, view);
- MappedHelper.put_view(this.b, view);
+ MappedHelper.put_view(this.a, view, this.a.sizeof);
+ MappedHelper.put_view(this.b, view, this.b.sizeof);
}
public void next() {
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -45,9 +45,9 @@
public int view;
void view(int view) {
- MappedHelper.put_view(this.a, view);
- MappedHelper.put_view(this.b, view);
- MappedHelper.put_view(this.c, view);
+ MappedHelper.put_view(this.a, view, this.a.sizeof);
+ MappedHelper.put_view(this.b, view, this.b.sizeof);
+ MappedHelper.put_view(this.c, view, this.c.sizeof);
}
public void next() {
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java 2011-07-13 19:29:15 UTC (rev 3584)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java 2011-07-13 22:15:25 UTC (rev 3585)
@@ -46,10 +46,10 @@
public int view;
void view(int view) {
- MappedHelper.put_view(this.a, view);
- MappedHelper.put_view(this.b, view);
- MappedHelper.put_view(this.c, view);
- MappedHelper.put_view(this.d, view);
+ MappedHelper.put_view(this.a, view, this.a.sizeof);
+ MappedHelper.put_view(this.b, view, this.b.sizeof);
+ MappedHelper.put_view(this.c, view, this.c.sizeof);
+ MappedHelper.put_view(this.d, view, this.d.sizeof);
}
public void next() {
@@ -58,5 +58,4 @@
this.c.next();
this.d.next();
}
-
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2011-07-13 19:29:21
|
Revision: 3584
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3584&view=rev
Author: kappa1
Date: 2011-07-13 19:29:15 +0000 (Wed, 13 Jul 2011)
Log Message:
-----------
Updated JavaDoc for the new resizing api to clarify behaviour when running in fullscreen or with Display.setParent().
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-07-13 12:44:25 UTC (rev 3583)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-07-13 19:29:15 UTC (rev 3584)
@@ -1270,6 +1270,8 @@
/**
* @return true if the Display window has been resized.
* This value will be updated after a call to Display.update().
+ *
+ * This will return false if running in fullscreen or with Display.setParent(Canvas parent)
*/
public static boolean wasResized() {
return false;
@@ -1278,6 +1280,10 @@
/**
* @return this method will return the width of the Display window.
*
+ * If running in fullscreen mode it will return the width of the current set DisplayMode.
+ * If running Display.setParent(Canvas parent) is being used, the width of the parent
+ * will be returned.
+ *
* This value will be updated after a call to Display.update().
*/
public static int getWidth() {
@@ -1286,6 +1292,10 @@
/**
* @return this method will return the height of the Display window.
+ *
+ * If running in fullscreen mode it will return the height of the current set DisplayMode.
+ * If running Display.setParent(Canvas parent) is being used, the height of the parent
+ * will be returned.
*
* This value will be updated after a call to Display.update().
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2011-07-13 12:44:31
|
Revision: 3583
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3583&view=rev
Author: spasi
Date: 2011-07-13 12:44:25 +0000 (Wed, 13 Jul 2011)
Log Message:
-----------
Made MappedForeach package private (foreach returns Iterable now) and changed next() to go through the bounds check.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java
trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-12 22:07:32 UTC (rev 3582)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-13 12:44:25 UTC (rev 3583)
@@ -38,7 +38,7 @@
*
* @author Riven
*/
-public class MappedForeach<T extends MappedObject> implements Iterable<T> {
+final class MappedForeach<T extends MappedObject> implements Iterable<T> {
final T mapped;
final int elementCount;
@@ -58,8 +58,7 @@
}
public T next() {
- mapped.viewAddress = mapped.baseAddress + (this.index++) * mapped.stride;
-
+ MappedHelper.put_view(mapped, this.index++);
return mapped;
}
Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-12 22:07:32 UTC (rev 3582)
+++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-13 12:44:25 UTC (rev 3583)
@@ -214,7 +214,7 @@
* For convenience you are encouraged to static-import this specific method:
* <code>import static org.lwjgl.util.mapped.MappedObject.foreach;</code>
*/
- public static <T extends MappedObject> MappedForeach<T> foreach(T mapped, int elementCount) {
+ public static <T extends MappedObject> Iterable<T> foreach(T mapped, int elementCount) {
return new MappedForeach<T>(mapped, elementCount);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|