Class Loader

java.lang.Object
engine.renderEngine.Loader

public class Loader extends Object
Loader class is used to load the VBO's for each VAO of all Assets, UIComponents, Terrains and Texts in the game.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes all the VAOs, VBOs and Textures when the game is closed or terminated VAOs, VBOs and Textures are stored int the VRAM (Video Memory)
    void
    Clears the Text VAO as well as the VBO arrays.
    int
     
    int
    loadTexture(String fileName)
    Creates a Texture Object using the input filename of the png texture
    loadToVAO(float[] positions)
    Method responsible for loading VAO for GUI Objects.
    int
    loadToVAO(float[] positions, float[] textureCoords)
    Method responsible for loading VAO for Text Objects.
    loadToVAO(float[] positions, float[] textureCoords, float[] normals, int[] indices)
    Method used to return RawModel of 3D Object Creates a VAO and then: Indices are stored int an index buffer and bound to the VAO Stores the position data of the vertices into attribute 0 of the VAO Stores the texture coordinates into attribute 1 of the VAO Stores the normal vectors into attribute 2 of the VAO

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Loader

      public Loader()
  • Method Details

    • loadToVAO

      public RawModel loadToVAO(float[] positions, float[] textureCoords, float[] normals, int[] indices)
      Method used to return RawModel of 3D Object Creates a VAO and then: Indices are stored int an index buffer and bound to the VAO Stores the position data of the vertices into attribute 0 of the VAO Stores the texture coordinates into attribute 1 of the VAO Stores the normal vectors into attribute 2 of the VAO
      Parameters:
      positions - - The 3D positions of each vertex in the geometry
      indices -
      Returns:
      the loaded model
    • loadToVAO

      public RawModel loadToVAO(float[] positions)
      Method responsible for loading VAO for GUI Objects. Same process as LoadToVAO for entities however index array is not required.
      Parameters:
      positions -
      Returns:
    • loadToVAO

      public int loadToVAO(float[] positions, float[] textureCoords)
      Method responsible for loading VAO for Text Objects. Same process as LoadToVAO for entities however index array is not required.
      Parameters:
      positions -
      textureCoords -
      Returns:
    • loadTexture

      public int loadTexture(String fileName)
      Creates a Texture Object using the input filename of the png texture
      Parameters:
      fileName - - Name of the file which contains the texture of an object
      Returns:
      ID of the loaded texture
    • loadFontTexture

      public int loadFontTexture(String fileName)
      Parameters:
      fileName -
      Returns:
    • cleanUp

      public void cleanUp()
      Deletes all the VAOs, VBOs and Textures when the game is closed or terminated VAOs, VBOs and Textures are stored int the VRAM (Video Memory)
    • clearTextVaos

      public void clearTextVaos()
      Clears the Text VAO as well as the VBO arrays.