writing a bunch of boiler plate so i can like draw stuff to the screen
This commit is contained in:
1 parent
b295c1f57e
commit
b154776905
4 files changed
+94
-19
No files matched your search
@@ -88,32 +88,21 @@ public class Game
|
||||
|
||||
// Make the window visible
|
||||
glfwShowWindow(window);
|
||||
|
||||
// Load Objects
|
||||
try (InputStream in = this.getClass().getResourceAsStream("/objs/cube.obj")) {
|
||||
// Create an OBJParser and parse the resource
|
||||
final IOBJParser parser = new OBJParser();
|
||||
final OBJModel model = parser.parse(in);
|
||||
|
||||
// Use the model representation to get some basic info
|
||||
System.out.println(MessageFormat.format(
|
||||
"OBJ model has {0} vertices, {1} normals, {2} texture coordinates, and {3} objects.",
|
||||
model.getVertices().size(),
|
||||
model.getNormals().size(),
|
||||
model.getTexCoords().size(),
|
||||
model.getObjects().size()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private void loop()
|
||||
{
|
||||
GL.createCapabilities();
|
||||
// Setup world
|
||||
World world = new World();
|
||||
|
||||
// Add stuff to world
|
||||
world.addEntity(new Entity("/obs/cube.obj", "/shaders/shader.fraq", "/shaders/shader.vert"));
|
||||
|
||||
// Do open gl stuff
|
||||
GL.createCapabilities();
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
// Main loop or something
|
||||
while ( !glfwWindowShouldClose(window) )
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
Reference in new issue
Block a user