Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


[libgdx] Black screen when toggling from fullscreen to windowed mode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Wibbs   Members   -  Reputation: 129

Like
0Likes
Like

Posted 15 June 2014 - 05:59 PM

Hey all,

 

I have just started working with libgdx, and have run into my first problem. I have a simple program that switches a desktop application from windowed mode to fullscreen and back again. If I start the program in windowed mode, it initially displays fine. When I toggle to full screen it is also OK.

 

However, when I toggle back to windowed mode the screen goes completely black. The application remains responsive though, and if I toggle again it will go back to fullscreen and display correctly.

 

I am using 64-bit Windows 7 with the IntelliJ IDEA IDE.

 

Any help with working out why it is doing this would be greatly appreciated.

 

A minimal example that displays the issue is shown below:

 

 

public class MyGdxGame extends ApplicationAdapter {

@Override
public void create () {	
	fullScreen = false;
}

@Override
public void render () {
	Gdx.gl.glClearColor(1, 0, 0, 1);
	Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

	if (Gdx.input.isKeyPressed(Input.Keys.TAB)) {
		fullScreen = !fullScreen;
		DisplayMode currentMode = Gdx.graphics.getDesktopDisplayMode();
		Gdx.graphics.setDisplayMode(currentMode.width, currentMode.height, fullScreen);
	}
}

private boolean fullScreen;
}




Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS