Created
December 27, 2014 11:50
-
-
Save theresajayne/e2542ba69b377d9676fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.theresajayne.thepeople.game; | |
import com.github.theresajayne.thepeople.rendering.Window; | |
import org.lwjgl.input.Keyboard; | |
/** | |
* Created by Theresa on 27/12/2014. | |
*/ | |
public class Game { | |
private Mesh mesh; | |
private Shader shader; | |
public Game() | |
{ | |
mesh = new Mesh(); | |
shader = new Shader(); | |
Vertex[] data = new Vertex[] { new Vertex(new Vector3f(-1,-1,0)), | |
new Vertex(new Vector3f(0,1,0)), | |
new Vertex(new Vector3f(1,-1,0))}; | |
mesh.addVertices(data); | |
shader.addVertexShader(ResourceLoader.loadShader("basicVertex.vs")); | |
shader.addFragmentShader(ResourceLoader.loadShader("basicFragment.fs")); | |
shader.compileShader(); | |
} | |
public void input() | |
{ | |
if(Input.getKeyDown(Keyboard.KEY_UP)) | |
{ | |
System.out.println("We Just Pressed Up"); | |
} | |
if(Input.getKeyUp(Keyboard.KEY_UP)) | |
{ | |
System.out.println("We Just Released Up"); | |
} | |
if(Input.getMouseDown(1)) | |
{ | |
System.out.println("We Just Pressed RMB at "+ Input.getMousePosition().toString()); | |
} | |
if(Input.getMouseUp(1)) | |
{ | |
System.out.println("We Just Released RMB at "+ Input.getMousePosition().toString()); | |
} | |
} | |
public void update() | |
{ | |
} | |
public void render() | |
{ | |
shader.bind(); | |
mesh.draw(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment