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
|
3
(9) |
|
4
(28) |
5
(1) |
6
(9) |
7
(9) |
8
|
9
(7) |
10
|
|
11
(1) |
12
(18) |
13
(8) |
14
|
15
|
16
(2) |
17
(2) |
|
18
(17) |
19
(5) |
20
(5) |
21
(12) |
22
(1) |
23
|
24
|
|
25
|
26
(1) |
27
|
28
|
29
(3) |
30
(2) |
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 23:26:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1624/src/java/org/lwjgl/opengl Modified Files: Window.java Log Message: Added clamping to window bounds Index: Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Window.java 3 Apr 2004 23:01:38 -0000 1.38 +++ Window.java 3 Apr 2004 23:14:19 -0000 1.39 @@ -623,6 +623,9 @@ /** * Set the window's location. This is a no-op on fullscreen windows. + * The window is clamped to remain entirely on the screen. If you attempt + * to position the window such that it would extend off the screen, the window + * is simply placed as close to the edge as possible. * @param x, y The new window location */ public static void setLocation(int x, int y) { @@ -631,14 +634,16 @@ if (fullscreen) { return; } - Window.x = x; - Window.y = y; + Window.x = Math.max(0, Math.min(Display.getWidth() - Window.width, x)); + Window.y = Math.max(0, Math.min(Display.getHeight() - Window.height, y)); nReshape(Window.x, Window.y, Window.width, Window.height); } /** * Set the window's size. This is a no-op on fullscreen windows. - * The window's size is clipped to the screen bounds. + * The window is clamped to remain entirely on the screen. If you attempt + * to position the window such that it would extend off the screen, the window + * is simply placed as close to the edge as possible. * @param width, height The new window dimensions */ public static void setSize(int width, int height) { @@ -647,13 +652,14 @@ if (fullscreen) { return; } - Window.width = width; - Window.height = height; + Window.width = Math.max(0, Math.min(Display.getWidth() - Window.x, width)); + Window.height = Math.max(0, Math.min(Display.getHeight() - Window.y, height)); nReshape(Window.x, Window.y, Window.width, Window.height); } /** - * Set the window's wounds. This is a no-op on fullscreen windows. + * Set the window's bounds. This is a no-op on fullscreen windows. + * The window is clamped to remain entirely on the screen. * @param x, y The new window location * @param width, height The new window dimensions */ @@ -663,10 +669,12 @@ if (fullscreen) { return; } - Window.x = x; - Window.y = y; - Window.width = width; - Window.height = height; + width = Math.max(0, Math.min(Display.getWidth(), width)); + height = Math.max(0, Math.min(Display.getHeight(), height)); + Window.x = Math.max(0, Math.min(Display.getWidth() - width, x)); + Window.y = Math.max(0, Math.min(Display.getHeight() - height, y)); + Window.width = Math.max(0, Math.min(Display.getWidth() - Window.x, width)); + Window.height = Math.max(0, Math.min(Display.getHeight() - Window.y, height)); nReshape(Window.x, Window.y, Window.width, Window.height); } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 23:14:02
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31600/src/native/linux Modified Files: org_lwjgl_opengl_Window.cpp Log Message: New window sizing & undecorated code Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_opengl_Window.cpp 29 Mar 2004 11:26:26 -0000 1.26 +++ org_lwjgl_opengl_Window.cpp 3 Apr 2004 23:01:39 -0000 1.27 @@ -68,7 +68,8 @@ static bool input_released; -static bool dirty; +static bool isUndecorated; +static bool focused; static bool vsync_enabled; static bool minimized; static bool focused; @@ -179,7 +180,7 @@ env->ReleaseStringUTFChars(title_obj, title); } -static void createWindow(JNIEnv* env, Display *disp, int screen, XVisualInfo *vis_info, jstring title, int x, int y, int width, int height, bool fullscreen) { +static void createWindow(JNIEnv* env, Display *disp, int screen, XVisualInfo *vis_info, jstring title, int x, int y, int width, int height, bool fullscreen, bool undecorated) { dirty = true; focused = true; minimized = false; @@ -391,7 +392,7 @@ extgl_Close(); } -static bool initWindowGLX13(JNIEnv *env, Display *disp, int screen, jstring title, int x, int y, int width, int height, int bpp, int depth, int alpha, int stencil, int samples, bool fscreen) { +static bool initWindowGLX13(JNIEnv *env, Display *disp, int screen, jstring title, int x, int y, int width, int height, int bpp, int depth, int alpha, int stencil, int samples, bool fscreen, bool undecorated) { GLXFBConfig *configs = chooseVisualGLX13(disp, screen, bpp, depth, alpha, stencil, samples); if (configs == NULL) { throwException(env, "Could not find a matching pixel format"); @@ -417,7 +418,7 @@ throwException(env, "Could not create visual info from FB config"); return false; } - createWindow(env, disp, screen, vis_info, title, x, y, width, height, fscreen); + createWindow(env, disp, screen, vis_info, title, x, y, width, height, fscreen, undecorated); glx_window = glXCreateWindow(disp, configs[0], getCurrentWindow(), NULL); makeCurrent(); if (isDebugEnabled()) @@ -427,7 +428,7 @@ return true; } -static bool initWindowGLX(JNIEnv *env, Display *disp, int screen, jstring title, int x, int y, int width, int height, int bpp, int depth, int alpha, int stencil, int samples, bool fscreen) { +static bool initWindowGLX(JNIEnv *env, Display *disp, int screen, jstring title, int x, int y, int width, int height, int bpp, int depth, int alpha, int stencil, int samples, bool fscreen, bool undecorated) { XVisualInfo *vis_info = chooseVisual(disp, screen, bpp, depth, alpha, stencil, samples); if (vis_info == NULL) { throwException(env, "Could not find a matching pixel format"); @@ -448,20 +449,22 @@ throwException(env, "Could not create a direct GLX context"); return false; } - createWindow(env, disp, screen, vis_info, title, x, y, width, height, fscreen); + createWindow(env, disp, screen, vis_info, title, x, y, width, height, fscreen, undecorated); makeCurrent(); XFree(vis_info); return true; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate - (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jint samples) + (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jboolean undecorated, jint bpp, jint alpha, jint depth, jint stencil, jint samples) { int screen; Display *disp; bool fscreen = false; if (fullscreen == JNI_TRUE) fscreen = true; + if (undecorated == JNI_TRUE) + isUndecorated = true; if (!extgl_Open()) { throwException(env, "Could not load gl libs"); @@ -481,9 +484,9 @@ } bool create_success; if (USEGLX13) { - create_success = initWindowGLX13(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, samples, fscreen); + create_success = initWindowGLX13(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, samples, fscreen, isUndecorated); } else { - create_success = initWindowGLX(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, samples, fscreen); + create_success = initWindowGLX(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, samples, fscreen, isUndecorated); } if (!create_success) { XCloseDisplay(disp); @@ -597,3 +600,8 @@ } } } + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nReshape + (JNIEnv *env, jclass clazz, jint x, jint y, jint width, jint height) +{ +} |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 23:14:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31600/src/java/org/lwjgl/test/opengl Added Files: BouncingWindowTest.java Log Message: New window sizing & undecorated code --- NEW FILE: BouncingWindowTest.java --- /* * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.opengl; import org.lwjgl.Display; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Window; /** * $Id: BouncingWindowTest.java,v 1.1 2004/04/03 23:01:39 cix_foo Exp $ * * Tests the windowing functions. ESCAPE quits. * * @author $author$ * @version $revision$ */ public class BouncingWindowTest { public static void main(String[] args) { int x = 0, y = 0, dx = 1, dy = 1; try { Window.create("Bouncing Window Test", 0, 0, 64, 64, true, 16, 0, 16, 8, 0); } catch (LWJGLException e) { e.printStackTrace(System.err); System.exit(-1); } Window.setVSyncEnabled(true); float angle = 0.0f; float color = 0.0f; while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Window.isCloseRequested()) { Window.update(); x += dx; y += dy; if (x < 0) { x = 1; dx = 1; } else if (x >= Display.getWidth() - Window.getWidth()) { x = Display.getWidth() - Window.getWidth() - 1; dx = -1; } if (y < 0) { y = 1; dy = 1; } else if (y >= Display.getHeight() - Window.getHeight()) { y = Display.getHeight() - Window.getHeight() - 1; dy = -1; } Window.setLocation(x, y); angle += 1.0f; if (angle >= 360.0f) { angle = 0.0f; } color += 0.01f; GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL11.glPushMatrix(); GL11.glTranslatef(Window.getWidth() / 2.0f, Window.getHeight() / 2.0f, 0.0f); GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f); GL11.glColor3f( (float)Math.abs(Math.sin(color)), (float)Math.abs(Math.cos(color)), (float)Math.abs(Math.sin(color) * Math.cos(color)) ); GL11.glBegin(GL11.GL_QUADS); { GL11.glVertex2f(-20.0f, -20.0f); GL11.glVertex2f(20.0f, -20.0f); GL11.glVertex2f(20.0f, 20.0f); GL11.glVertex2f(-20.0f, 20.0f); } GL11.glEnd(); GL11.glPopMatrix(); } } } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 23:14:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31600/src/native/common Modified Files: org_lwjgl_opengl_Window.h Log Message: New window sizing & undecorated code Index: org_lwjgl_opengl_Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_Window.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_opengl_Window.h 26 Mar 2004 11:01:57 -0000 1.14 +++ org_lwjgl_opengl_Window.h 3 Apr 2004 23:01:39 -0000 1.15 @@ -93,10 +93,10 @@ /* * Class: org_lwjgl_opengl_Window * Method: nCreate - * Signature: (Ljava/lang/String;IIIIZIIIII)V + * Signature: (Ljava/lang/String;IIIIZZIIIII)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate - (JNIEnv *, jclass, jstring, jint, jint, jint, jint, jboolean, jint, jint, jint, jint, jint); + (JNIEnv *, jclass, jstring, jint, jint, jint, jint, jboolean, jboolean, jint, jint, jint, jint, jint); /* * Class: org_lwjgl_opengl_Window @@ -130,6 +130,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nSetVSyncEnabled (JNIEnv *, jclass, jboolean); +/* + * Class: org_lwjgl_opengl_Window + * Method: nReshape + * Signature: (IIII)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nReshape + (JNIEnv *, jclass, jint, jint, jint, jint); + #ifdef __cplusplus } #endif |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 23:14:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31600/src/native/win32 Modified Files: org_lwjgl_opengl_Window.cpp Log Message: New window sizing & undecorated code Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- org_lwjgl_opengl_Window.cpp 26 Mar 2004 11:02:36 -0000 1.24 +++ org_lwjgl_opengl_Window.cpp 3 Apr 2004 23:01:38 -0000 1.25 @@ -54,6 +54,7 @@ static bool isMinimized = false; // Whether we're minimized or not static bool isFocused = false; // whether we're focused or not static bool isDirty = false; // Whether we're dirty or not +static bool isUndecorated = false; // Whether we're undecorated or not extern HINSTANCE dll_handle; // Handle to the LWJGL dll RECT clientSize; @@ -382,21 +383,23 @@ * * Returns true for success, or false for failure */ -static bool createWindow(JNIEnv *env, jstring title_obj, int x, int y, int width, int height, bool fullscreen) +static bool createWindow(JNIEnv *env, jstring title_obj, int x, int y, int width, int height, bool fullscreen, bool undecorated) { - // 2. Create the window int exstyle, windowflags; if (fullscreen) { exstyle = WS_EX_APPWINDOW | WS_EX_TOPMOST; windowflags = WS_POPUP; + } else if (undecorated) { + exstyle = WS_EX_APPWINDOW; + windowflags = WS_POPUP; } else { exstyle = WS_EX_APPWINDOW; windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU; } // If we're not a fullscreen window, adjust the height to account for the - // height of the title bar: + // height of the title bar (unless undecorated) clientSize.bottom = height; clientSize.left = 0; clientSize.right = width; @@ -523,13 +526,14 @@ * Signature: (Ljava/lang/String;IIIIZIIII)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate - (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jint samples) + (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jboolean undecorated, jint bpp, jint alpha, jint depth, jint stencil, jint samples) { closerequested = false; isMinimized = false; isFocused = true; isDirty = true; isFullScreen = fullscreen == JNI_TRUE; + isUndecorated = undecorated == JNI_TRUE; vsync = JNI_FALSE; // Speacial option for allowing software opengl @@ -546,7 +550,7 @@ return; } - if (!createWindow(env, title, x, y, width, height, isFullScreen)) { + if (!createWindow(env, title, x, y, width, height, isFullScreen, isUndecorated)) { extgl_Close(); return; } @@ -564,7 +568,7 @@ wglMakeCurrent(NULL, NULL); wglDeleteContext(hglrc); closeWindow(); - if (!createWindow(env, title, x, y, width, height, isFullScreen)) { + if (!createWindow(env, title, x, y, width, height, isFullScreen, isUndecorated)) { extgl_Close(); return; } @@ -574,14 +578,7 @@ return; } } - /* - if (!extgl_Initialize(env, ext_set)) { - closeWindow(); - extgl_Close(); - throwException(env, "Failed to initialize GL extensions"); - return; - } - */ + if (!createDirectInput()) { // Close the window closeWindow(); @@ -693,3 +690,38 @@ { wglMakeCurrent(hdc, hglrc); } + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nReshape + (JNIEnv *env, jclass clazz, jint x, jint y, jint width, jint height) +{ + if (isFullScreen) { + return; + } + + int exstyle, windowflags; + + if (isUndecorated) { + exstyle = WS_EX_APPWINDOW; + windowflags = WS_OVERLAPPED; + } else { + exstyle = WS_EX_APPWINDOW; + windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU; + } + + // If we're not a fullscreen window, adjust the height to account for the + // height of the title bar: + clientSize.bottom = height; + clientSize.left = 0; + clientSize.right = width; + clientSize.top = 0; + + AdjustWindowRectEx( + &clientSize, // client-rectangle structure + windowflags, // window styles + FALSE, // menu-present option + exstyle // extended window style + ); + + SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, + clientSize.bottom - clientSize.top, SWP_NOZORDER); +} |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 23:14:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31600/src/java/org/lwjgl/opengl Modified Files: Window.java Log Message: New window sizing & undecorated code Index: Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- Window.java 3 Apr 2004 21:05:57 -0000 1.37 +++ Window.java 3 Apr 2004 23:01:38 -0000 1.38 @@ -80,6 +80,9 @@ /** Fullscreen */ private static boolean fullscreen; + + /** Undecorated */ + private static boolean undecorated; /** Tracks VBO state for the window context */ private static VBOTracker vbo_tracker; @@ -103,6 +106,24 @@ } /** + * @return the X coordinate of the window (always 0 for fullscreen) + */ + public static int getX() { + if (!isCreated()) + throw new IllegalStateException("Cannot get X on uncreated window"); + return x; + } + + /** + * @return the Y coordinate of the window (always 0 for fullscreen) + */ + public static int getY() { + if (!isCreated()) + throw new IllegalStateException("Cannot get Y on uncreated window"); + return y; + } + + /** * @return the width of the window */ public static int getWidth() { @@ -326,6 +347,7 @@ if (isCreated()) throw new IllegalStateException("Only one LWJGL window may be instantiated at any one time."); Window.fullscreen = true; + Window.undecorated = true; Window.x = 0; Window.y = 0; Window.width = Display.getWidth(); @@ -352,7 +374,29 @@ * the minimum requirements could not be met satisfactorily */ public static void create(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) throws LWJGLException { - create(title, x, y, width, height, bpp, alpha, depth, stencil, 0); + create(title, x, y, width, height, false, bpp, alpha, depth, stencil); + } + + /** + * Create a window. If the underlying OS does not have "floating" windows, then a fullscreen + * display will be created instead. If this fails too then an LWJGLException will be thrown. + * If the window is created fullscreen, then its size may not match the specified size + * here. + * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. + * @param title The title of the window + * @param x The position of the window on the x axis. May be ignored. + * @param y The position of the window on the y axis. May be ignored. + * @param width The width of the window's client area + * @param height The height of the window's client area + * @param undecorated A hint to specify that the window should not have OS decorations such as drag bar and close box + * @param bpp Minimum bits per pixel + * @param alpha Minimum bits per pixel in alpha buffer + * @param depth Minimum bits per pixel in depth buffer + * @throws LWJGLException if the window could not be created for any reason; typically because + * the minimum requirements could not be met satisfactorily + */ + public static void create(String title, int x, int y, int width, int height, boolean undecorated, int bpp, int alpha, int depth, int stencil) throws LWJGLException { + create(title, x, y, width, height, undecorated, bpp, alpha, depth, stencil, 0); } /** @@ -377,9 +421,37 @@ */ public static void create(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil, int samples) throws LWJGLException { + + create(title, x, y, width, height, false, bpp, alpha, depth, stencil, samples); + } + + /** + * Create a window. If the underlying OS does not have "floating" windows, then a fullscreen + * display will be created instead. If this fails too then an LWJGLException will be thrown. + * If the window is created fullscreen, then its size may not match the specified size + * here. + * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. + * @param title The title of the window + * @param x The position of the window on the x axis. May be ignored. + * @param y The position of the window on the y axis. May be ignored. + * @param width The width of the window's client area + * @param height The height of the window's client area + * @param undecorated A hint to specify that the window should not have OS decorations such as drag bar and close box + * @param bpp Minimum bits per pixel + * @param alpha Minimum bits per pixel in alpha buffer + * @param depth Minimum bits per pixel in depth buffer + * @param stencil Minimum bits per pixel in stencil buffer + * @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec). + Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. + * @throws LWJGLException if the window could not be created for any reason; typically because + * the minimum requirements could not be met satisfactorily + */ + public static void create(String title, int x, int y, int width, int height, boolean undecorated, int bpp, int alpha, int depth, int stencil, int samples) + throws LWJGLException { if (isCreated()) throw new IllegalStateException("Only one LWJGL window may be instantiated at any one time."); Window.fullscreen = false; + Window.undecorated = undecorated; Window.x = x; Window.y = y; Window.width = width; @@ -399,6 +471,7 @@ int width, int height, boolean fullscreen, + boolean undecordated, int bpp, int alpha, int depth, @@ -407,7 +480,7 @@ throws LWJGLException; private static void createWindow(int bpp, int alpha, int depth, int stencil, int samples) throws LWJGLException { - nCreate(title, x, y, width, height, fullscreen, bpp, alpha, depth, stencil, samples); + nCreate(title, x, y, width, height, fullscreen, undecorated, bpp, alpha, depth, stencil, samples); context = new Window(); makeCurrent(); @@ -548,5 +621,60 @@ private static native void nSetVSyncEnabled(boolean sync); + /** + * Set the window's location. This is a no-op on fullscreen windows. + * @param x, y The new window location + */ + public static void setLocation(int x, int y) { + if (!isCreated()) + throw new IllegalStateException("Cannot move uncreated window"); + if (fullscreen) { + return; + } + Window.x = x; + Window.y = y; + nReshape(Window.x, Window.y, Window.width, Window.height); + } + + /** + * Set the window's size. This is a no-op on fullscreen windows. + * The window's size is clipped to the screen bounds. + * @param width, height The new window dimensions + */ + public static void setSize(int width, int height) { + if (!isCreated()) + throw new IllegalStateException("Cannot resize uncreated window"); + if (fullscreen) { + return; + } + Window.width = width; + Window.height = height; + nReshape(Window.x, Window.y, Window.width, Window.height); + } + + /** + * Set the window's wounds. This is a no-op on fullscreen windows. + * @param x, y The new window location + * @param width, height The new window dimensions + */ + public static void setBounds(int x, int y, int width, int height) { + if (!isCreated()) + throw new IllegalStateException("Cannot reshape uncreated window"); + if (fullscreen) { + return; + } + Window.x = x; + Window.y = y; + Window.width = width; + Window.height = height; + nReshape(Window.x, Window.y, Window.width, Window.height); + } + + /** + * Native method to reshape the window + * @param x, y The new window location + * @param width, height The new window dimensions + */ + private static native void nReshape(int x, int y, int width, int height); } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 21:20:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13174/src/java/org/lwjgl/opengl Modified Files: BufferChecks.java Log Message: Superfluous import Index: BufferChecks.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BufferChecks.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- BufferChecks.java 29 Mar 2004 19:09:10 -0000 1.8 +++ BufferChecks.java 3 Apr 2004 21:08:23 -0000 1.9 @@ -27,7 +27,7 @@ */ package org.lwjgl.opengl; import java.nio.Buffer; -import java.nio.BufferOverflowException; + /** * $Id$ A class to * check buffer boundaries in GL methods. Many GL methods read data from the GL |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-04-03 21:18:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12740/src/java/org/lwjgl/opengl Modified Files: Window.java Log Message: Added four boolean properties to alter default behaviour in non-standard apps Index: Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- Window.java 28 Mar 2004 20:29:52 -0000 1.36 +++ Window.java 3 Apr 2004 21:05:57 -0000 1.37 @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2004 Light Weight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'Light Weight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -35,7 +35,7 @@ /** * This is the abstract class for a Window in LWJGL. LWJGL windows have some * peculiar characteristics: - * + * * - width and height are always fixed and cannot be changed * - the position of the window may or may not be programmable but once specified * cannot be changed programmatically @@ -43,7 +43,7 @@ * by the user or operating system * - only one window may ever be open at once * - the operating system may or may not be able to do fullscreen or windowed windows. - * + * * @author foo */ @@ -83,10 +83,10 @@ /** Tracks VBO state for the window context */ private static VBOTracker vbo_tracker; - + /** A unique context object, so we can track different contexts between creates() and destroys() */ private static Window context; - + /** Whether we created the Mouse */ private static boolean createdMouse; @@ -128,7 +128,7 @@ throw new IllegalStateException("Cannot get title on uncreated window"); return title; } - + /** * @return whether this window is in fullscreen mode */ @@ -192,7 +192,7 @@ * Minimize the game and allow the operating system's default display to become * visible. It is the responsibility of LWJGL's native code to restore the display * to its normal display settings. - * + * * If the display is already minimized then this is a no-op. */ public static native void minimize(); @@ -200,7 +200,7 @@ /** * Restore the game and hide the operating system away. It is the responsibility of * LWJGL's native code to restore the display to its game display settings. - * + * * If the display is not minimized then this is a no-op/ */ public static native void restore(); @@ -211,7 +211,7 @@ * every frame regardless, you can ignore this flag altogether. If you are * trying to be kind to other processes you can check this flag and only * redraw when it returns true. The flag is cleared when you call paint(). - * + * * @return true if the window has been damaged by external changes * and needs to repaint itself */ @@ -262,7 +262,7 @@ * Swap double buffers. */ private static native void swapBuffers(); - + /** * Make the Window the current rendering context for GL calls. */ @@ -272,12 +272,12 @@ nMakeCurrent(); GLContext.useContext(context); } - + /** * Make the window the current rendering context for GL calls. */ private static native void nMakeCurrent(); - + /** * Create a fullscreen window that matches the current display depth. Default common values are chosen * for common OpenGL rendering operations: you will get at least a 16-bit depth buffer, an 8 bit stencil @@ -306,7 +306,7 @@ public static void create(String title, int bpp, int alpha, int depth, int stencil) throws LWJGLException { create(title, bpp, alpha, depth, stencil, 0); } - + /** * Create a fullscreen window. If the underlying OS does not * support fullscreen mode, then a window will be created instead. If this @@ -421,42 +421,44 @@ GL11.glViewport(0, 0, width, height); // Automatically create mouse, keyboard and controller - if (!Mouse.isCreated()) { - try { - Mouse.create(); - createdMouse = true; - Mouse.enableBuffer(); - } catch (LWJGLException e) { - if (Sys.DEBUG) { - e.printStackTrace(System.err); - } else { - Sys.log("Failed to create Mouse: "+e); + if (!Boolean.getBoolean("org.lwjgl.opengl.Window.noinput")) { + if (!Mouse.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Window.nomouse")) { + try { + Mouse.create(); + createdMouse = true; + Mouse.enableBuffer(); + } catch (LWJGLException e) { + if (Sys.DEBUG) { + e.printStackTrace(System.err); + } else { + Sys.log("Failed to create Mouse: "+e); + } } } - } - if (!Keyboard.isCreated()) { - try { - Keyboard.create(); - createdKeyboard = true; - Keyboard.enableBuffer(); - Keyboard.enableTranslation(); - } catch (LWJGLException e) { - if (Sys.DEBUG) { - e.printStackTrace(System.err); - } else { - Sys.log("Failed to create Keyboard: "+e); + if (!Keyboard.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Window.nokeyboard")) { + try { + Keyboard.create(); + createdKeyboard = true; + Keyboard.enableBuffer(); + Keyboard.enableTranslation(); + } catch (LWJGLException e) { + if (Sys.DEBUG) { + e.printStackTrace(System.err); + } else { + Sys.log("Failed to create Keyboard: "+e); + } } } - } - if (!Controller.isCreated()) { - try { - Controller.create(); - createdController = true; - } catch (LWJGLException e) { - if (Sys.DEBUG) { - e.printStackTrace(System.err); - } else { - Sys.log("Failed to create Controller: "+e); + if (!Controller.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Window.nocontroller")) { + try { + Controller.create(); + createdController = true; + } catch (LWJGLException e) { + if (Sys.DEBUG) { + e.printStackTrace(System.err); + } else { + Sys.log("Failed to create Controller: "+e); + } } } } @@ -470,7 +472,7 @@ if (context == null) { return; } - + // Automatically destroy keyboard, mouse, and controller if (createdMouse && Mouse.isCreated()) { Mouse.destroy(); @@ -484,12 +486,12 @@ Controller.destroy(); createdController = false; } - + makeCurrent(); nDestroy(); context = null; } - + /** * @return the unique Window context (or null, if the Window has not been created) */ @@ -531,7 +533,7 @@ } private static native boolean nIsVSyncEnabled(); - + /** * Enable or disable vertical monitor synchronization. This call is a best-attempt at changing * the vertical refresh synchronization of the monitor, and is not guaranteed to be successful. @@ -545,4 +547,6 @@ } private static native void nSetVSyncEnabled(boolean sync); + + } |
|
From: Brian M. <ma...@us...> - 2004-04-03 18:30:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16580 Modified Files: Mouse.java Log Message: center mouse as cursor is Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Mouse.java 27 Mar 2004 15:05:23 -0000 1.46 +++ Mouse.java 3 Apr 2004 18:18:25 -0000 1.47 @@ -177,6 +177,8 @@ if (currentCursor != null) { nSetNativeCursor(currentCursor.getHandle()); currentCursor.setTimeout(); + x = Window.getWidth() / 2; + y = Window.getHeight() / 2; } else { nSetNativeCursor(0); } |