org.lwjgl.LWJGLUtil Java Examples

The following examples show how to use org.lwjgl.LWJGLUtil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WindowParamsPersistingApplicationWrapper.java    From gdx-texture-packer-gui with Apache License 2.0 6 votes vote down vote up
private void saveWindowParams() {
    int width = Display.getWidth();
    int height = Display.getHeight();
    int x = Display.getX();
    int y = Display.getY();

    //FIXME For some reason actual window position shifted by 6 pixels on Windows (by 12 at y when maximized).
    if (LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_WINDOWS) {
        x += 6;
        y += 6;
    }

    Preferences prefs = Gdx.app.getPreferences("window_params.xml");
    prefs.putInteger("x", x);
    prefs.putInteger("y", y);
    prefs.putInteger("width", width);
    prefs.putInteger("height", height);
    prefs.flush();
}
 
Example #2
Source File: OSUtil.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
public static OSUtil create() {
	int platform = LWJGLUtil.getPlatform();
	switch (platform) {
		case LWJGLUtil.PLATFORM_MACOSX:
			return new MacOSXUtil();
		case LWJGLUtil.PLATFORM_LINUX:
		case LWJGLUtil.PLATFORM_WINDOWS:
		default:
			throw new RuntimeException("Unsupported platform: " + platform);
	}
}