Reputation: 664
I've used the LibGDX UI Setup to start a project.
The only thing I have in the implements ApplicationListener is:
public void create() {
setScreen(new LoadingScreen(this));
}
This is supposed to fire the LoadingScreen and it does since I have a print in its constructor and it does show. I have a print in the render method and it's only shown once and I understand this should be printed a lot of times since the render method is called every short period of time.
Here's what I have in the render() method (apart from the print):
OpenGL.glClearColor(1, 0.5f, 1, 1);
OpenGL.glClear(GL10.GL_COLOR_BUFFER_BIT);
Where OpenGL = Gdx.graphics.getGL10();
As I said I think render is only called once and what I see in the screen when I execute the desktop main is an image blinking from pink to black and bars going from top to bottom.
Upvotes: 2
Views: 2068
Reputation: 664
Just in case it It helps someone.
The problem was solved by adding to the render method in the Game extending class this:
public void render() {
super.render();
}
Now it does not blink and each screen's render is called over and over as it is supposed to happen.
Upvotes: 2