Package engine.renderEngine
Class Loader
java.lang.Object
engine.renderEngine.Loader
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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)void
Clears the Text VAO as well as the VBO arrays.int
loadFontTexture
(String fileName) int
loadTexture
(String fileName) Creates a Texture Object using the input filename of the png textureloadToVAO
(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
-
Constructor Details
-
Loader
public Loader()
-
-
Method Details
-
loadToVAO
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 geometryindices
-- Returns:
- the loaded model
-
loadToVAO
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
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
- 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.
-