diff --git a/src/java/org/lwjgl/opengl/BaseGL.java b/src/java/org/lwjgl/opengl/BaseGL.java index 4982a016..11440702 100644 --- a/src/java/org/lwjgl/opengl/BaseGL.java +++ b/src/java/org/lwjgl/opengl/BaseGL.java @@ -99,7 +99,7 @@ public class BaseGL extends Window { * @param depth Required depth bits * @param stencil Required stencil bits */ - public BaseGL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { + protected BaseGL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { super(title, x, y, width, height); this.x = x; @@ -123,7 +123,7 @@ public class BaseGL extends Window { * @param depth Minimum bits per pixel in depth buffer * @param stencil Minimum bits per pixel in stencil buffer */ - public BaseGL(String title, int bpp, int alpha, int depth, int stencil) { + protected BaseGL(String title, int bpp, int alpha, int depth, int stencil) { super(title, 0, 0, Display.getWidth(), Display.getHeight()); this.x = 0; diff --git a/src/java/org/lwjgl/opengl/CoreGL.java b/src/java/org/lwjgl/opengl/CoreGL.java index ceac0362..4ffe41d5 100644 --- a/src/java/org/lwjgl/opengl/CoreGL.java +++ b/src/java/org/lwjgl/opengl/CoreGL.java @@ -59,7 +59,7 @@ public class CoreGL extends BaseGL implements CoreGLConstants { * @param depth * @param stencil */ - public CoreGL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { + protected CoreGL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { super(title, x, y, width, height, bpp, alpha, depth, stencil); } @@ -70,7 +70,7 @@ public class CoreGL extends BaseGL implements CoreGLConstants { * @param depth * @param stencil */ - public CoreGL(String title, int bpp, int alpha, int depth, int stencil) { + protected CoreGL(String title, int bpp, int alpha, int depth, int stencil) { super(title, bpp, alpha, depth, stencil); } diff --git a/src/java/org/lwjgl/opengl/GL.java b/src/java/org/lwjgl/opengl/GL.java index 9975dc08..5652f12e 100644 --- a/src/java/org/lwjgl/opengl/GL.java +++ b/src/java/org/lwjgl/opengl/GL.java @@ -53,6 +53,47 @@ import java.nio.Buffer; * @version $Revision$ */ public class GL extends CoreGL implements GLConstants { + private static GL gl_instance = null; + + /** + * Construct a windowed instance of GL. If the underlying OS does not + * support windowed mode, then the width and height must match the current + * display resolution, or an Exception will be thrown. Otherwise a fullscreen + * window will be created. + * + * @param title + * @param x + * @param y + * @param width + * @param height + * @param bpp + * @param alpha + * @param depth + * @param stencil + */ + public static void createContext(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { + new GL(title, x, y, width, height, bpp, alpha, depth, stencil); + } + + /** + * Construct a fullscreen instance of GL. If the underlying OS does not + * support fullscreen mode, then a window will be created instead. If this + * fails too then an Exception will be thrown. + * + * @param title + * @param bpp + * @param alpha + * @param depth + * @param stencil + */ + public static void createContext(String title, int bpp, int alpha, int depth, int stencil) { + new GL(title, bpp, alpha, depth, stencil); + } + + public static void destroyContext() { + getCurrentWindow().destroy(); + } + /** * @param title * @param x @@ -64,7 +105,7 @@ public class GL extends CoreGL implements GLConstants { * @param depth * @param stencil */ - public GL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { + protected GL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) { super(title, x, y, width, height, bpp, alpha, depth, stencil); } @@ -75,7 +116,7 @@ public class GL extends CoreGL implements GLConstants { * @param depth * @param stencil */ - public GL(String title, int bpp, int alpha, int depth, int stencil) { + protected GL(String title, int bpp, int alpha, int depth, int stencil) { super(title, bpp, alpha, depth, stencil); } diff --git a/src/native/configure.in b/src/native/configure.in index 2634541a..10bb5981 100644 --- a/src/native/configure.in +++ b/src/native/configure.in @@ -51,8 +51,8 @@ if test "x$JAVA_HOME" = x; then else AC_MSG_RESULT($JAVA_HOME) JAVA_HOME="$JAVA_HOME" - CPPFLAGS="$CPPFLAGS -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" - CFLAGS="$CFLAGS -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CPPFLAGS="$CPPFLAGS -D_DEBUG -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CFLAGS="$CFLAGS -D_DEBUG -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" fi dnl Checks for libraries.