Esempio n. 1
0
  public void update() {
    hasVertices = true;
    /*hasVertices = false;
    	if (!mesh.getMesh().isEmpty()) {
    		hasVertices = true;
    		break;
    	}
    if (!hasVertices) {
    	return;
    }*/

    renderer.begin();

    material.preRender();
    renderer.addMesh(mesh.getMesh());
    material.postRender();

    renderer.end();
  }
Esempio n. 2
0
  public void initRenderer() {
    createWindow();

    // Mouse.setGrabbed(true);

    getLogger().info("SpoutClient Information");
    getLogger().info("Operating System: " + System.getProperty("os.name"));
    getLogger().info("Renderer Mode: " + this.getRenderMode().toString());
    getLogger().info("OpenGL Information");
    getLogger().info("Vendor: " + GL11.glGetString(GL11.GL_VENDOR));
    getLogger().info("OpenGL Version: " + GL11.glGetString(GL11.GL_VERSION));
    getLogger().info("GLSL Version: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION));
    getLogger().info("Max Textures: " + GL11.glGetString(GL20.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS));
    String extensions = "Extensions Supported: ";
    if (getArguments().renderMode == RenderMode.GL30) {
      for (int i = 0; i < GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS); i++) {
        extensions += GL30.glGetStringi(GL11.GL_EXTENSIONS, i) + " ";
      }
    } else {
      extensions += GL11.glGetString(GL11.GL_EXTENSIONS);
    }
    getLogger().info(extensions);
    soundManager.init();
    Spout.getFilesystem().postStartup();

    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glClearColor((135.f / 255.0f), 206.f / 255.f, 250.f / 255.f, 0);

    // worldRenderer = new WorldRenderer(this);
    // worldRenderer.setup();

    renderer = new PrimitiveBatch();
    mat =
        (RenderMaterial)
            this.getFilesystem()
                .getResource("material://Spout/resources/resources/materials/BasicMaterial.smt");
    renderer.begin();
    renderer.addCube(new Vector3(-0.5, -0.5, -0.5), Vector3.ONE, Color.RED, sides);
    renderer.end();

    gui = new SpriteBatch();
  }