Open KevinNorth opened 8 years ago
i'll try it
/** Target framerate when the window is in the foreground. The CPU sleeps as needed. Use 0 to never sleep. **/
public int foregroundFPS;
/** Target framerate when the window is in the background. The CPU sleeps as needed. Use 0 to never sleep, -1 to not render. **/
public int backgroundFPS;
/** Target framerate when the window is hidden or minimized. The CPU sleeps as needed. Use 0 to never sleep, -1 to not render. **/
public int hiddenFPS = -1;
so background and hidden has to be -1, and foreground 60.. i guess.
IT WORKS!!!
These are the settings that worked :
" config.backgroundFPS = -1;
config.foregroundFPS = 60;
config.hiddenFPS = -1;
config.vSync = false;"
No more 80 Degrees on the CPU!!! The FPS counter stays low at about 3 FPS when idle and also when not in focus !!!
CPU usage is also very low at about 0,2 when idle+ in focus or not in focus.
Overlap2D now seems to be also way much smoother and stable when working with it.
can you do a pull request? I'll merge it right away!
I'll try
I get a black screen with backgroundFPS = -1 but this is with ./gradlew run, so I am not sure that java is main and gradle app is 2nd(background) how do we build the .jar file or where is it stored?
I can't do a pull request and I tried to commit the change for review but it asks me for a username and password. I guess I do not have permissions.
this is the change I did in the Main class method startLoadingEditor():
" if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC) { System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Overlap2D"); JglfwApplicationConfiguration config = new JglfwApplicationConfiguration(); config.width = (int) (width); config.height = (int) (height - height * .04); config.backgroundFPS = -1; config.foregroundFPS = 60; config.hiddenFPS = -1; config.vSync = false; config.title = "Overlap2D - v" + AppConfig.getInstance().version; new JglfwApplication(overlap2D, config); } "
@bruceloco I do not get black screen.
@meonlineonmess do you do ./gradlew run to run?
well, no problem, I can do the change myself. But given it doesnot work for @bruceloco I guess this needs to be figured out first.
@bruceloco yes I do
./gradlew build then ./gradlew run
@azakhary @bruceloco do you know some updated tutorials or updated documentation for loading Overlap2D in libGDX? the code for Overlap2D is outdated.
Ok, so, this is somewhat interesting. I know why it does not redraw. So I have the same settings as you run the same commands however I get a black screen if I tab off to another app and tab again, now the menu appears. It is like it starts in the background and does not respond to anything because it assumes it is in the foreground then switch to another window and back and it now assumes foreground position and it starts working.
@bruceloco I am curious if we can somehow "fake" that going back and forth to make it think it's in foreground on start. Maybe it's possible to stackoverflow that.
@meonlineonmess the docs on website should be latest: http://overlap2d.com/runtimes-documentation/ Scroll down to the tutorials section, and watch first video.
@meonlineonmess also check out the runtimes wiki: https://github.com/UnderwaterApps/overlap2d-runtime-libgdx/wiki
@azakhary where is the overlap2 jar actually built? I can try to run this directly to make sure it is not an issue with my jdk/jvm There is a thread here: https://hub.jmonkeyengine.org/t/glfw-crash-on-macs/34719/16 where it basically says that threads are competing and in my case the java thread takes precedence and sends the jglfw thread into background
My .jar shows up here ->/Users/ublack/overlap2d/build/libs/overlap2d-0.1.3.jar however I can't run it and I don't know if it is the right jar for sure.
to build a jar, you need to run "dist" gradle task.
I built mine using ./gradlew dist and when I start the program I also get black screen for a couple of seconds and then it opens.
same thing on the built jar, must be some sort of setting @meonlineonmess what's your jvm/jdk versions?
aBlacks-MacBook-Pro:~ ublack$ java -version java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode) aBlacks-MacBook-Pro:~ ublack$
btw, if we put value 60, on all hidden, background and foreground, wouldn't it be still awesome CPU for all cases with no possible no-render bug? (as a compromise solution)
@azakhary I'll try
with 60,60,60 it still doesn't get hot but my FPS counter now shows it is using 68 fps to render the program. The process of Overlap doesn't go below 9% which means it is using resources that it should not use. It drains the battery faster.
I got java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b16) wonder if that is the problem
@meonlineonmess can you try my jar? https://www.dropbox.com/sh/9dza1t1alaxc98x/AAADmV03TMLjYxmOezu5fxNSa?dl=0
@bruceloco I opened your jar and I get the same behaviour as before: black screen when opening and then after a couple of seconds it shows the content. I also get low fps and low cpu usage whether if the program is minimized, in or not in focus.
It seems to work ok despite the black screen at which one is supposed to wait a little.
i have it opened for a minute and nothing
@bruceloco I switched between programs and only after that it showed up the content.
whats your jdk? so it's not the player and not the source code, so we are up to the compiler now
Maybe it's the you run it? double clicking, versus right click open or some other way, may make it go to background during the startup sequence, and silently come back, leaving jglfw think that it's still on background. imho it's either osx version difference, or just the way the app is executed.
@azakhary @meonlineonmess has the same behaviour as me running on his system with the app I built. I got OSX Sierra, 64bit. I am assuming that his is the same. So I am inclined towards the JDK version. I installed gradle via sdkman, I am using Gradle 3.3 My jdk is 1.8.0_112
Ok, if I do: System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Overlap2D"); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.width = (int) (width); config.height = (int) (height); config.backgroundFPS =-1; config.foregroundFPS = 60; config.vSyncEnabled = false; config.title = "Overlap2D - v" + AppConfig.getInstance().version; new LwjglApplication(overlap2D, config);
for OSX it works, stays a couple seconds black but works But the switching of libraries here, using the LWJGL vs the JGLFW, not sure about the impact here
I use macOS Sierra 10.12.2 and Oracle JDK
java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
I wonder if VisEditor suffers from the same issue with the black screen. It also has the high CPU usage too and I saw the source code and it's the same issue there too with LwglApplication... Maybe after adding the settings for VisEditor like in Overlap2D, it will suffer from the same issue with the black screen. This could be a Hint.
also, I was just reviewing badlogic's repos and the lwjgl vs jglfw, and the jglfw repo has not been updated in 3 years. also the badlogic libs for both lwjgl and jglfw are also at least 2 years old and all the new stuff comes on lwjgl3. @azakhary any reason why the repo did not move?
@meonlineonmess lets keep the issue here based on overlap2D.
Also for future reference: VSync is enabled by default on OSX and cannot be disabled easily Someone created the following tool: https://www.tonymacx86.com/threads/beamsyncdropper-tool-to-disable-beamsync-permanently.92201/
@bruceloco As far as I remember BeamSyncDropper when I used this app it did not work in El Capitan or Sierra because the rendering was changed in these versions.
@meonlineonmess yeah, don't see any updates on the project for 2 years.
@meonlineonmess have you tried using lwjgl on mac? Since I don't have any project running I cannot see any issues/performance impact
@bruceloco no I didn't use it before
can you try with these settings? System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Overlap2D"); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.width = (int) (width); config.height = (int) (height); config.backgroundFPS =-1; config.foregroundFPS = 60; config.vSyncEnabled = false; config.title = "Overlap2D - v" + AppConfig.getInstance().version; new LwjglApplication(overlap2D, config);
Thanks
there was a reason we used Jglfw instead of Lwjgl. if you change it, other things will not work.
@azakhary does this include lwjgl3? or the standard lwjgl? you use it on windows, so there might be a mac bug or two which could easily be addressed no?
standart lwjgl. so yeah, 3 might be good. dunno
When I run Overlap2D on my Mac, my GPU quickly reaches nearly 100ºC and stays at that temperature until I close the editor. This happens even when I leave Overlap2D running in the background without opening a project.
Here's a screenshot showing the temperature of my GPU when I'm running Overlap2D:
Notice my fan speeds and the "TCGC PECI GPU" temperature. The CPU is doing fine.
Here are my computer's specs:
General information:
GPU:
Molitor:
My computer is running Java 1.8.0_74 as its JRE.