Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. package com.me.test;
  2.  
  3. import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
  4. import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
  5.  
  6. public class Main {
  7. public static void main(String[] args) {
  8. LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
  9. cfg.title = "performanceTest";
  10. cfg.useGL20 = false; // doesn't make a difference...
  11. cfg.width = 1080;
  12. cfg.height = cfg.width/12 * 9; // 810
  13.  
  14. new LwjglApplication(new Test(), cfg);
  15. }
  16. }
  17.  
  18. import com.badlogic.gdx.Gdx;
  19. import com.badlogic.gdx.graphics.GL10;
  20. import com.badlogic.gdx.graphics.OrthographicCamera;
  21. import com.badlogic.gdx.maps.tiled.TmxMapLoader;
  22. import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
  23.  
  24. public class Test implements ApplicationListener {
  25. private OrthographicCamera camera;
  26. private com.badlogic.gdx.maps.tiled.TiledMap map;
  27. private static OrthogonalTiledMapRenderer renderer;
  28.  
  29. @Override
  30. public void create() {
  31. float w = Gdx.graphics.getWidth();
  32. float h = Gdx.graphics.getHeight();
  33.  
  34. camera = new OrthographicCamera(w, h);
  35.  
  36. TmxMapLoader maploader = new TmxMapLoader();
  37.  
  38. map = maploader.load("test.tmx");
  39. renderer = new OrthogonalTiledMapRenderer(map, 1);
  40. renderer.setView(camera);
  41.  
  42. }
  43.  
  44. @Override
  45. public void dispose() {
  46. renderer.dispose();
  47. map.dispose();
  48. }
  49.  
  50. @Override
  51. public void render() {
  52. Gdx.gl.glClearColor(1, 1, 1, 1);
  53. Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  54.  
  55. renderer.render();
  56. }
  57.  
  58. @Override
  59. public void resize(int width, int height) {
  60. }
  61.  
  62. @Override
  63. public void pause() {
  64. }
  65.  
  66. @Override
  67. public void resume() {
  68. }
  69. }
  70.  
  71. Mesh.forceVBO=true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement