Converted ogl to static constructor

This commit is contained in:
Elias Naur 2003-07-06 21:47:30 +00:00
parent cdd4c044ba
commit 6bf70d35c7
4 changed files with 49 additions and 8 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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.