Permalink
Browse files

gl settings removed

  • Loading branch information...
1 parent 86ba8d3 commit c5cbe310b2fd37cef5d3fbc1b6e121f1f80d919c @godrin committed Oct 4, 2012
@@ -87,6 +87,7 @@ public void render() {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
move();
+
screen.render();
}
@@ -83,7 +83,7 @@ public synchronized void render() {
return;
synchronized (this) {
- renderer.initGlSettings();
+ renderer.initGlSettingsExplicit();
rendering = true;
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
@@ -92,20 +92,24 @@ public void drawLines(Position pos, List<Vector3> lines, float angle,
private static boolean mySettingsSet = false;
public void initGlSettings() {
+ if (!mySettingsSet) {
+ mySettingsSet = true;
+ initGlSettingsExplicit();
+ }
+ }
+
+ public void initGlSettingsExplicit() {
if (Gdx.gl10 != null) {
Gdx.gl10.glEnable(GL10.GL_LINE_SMOOTH);
Gdx.gl10.glEnable(GL10.GL_BLEND);
Gdx.gl10.glHint(GL10.GL_LINE_SMOOTH_HINT, GL10.GL_NICEST);
} else if (Gdx.gl20 != null) {
- if (!mySettingsSet) {
- //mySettingsSet = true;
-
- Gdx.gl20.glEnable(GL10.GL_LINE_SMOOTH);
- Gdx.gl20.glEnable(GL10.GL_BLEND);
- Gdx.gl20.glHint(GL10.GL_LINE_SMOOTH_HINT, GL10.GL_NICEST);
- }
+ Gdx.gl20.glEnable(GL10.GL_LINE_SMOOTH);
+ Gdx.gl20.glEnable(GL10.GL_BLEND);
+ Gdx.gl20.glHint(GL10.GL_LINE_SMOOTH_HINT, GL10.GL_NICEST);
}
+
}
@Override
@@ -282,6 +286,7 @@ public void drawText(float i, float j, CharSequence string, Color c,
spriteBatch.end();
if (renderer != null)
Gdx.gl10.glPopMatrix();
+ mySettingsSet = false;
}

0 comments on commit c5cbe31

Please sign in to comment.