package voxel.client;

import org.lwjgl.opengl.Display;
import org.lwjgl.util.vector.Vector3f;

import voxel.client.engine.DisplayManager;
import voxel.client.engine.entities.Camera;
import voxel.client.engine.entities.Entity;
import voxel.client.engine.render.Renderer;
import voxel.client.engine.render.shaders.StaticShader;
import voxel.client.engine.render.textures.ModelTexture;
import voxel.client.engine.resources.Loader;
import voxel.client.engine.resources.OBJLoader;
import voxel.client.engine.resources.models.RawModel;
import voxel.client.engine.resources.models.TexturedModel;
import voxel.client.engine.util.Logger;
import voxel.client.engine.util.SystemInfo;

public class StartClient {

	public static void StartGame() {

	}

	public static void main(String[] args) {

		DisplayManager.createDisplay();
		SystemInfo.chechOpenGl32();
		SystemInfo.printSystemInfo();
		Logger.log("Starting Rendering");

		Loader loader = new Loader();
		StaticShader shader = new StaticShader();
		Renderer renderer = new Renderer(shader);

		RawModel model = OBJLoader.loadObjModel("GrassBlock", loader);
		ModelTexture texture = new ModelTexture(loader.loadTexture("Grass"));
		TexturedModel textureModel = new TexturedModel(model, texture);
		ModelTexture texture1 = textureModel.getTexture();
		texture1.setShineDamper(10);
		texture1.setReflectivity(1f);

		Entity entity = new Entity(textureModel, new Vector3f(0, 0, -4), 0, 0,
				0, 1);

		//Light light = new Light(new Vector3f(0, 0, 0), new Vector3f(1, 1, 1));
		Camera camera = new Camera();

		while (!Display.isCloseRequested()) {
			entity.increaseRotation(0f, 0.5f, 0f);
			camera.move();
			renderer.prepare();
			shader.start();
			//shader.loadLight(light);
			shader.loadviewMatrix(camera);
			renderer.render(entity, shader);
			shader.stop();
			DisplayManager.updateDisplay();
		}
		Logger.log("Closing Game");
		shader.cleanUp();
		loader.cleanUp();
		DisplayManager.closeDisplay();
	}
}

@@ -910,17 +910,16 @@
 ring%22);%0A
-%0A
 %09%09Loader
@@ -1030,17 +1030,16 @@
 hader);%0A
-%0A
 %09%09RawMod
@@ -1231,24 +1231,32 @@
 texture);%0A%09%09
+/*%0A%09%09 * 
 ModelTexture
@@ -1292,24 +1292,27 @@
 exture();%0A%09%09
+ * 
 texture1.set
@@ -1327,19 +1327,17 @@
 per(10);
-%0A%09%09
+ 
 texture1
@@ -1362,98 +1362,20 @@
 f);%0A
-%0A
 %09%09
-Entity entity = new Entity(textureModel, new Vector3f(0, 0, -4), 0, 0,%0A%09%09%09%090, 1);
+ */
 %0A%0A%09%09//
+ 
 Ligh
@@ -1435,16 +1435,21 @@
 3f(1, 1,
+%0A%09%09//
  1));%0A%09%09
@@ -1477,16 +1477,99 @@
 amera();
+%0A%09%09Entity entity = new Entity(textureModel, new Vector3f(0, 0, 0), 0, 0,%0A%09%09%09%090, 1);
 %0A%0A%09%09whil
@@ -1605,16 +1605,19 @@
 )) %7B%0A%09%09%09
+// 
 entity.i
@@ -1712,16 +1712,17 @@
 );%0A%09%09%09//
+ 
 shader.l

Disable fuctions