OSDN Git Service

Changed the sorting to preserve the original point indices.
[mikumikustudio/libgdx-mikumikustudio.git] / extensions / gdx-tools / src / com / badlogic / gdx / tools / grapheditor / GraphRenderer.java
1 package com.badlogic.gdx.tools.grapheditor;
2
3 import java.awt.Font;
4
5 import com.badlogic.gdx.graphics.OrthographicCamera;
6 import com.badlogic.gdx.graphics.g2d.BitmapFont;
7 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
8 import com.badlogic.gdx.graphics.g3d.shaders.graph.ShaderGraph;
9 import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
10
11 public class GraphRenderer {
12         private final OrthographicCamera camera;
13         private final ShapeRenderer shapeRenderer;
14         private final SpriteBatch batch;
15         private final BitmapFont font;
16         
17         public GraphRenderer() {
18                 camera = new OrthographicCamera();
19                 camera.setToOrtho(false);
20                 shapeRenderer = new ShapeRenderer();
21                 batch = new SpriteBatch();
22                 font = new BitmapFont();
23         }
24         
25         public void resize(int width, int height) {
26                 camera.viewportWidth = width;
27                 camera.viewportHeight = height;
28                 camera.update();
29         }
30         
31         public void render(ShaderGraph graph) {
32                 camera.update();
33         }
34 }