aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-06-03 19:57:05 +0000
committerSven Gothel <[email protected]>2009-06-03 19:57:05 +0000
commitaf23607f257b01777d52c93f8908912d1ae8c8bb (patch)
treea25f002e6ad9cc827981d6fe33ed15627edc7fdf /src/newt/classes
parent522e3b3ed592d80881938cc3176d5fba5289a79f (diff)
Tested:
- Linux / X11 / GL3 / GL2 / ES1 / ES2 - Using etc/profile.jogl JOGL_ALL . ./setenv-jogl.x86.sh JOGL_ALL - Java2D/GLJPanel: demos.jrefract.JRefract - GLCanvas: demos.gears.Gears - Newt/Nativewindow (demos.GLInfo, demos.es2.RedSquare, demos.es2.RedSquare) - with multiple instances of different GL profiles, ie java demos.es1.RedSquare -GLES2 -GLES1 java demos.GLInfo -GLES2 -GL2 - GL 3.1 test with demos.GLInfo java demos.GLInfo -GL3 java demos.GLInfo -GL3 -GL2 with NVIDIA 180.37.05 JOGL Enable parallel GLProfiles: - GL holds it's GLProfile - GL / GLBase added: hasGLSL() getGLProfile() - Removed all hardcoded GLProfile checks - Make GLProfile an instance of GLCapabilities - GLCapabilities needs GLProfile in constructor, or null for the default GLProfile - All GLProfiles are singelton mapped objects, setup and verified at static init. - All GLDrawableFactories in GLDrawableFactory are singelton objects, setup at static init. - GLDrawableFactories.getFactory() needs an argument, which leads to GLProfile, ie NativeWindow, AbstractGraphicsConfiguration, GLCapabilities or GLProfile. - EGLDrawableFactory takes GLProfile as an argument, being able to take the singleton role as ES1 or ES2 - EGLDrawableFactory loads ES & EGL libraries _local_, otherwise the symbols produce a collision (Unix/PC-Emulation). TODO: Check on Windows/WinCE ! - Fixing etc/profile.jogl JOGL_ALL EGLGraphicsConfigurationFactory - Added eglGetConfigs -> GLCapabilities -> eglChooseConfig, in case the simple eglChooseConfig fails. - Using given chooser, is null, use DefaultGLCapabilitiesChooser Moved FixedFuncUtil.class -> jogl.util.jar, otherwise the FixedFuncUtil pipeline cannot be used without emulation. GLDrawable Rename getChosenGLCapabilities() -> getGLCapabilities(), since all GLCapabilities access functions return the current state. Add getGLProfile() NativeLibLoader[Base] Added 'addLoaded' and 'isLoaded', so all LoadAction implementation can use it and circumvent double library loading. GlueGen Split openLibrary -> openLibraryLocal / Global, utilizing as an optional flag (global), which is true per default. TODO: How to do this on Windows ? TODO: Verify Windows and MacOSX !! git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1922 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/newt/classes')
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/NewtFactory.java16
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Window.java5
-rw-r--r--src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java18
-rw-r--r--src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java29
4 files changed, 34 insertions, 34 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java b/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
index 993c3c8a0..c9b230355 100755
--- a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
+++ b/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
@@ -41,7 +41,7 @@ public abstract class NewtFactory {
// Work-around for initialization order problems on Mac OS X
// between native Newt and (apparently) Fmod
static {
- Window.init(NativeWindowFactory.getNativeWindowType());
+ Window.init(NativeWindowFactory.getNativeWindowType(true));
}
static int getPropertyIntValue(String propname) {
@@ -59,7 +59,7 @@ public abstract class NewtFactory {
* Create a Display entity, incl native creation
*/
public static Display createDisplay(String name) {
- return Display.create(NativeWindowFactory.getNativeWindowType(), name);
+ return Display.create(NativeWindowFactory.getNativeWindowType(true), name);
}
/**
@@ -73,7 +73,7 @@ public abstract class NewtFactory {
* Create a Screen entity, incl native creation
*/
public static Screen createScreen(Display display, int index) {
- return Screen.create(NativeWindowFactory.getNativeWindowType(), display, index);
+ return Screen.create(NativeWindowFactory.getNativeWindowType(true), display, index);
}
/**
@@ -87,11 +87,11 @@ public abstract class NewtFactory {
* Create a Window entity, incl native creation
*/
public static Window createWindow(Screen screen, Capabilities caps) {
- return Window.create(NativeWindowFactory.getNativeWindowType(), screen, caps);
+ return Window.create(NativeWindowFactory.getNativeWindowType(true), screen, caps);
}
public static Window createWindow(Screen screen, Capabilities caps, boolean undecorated) {
- return Window.create(NativeWindowFactory.getNativeWindowType(), screen, caps, undecorated);
+ return Window.create(NativeWindowFactory.getNativeWindowType(true), screen, caps, undecorated);
}
/**
@@ -105,14 +105,14 @@ public abstract class NewtFactory {
* Instantiate a Display entity using the native handle.
*/
public static Display wrapDisplay(String name, AbstractGraphicsDevice device) {
- return Display.wrapHandle(NativeWindowFactory.getNativeWindowType(), name, device);
+ return Display.wrapHandle(NativeWindowFactory.getNativeWindowType(true), name, device);
}
/**
* Instantiate a Screen entity using the native handle.
*/
public static Screen wrapScreen(Display display, AbstractGraphicsScreen screen) {
- return Screen.wrapHandle(NativeWindowFactory.getNativeWindowType(), display, screen);
+ return Screen.wrapHandle(NativeWindowFactory.getNativeWindowType(true), display, screen);
}
/**
@@ -121,7 +121,7 @@ public abstract class NewtFactory {
public static Window wrapWindow(Screen screen, AbstractGraphicsConfiguration config,
long windowHandle, boolean fullscreen, boolean visible,
int x, int y, int width, int height) {
- return Window.wrapHandle(NativeWindowFactory.getNativeWindowType(), screen, config,
+ return Window.wrapHandle(NativeWindowFactory.getNativeWindowType(true), screen, config,
windowHandle, fullscreen, visible, x, y, width, height);
}
diff --git a/src/newt/classes/com/sun/javafx/newt/Window.java b/src/newt/classes/com/sun/javafx/newt/Window.java
index f400265ee..8bbda68f1 100755
--- a/src/newt/classes/com/sun/javafx/newt/Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/Window.java
@@ -292,11 +292,6 @@ public abstract class Window implements NativeWindow
return windowHandle; // default: return window handle
}
- public Capabilities getChosenCapabilities() {
- // Must return a new copy to avoid mutation by end user
- return (Capabilities) config.getCapabilities().clone();
- }
-
public AbstractGraphicsConfiguration getGraphicsConfiguration() {
return config;
}
diff --git a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java b/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java
index 3e8104280..b6754c35b 100644
--- a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java
+++ b/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java
@@ -69,18 +69,22 @@ public class NativeLibLoader extends NativeLibLoaderBase {
boolean preloadIgnoreError) {
if (null!=preload) {
for (int i=0; i<preload.length; i++) {
- try {
- loadLibraryInternal(preload[i]);
- }
- catch (UnsatisfiedLinkError e) {
- if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) {
- throw e;
- }
+ if(!isLoaded(preload[i])) {
+ try {
+ loadLibraryInternal(preload[i]);
+ addLoaded(preload[i]);
+ }
+ catch (UnsatisfiedLinkError e) {
+ if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) {
+ throw e;
+ }
+ }
}
}
}
loadLibraryInternal(libname);
+ addLoaded(libname);
}
}
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
index 634e05e5f..ec7458539 100644
--- a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
@@ -129,7 +129,7 @@ public class GLWindow extends Window implements GLAutoDrawable {
GLCapabilities caps,
boolean undecorated) {
if (caps == null) {
- caps = new GLCapabilities();
+ caps = new GLCapabilities(null); // default ..
}
boolean ownerOfDisplayAndScreen=false;
@@ -267,11 +267,11 @@ public class GLWindow extends Window implements GLAutoDrawable {
public void setVisible(boolean visible) {
window.setVisible(visible);
if (visible && context == null) {
- factory = GLDrawableFactory.getFactory();
NativeWindow nw = window;
if (window.getWrappedWindow() != null) {
nw = NativeWindowFactory.getNativeWindow(window.getWrappedWindow(), nw.getGraphicsConfiguration());
}
+ factory = GLDrawableFactory.getFactory(nw);
drawable = factory.createGLDrawable(nw);
window.setVisible(true);
drawable.setRealized(true);
@@ -531,14 +531,6 @@ public class GLWindow extends Window implements GLAutoDrawable {
private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
//----------------------------------------------------------------------
- // Window methods that are not really needed
- //
-
- public Capabilities getChosenCapabilities() {
- return getChosenGLCapabilities();
- }
-
- //----------------------------------------------------------------------
// GLDrawable methods that are not really needed
//
@@ -549,11 +541,20 @@ public class GLWindow extends Window implements GLAutoDrawable {
public void setRealized(boolean realized) {
}
- public GLCapabilities getChosenGLCapabilities() {
- if (drawable == null)
- return null;
+ public GLCapabilities getGLCapabilities() {
+ if (drawable == null) {
+ throw new GLException("No drawable yet");
+ }
+
+ return drawable.getGLCapabilities();
+ }
+
+ public GLProfile getGLProfile() {
+ if (drawable == null) {
+ throw new GLException("No drawable yet");
+ }
- return drawable.getChosenGLCapabilities();
+ return drawable.getGLProfile();
}
public NativeWindow getNativeWindow() {