mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 22:45:50 +00:00
Converted ogl to static constructor
This commit is contained in:
parent
cdd4c044ba
commit
6bf70d35c7
4 changed files with 49 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue