-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added JmeSurfaceView.java class , for embedding jme-game in a custom xml UI-design. #1494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can you please ensure formatting is correct. I see several formatting errors. |
Yep , sure , which formatting errors ? the title or in code ? |
Removal of white spaces between if...else conditions & class methods.
|
Okay, assuming the 'formatting errors' are the extra white spaces between the if statement conditions & methods , i have removed them , you can refer to a specific line if you find something wrong. |
|
The JMonkeyEngine project plans to move toward the Google Style Guide which requires whitespace after |
|
If @Scrappers-glitch concurs, I could run the new file through a formatter before integrating this PR. That might be easier (for everyone) than trying to format the code by hand. |
I will reformat the code now ,& review it again , no worry.👍 |
|
I think it's better to change the annotations NonNullable from org.jetbrains to androidx.annotations package , so we are on the safe side , & reformat the code, then the PR would be ready to be merged. |
|
So @stephengold , if ( legacyApplication != null ) {or this : if (legacyApplication != null) { |
|
I think |
Thank you i ensured that , one another question though about the interfaces , so having them in the same class or different files are better ? , because i like to have them at the same file since they are used only by this file. |
|
I don't see any interfaces defined in this code. I do see some scary "synchronized" keywords, though. At least one seems unnecessary because nothing in the method requires synchronization. The one on update() worries me, though. Is there a chance that update() will be called from multiple threads at the same time? Note: it's very very important that JME's update() is called from the same thread every time. It could break some applications if it isn't. |
|
@pspeed42 thanks for reviewing .
At the end of the code , you will find them , anyway i have separated them into files , to be with jme style.
That was a long story of using FutureTasks to delay the add of the GlSurfaceView to the users ' screen without delaying jme-Render & it gets to be successful when using synchronized() because that basically makes jme SystemListener gets notified of the changes in the UI thread , but then i discovered a better way which is using a Handler & postDelay it , i see it's better optimized for android UI , the reason for all this , is that it gives an option for the user to use a SplashScreen while loading the scene asynchronously , so after your comment i tested it again w/o synchronized & it seems to be the same so i removed it as no use of it now & they make confusions as well. if you donot want to delay the add of glsurfaceView use The legacyApplication update() method gets updated by the All the new updates with reformating code would be in the next commit. |
|
Mmm... nested in with the methods like that, I missed the interfaces. Inner classes/interfaces should go at the bottom. In this case, it seems like you only use interfaces to avoid having the application extend this class? It does feel weird to have them in the class like this... which is usually a sign that something is off. |
i like to enclose all things that are used by each other inside one enclosure , so the answer because they are used by this class only , but anyway i have separated them into files as jme does.
& As you quoted here , someone may literally miss them in the mess of methods. |
|
By the way, if you are on IntelliJ IDE do a |
I know , i have taken the time to fix them myself to be able to retain the way that i would use with jme style , the new commits are done , please give them a quick look. EDIT : i have also moved the files including the interfaces into a separate package inside |
# Conflicts: # jme3-android/src/main/java/com/jme3/app/JmeSurfaceView.java
jme3-android/src/main/java/com/jme3/app/jmeSurfaceView/JmeSurfaceView.java
Outdated
Show resolved
Hide resolved
jme3-android/src/main/java/com/jme3/app/jmeSurfaceView/JmeSurfaceView.java
Outdated
Show resolved
Hide resolved
jme3-android/src/main/java/com/jme3/app/jmeSurfaceView/JmeSurfaceView.java
Outdated
Show resolved
Hide resolved
|
It's too late to make changes to this PR. If there's something you want to change, make a new PR. |
Embedded jme Game on android view to manipulate jme games on custom xml UI designs , could be used within :
OR any OGLES Compatible Context based container.