I am trying to give the user the opportunity how he wants to play the game. Window and full screen mode is not a problem. It seems to me that I am not working, it is full-screen full-screen / window full-screen mode. I searched the Internet and found only one site that helped me:
http://badlogicgames.com/forum/viewtopic.php?f=11&t=13863
I did as I was told, and I think it works, my problem is that the Windows 10 toolbar at the bottom is always in front of the window. Here is a picture of how it looks:
http://imgur.com/hdA3LAb
The color is terrible, but only for testing purposes. The code is as follows:
if (screenManager.FULLSCREEN) { Gdx.graphics.setDisplayMode(Gdx.graphics.getDesktopDisplayMode().width, Gdx.graphics.getDesktopDisplayMode().height, true); } else if (screenManager.WINDOWEDFULLSCREEN) { System.setProperty("org.lwjgl.opengl.Window.undecorated", "true"); Gdx.graphics.setDisplayMode(Gdx.graphics.getDesktopDisplayMode().width, Gdx.graphics.getDesktopDisplayMode().height, false); } else { Gdx.graphics.setDisplayMode(screenManager.WIDTH, screenManager.HEIGTH, false); }
How can i fix this?
Edit: I upgraded to 1.9.2, which does not have a setDisplayMode method. Now the code is as follows:
DisplayMode mode = Gdx.graphics.getDisplayMode(); if (screenManager.FULLSCREEN) { Gdx.graphics.setWindowedMode(Gdx.graphics.getDisplayMode().width, Gdx.graphics.getDisplayMode().height); Gdx.graphics.setFullscreenMode(mode); } else if (screenManager.WINDOWEDFULLSCREEN) { System.setProperty("org.lwjgl.opengl.Window.undecorated", "true"); Gdx.graphics.setWindowedMode(Gdx.graphics.getDisplayMode().width, Gdx.graphics.getDisplayMode().height); //Gdx.graphics.setFullscreenMode(mode); } else { Gdx.graphics.setWindowedMode(screenManager.WIDTH, screenManager.HEIGTH); }
Everything works the same as before, only in full-screen mode without borders there is a Windows toolbar (thing on botton), as in the picture. Normal full screen mode works great.