Skip to content

Added Window Position for LJWGL3 libraries - #1670

Merged
stephengold merged 16 commits into
jMonkeyEngine:masterfrom
bob0bob:master
Nov 30, 2021
Merged

Added Window Position for LJWGL3 libraries#1670
stephengold merged 16 commits into
jMonkeyEngine:masterfrom
bob0bob:master

Conversation

@bob0bob

@bob0bob bob0bob commented Nov 22, 2021

Copy link
Copy Markdown
Contributor

This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before.

But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to.

Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location.

… in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before.

But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to.

Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location.
@stephengold

Copy link
Copy Markdown
Member

Can we close #1668?

@stephengold stephengold linked an issue Nov 22, 2021 that may be closed by this pull request
@bob0bob

bob0bob commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

I closed it.

@stephengold stephengold added this to the v3.5.0 milestone Nov 22, 2021

@stephengold stephengold left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself looks fine. Most of my concerns center on the javadoc. If you're unsure how to proceed, just ask.

Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java Outdated
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java Outdated
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java Outdated
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java Outdated
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java Outdated
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java Outdated
Comment thread jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java Outdated
Comment thread jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java Outdated
LWJGL3-JME library would block the current thread when executing LWJGL3.    Instead of calling run() that is blocking,  made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start().
Comment thread jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java Outdated
@bob0bob

bob0bob commented Nov 25, 2021

Copy link
Copy Markdown
Contributor Author

I got that last change removed that doesn't relate to this issue.

@stephengold

Copy link
Copy Markdown
Member

Thanks for persevering through the difficulties. There are just a few more review comments to address.

@stephengold

Copy link
Copy Markdown
Member

Note that JME does not use tabs in Java sourcecode. Indentation should consist entirely of spaces.

@stephengold
stephengold merged commit 255d6fc into jMonkeyEngine:master Nov 30, 2021
@bob0bob

bob0bob commented Dec 1, 2021

Copy link
Copy Markdown
Contributor Author

I forgot to do this, thanks for updating the comments.

@stephengold

Copy link
Copy Markdown
Member

Thanks for your contribution to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Added Window Position for LJWGL3 libraries

2 participants