new engine

This commit is contained in:
Antoine
2021-05-19 02:52:15 +02:00
parent c6181c96fe
commit e78b680389
11 changed files with 138 additions and 129 deletions

View File

@ -1,6 +1,6 @@
package engine.object;
import engine.Primitive;
import engine.math.Primitive;
import engine.graphics.VertexArray;
import engine.graphics.Shader;
import engine.math.Matrix4f;
@ -15,6 +15,10 @@ public class ObjectGl {
protected Shader shader;
protected Matrix4f transform;
public ObjectGl(){
}
public ObjectGl(float x, float y, float z, float h, float w){
this.vertexArray = new VertexArray(Primitive.createRectangle(x, y, z, h, w), Primitive.rectangle_indices, null, null);
this.transform = Matrix4f.identity();

View File

@ -1,11 +1,16 @@
package engine.object;
import engine.math.Primitive;
import engine.graphics.Shader;
import engine.graphics.VertexArray;
import engine.math.Matrix4f;
public class ObjectGlColor extends ObjectGl{
public ObjectGlColor(float x, float y, float h, float w, float[] color) {
super(x, y, h, w);
public ObjectGlColor(float x, float y, float z, float h, float w, float[] color) {
super();
this.vertexArray = new VertexArray(Primitive.createRectangle(x, y, z, h, w), Primitive.rectangle_indices, color, null);
this.transform = Matrix4f.identity();
this.shader = new Shader("shaders/ObjectGlColor/vert.glsl","shaders/ObjectGlColor/frag.glsl");
}

View File

@ -1,12 +1,28 @@
package engine.object;
import engine.math.Primitive;
import engine.graphics.Shader;
import engine.graphics.Texture;
import engine.graphics.VertexArray;
import engine.math.Matrix4f;
import java.util.List;
public class ObjectGlTex extends ObjectGl{
public ObjectGlTex(float x, float y, float h, float w, float[] texCoord) {
super(x, y, h, w);
List<Texture> textures;
public ObjectGlTex(){
}
public ObjectGlTex(float x, float y, float z, float h, float w, List<String> texPath, float[] texCoord) {
super();
this.vertexArray = new VertexArray(Primitive.createRectangle(x, y, z, h, w), Primitive.rectangle_indices, null, texCoord);
this.transform = Matrix4f.identity();
this.shader = new Shader("shaders/ObjectGlTex/vert.glsl","shaders/ObjectGlTex/frag.glsl");
// TODO tex
}
@Override

View File

@ -0,0 +1,20 @@
package engine.object;
import engine.math.Primitive;
import engine.graphics.Shader;
import engine.graphics.VertexArray;
import engine.math.Matrix4f;
import java.util.List;
public class ObjectGlTexColor extends ObjectGlTex{
public ObjectGlTexColor(float x, float y, float z, float h, float w, List<String> texPath, float[] texCoord, float[] color) {
super();
this.vertexArray = new VertexArray(Primitive.createRectangle(x, y, z, h, w), Primitive.rectangle_indices, color, texCoord);
this.transform = Matrix4f.identity();
this.shader = new Shader("shaders/ObjectGlTexColor/vert.glsl","shaders/ObjectGlTexColor/frag.glsl");
// TODO Create texture
}
}