// Path: src/main/java/com/owens/oobjloader/builder/Material.java
// public class Material {
// 
//     public String name;
//     public ReflectivityTransmiss ka = new ReflectivityTransmiss();
//     public ReflectivityTransmiss kd = new ReflectivityTransmiss();
//     public ReflectivityTransmiss ks = new ReflectivityTransmiss();
//     public ReflectivityTransmiss tf = new ReflectivityTransmiss();
//     public int illumModel = 0;
//     public boolean dHalo = false;
//     public double dFactor = 0.0;
//     public double nsExponent = 0.0;
//     public double sharpnessValue = 0.0;
//     public double niOpticalDensity = 0.0;
//     public String mapKaFilename = null;
//     public String mapKdFilename = null;
//     public String mapKsFilename = null;
//     public String mapNsFilename = null;
//     public String mapDFilename = null;
//     public String decalFilename = null;
//     public String dispFilename = null;
//     public String bumpFilename = null;
//     public int reflType = BuilderInterface.MTL_REFL_TYPE_UNKNOWN;
//     public String reflFilename = null;
// 
//     public Material(String name) {
//         this.name = name;
//     }
// }
// 
// Path: src/main/java/craftedcart/smblevelworkshop/resource/ResourceShaderProgram.java
// public class ResourceShaderProgram implements IResource {
// 
//     private int programID;
// 
//     public ResourceShaderProgram(ResourceShader vertShader, ResourceShader fragShader) throws Exception {
//         Window.drawable.makeCurrent();
// 
//         try {
//             programID = GL20.glCreateProgram();
//             GL20.glAttachShader(programID, vertShader.getShaderID());
//             GL20.glAttachShader(programID, fragShader.getShaderID());
//             GL20.glLinkProgram(programID);
//             GL20.glValidateProgram(programID);
//         } catch (NullPointerException e) {
//             throw new Exception(e);
//         }
// 
//         Window.drawable.releaseContext();
//     }
// 
//     public int getProgramID() {
//         return programID;
//     }
// }


import com.owens.oobjloader.builder.Material;
import craftedcart.smblevelworkshop.resource.ResourceShaderProgram;
import io.github.craftedcart.fluidui.util.UIColor;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL15;
import org.lwjgl.opengl.GL20;
import java.nio.IntBuffer;
package com.owens.oobjloader.lwjgl;

// This code was written by myself, Sean R. Owens, sean at guild dot net,
// and is released to the public domain. Share and enjoy. Since some
// people argue that it is impossible to release software to the public
// domain, you are also free to use this code under any version of the
// GPL, LPGL, Apache, or BSD licenses, or contact me for use of another
// license.  (I generally don't care so I'll almost certainly say yes.)
// In addition this code may also be used under the "unlicense" described
// at http://unlicense.org/ .  See the file UNLICENSE in the repo.



public class VBO {

    // sizeof float/sizeof int
    public final static int FL_SIZE = 4;
    public final static int INDICE_SIZE_BYTES = 4;
    // Vertex Attribute Data - i.e. x,y,z then normalx, normaly, normalz, then texture u,v - so 8 floats.
    public final static int ATTR_V_FLOATS_PER = 3;
    public final static int ATTR_N_FLOATS_PER = 3;
    public final static int ATTR_T_FLOATS_PER = 2;
    public final static int ATTR_SZ_FLOATS = ATTR_V_FLOATS_PER + ATTR_N_FLOATS_PER + ATTR_T_FLOATS_PER;
    public final static int ATTR_SZ_BYTES = ATTR_SZ_FLOATS * FL_SIZE;
    public final static int ATTR_V_OFFSET_BYTES = 0;
    public final static int ATTR_V_OFFSET_FLOATS = 0;
    public final static int ATTR_N_OFFSET_FLOATS = ATTR_V_FLOATS_PER;
    public final static int ATTR_N_OFFSET_BYTES = ATTR_N_OFFSET_FLOATS * FL_SIZE;
    ;

    public final static int ATTR_T_OFFSET_FLOATS = ATTR_V_FLOATS_PER + ATTR_N_FLOATS_PER;
    public final static int ATTR_T_OFFSET_BYTES = ATTR_T_OFFSET_FLOATS * FL_SIZE;
    public final static int ATTR_V_STRIDE2_BYTES = ATTR_SZ_FLOATS * FL_SIZE;
    public final static int ATTR_N_STRIDE2_BYTES = ATTR_SZ_FLOATS * FL_SIZE;
    public final static int ATTR_T_STRIDE2_BYTES = ATTR_SZ_FLOATS * FL_SIZE;


    private int textId = 0;
    private int verticeAttributesID = 0;      // Vertex Attributes VBO ID
    private int indicesID = 0;      // indice VBO ID
    private int indicesCount = 0;

// Path: src/main/java/com/owens/oobjloader/builder/Material.java
// public class Material {
// 
//     public String name;
//     public ReflectivityTransmiss ka = new ReflectivityTransmiss();
//     public ReflectivityTransmiss kd = new ReflectivityTransmiss();
//     public ReflectivityTransmiss ks = new ReflectivityTransmiss();
//     public ReflectivityTransmiss tf = new ReflectivityTransmiss();
//     public int illumModel = 0;
//     public boolean dHalo = false;
//     public double dFactor = 0.0;
//     public double nsExponent = 0.0;
//     public double sharpnessValue = 0.0;
//     public double niOpticalDensity = 0.0;
//     public String mapKaFilename = null;
//     public String mapKdFilename = null;
//     public String mapKsFilename = null;
//     public String mapNsFilename = null;
//     public String mapDFilename = null;
//     public String decalFilename = null;
//     public String dispFilename = null;
//     public String bumpFilename = null;
//     public int reflType = BuilderInterface.MTL_REFL_TYPE_UNKNOWN;
//     public String reflFilename = null;
// 
//     public Material(String name) {
//         this.name = name;
//     }
// }
// 
// Path: src/main/java/craftedcart/smblevelworkshop/resource/ResourceShaderProgram.java
// public class ResourceShaderProgram implements IResource {
// 
//     private int programID;
// 
//     public ResourceShaderProgram(ResourceShader vertShader, ResourceShader fragShader) throws Exception {
//         Window.drawable.makeCurrent();
// 
//         try {
//             programID = GL20.glCreateProgram();
//             GL20.glAttachShader(programID, vertShader.getShaderID());
//             GL20.glAttachShader(programID, fragShader.getShaderID());
//             GL20.glLinkProgram(programID);
//             GL20.glValidateProgram(programID);
//         } catch (NullPointerException e) {
//             throw new Exception(e);
//         }
// 
//         Window.drawable.releaseContext();
//     }
// 
//     public int getProgramID() {
//         return programID;
//     }
// }


// Path: src/main/java/com/owens/oobjloader/lwjgl/VBO.java
import com.owens.oobjloader.builder.Material;
import craftedcart.smblevelworkshop.resource.ResourceShaderProgram;
import io.github.craftedcart.fluidui.util.UIColor;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL15;
import org.lwjgl.opengl.GL20;
import java.nio.IntBuffer;

package com.owens.oobjloader.lwjgl;

// This code was written by myself, Sean R. Owens, sean at guild dot net,
// and is released to the public domain. Share and enjoy. Since some
// people argue that it is impossible to release software to the public
// domain, you are also free to use this code under any version of the
// GPL, LPGL, Apache, or BSD licenses, or contact me for use of another
// license.  (I generally don't care so I'll almost certainly say yes.)
// In addition this code may also be used under the "unlicense" described
// at http://unlicense.org/ .  See the file UNLICENSE in the repo.



public class VBO {

    // sizeof float/sizeof int
    public final static int FL_SIZE = 4;
    public final static int INDICE_SIZE_BYTES = 4;
    // Vertex Attribute Data - i.e. x,y,z then normalx, normaly, normalz, then texture u,v - so 8 floats.
    public final static int ATTR_V_FLOATS_PER = 3;
    public final static int ATTR_N_FLOATS_PER = 3;
    public final static int ATTR_T_FLOATS_PER = 2;
    public final static int ATTR_SZ_FLOATS = ATTR_V_FLOATS_PER + ATTR_N_FLOATS_PER + ATTR_T_FLOATS_PER;
    public final static int ATTR_SZ_BYTES = ATTR_SZ_FLOATS * FL_SIZE;
    public final static int ATTR_V_OFFSET_BYTES = 0;
    public final static int ATTR_V_OFFSET_FLOATS = 0;
    public final static int ATTR_N_OFFSET_FLOATS = ATTR_V_FLOATS_PER;
    public final static int ATTR_N_OFFSET_BYTES = ATTR_N_OFFSET_FLOATS * FL_SIZE;
    ;

    public final static int ATTR_T_OFFSET_FLOATS = ATTR_V_FLOATS_PER + ATTR_N_FLOATS_PER;
    public final static int ATTR_T_OFFSET_BYTES = ATTR_T_OFFSET_FLOATS * FL_SIZE;
    public final static int ATTR_V_STRIDE2_BYTES = ATTR_SZ_FLOATS * FL_SIZE;
    public final static int ATTR_N_STRIDE2_BYTES = ATTR_SZ_FLOATS * FL_SIZE;
    public final static int ATTR_T_STRIDE2_BYTES = ATTR_SZ_FLOATS * FL_SIZE;


    private int textId = 0;
    private int verticeAttributesID = 0;      // Vertex Attributes VBO ID
    private int indicesID = 0;      // indice VBO ID
    private int indicesCount = 0;

    public Material material;