should be the final move of engine classes
parent
6db7693bc3
commit
2b4b1aa4d0
|
@ -12,11 +12,11 @@ import com.github.hydos.ginger.engine.common.api.GingerRegister;
|
|||
import com.github.hydos.ginger.engine.common.api.game.*;
|
||||
import com.github.hydos.ginger.engine.common.cameras.*;
|
||||
import com.github.hydos.ginger.engine.common.elements.objects.*;
|
||||
import com.github.hydos.ginger.engine.common.font.FontType;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.common.obj.ModelLoader;
|
||||
import com.github.hydos.ginger.engine.common.obj.shapes.StaticCube;
|
||||
import com.github.hydos.ginger.engine.opengl.api.*;
|
||||
import com.github.hydos.ginger.engine.opengl.font.FontType;
|
||||
import com.github.hydos.ginger.engine.opengl.render.MasterRenderer;
|
||||
import com.github.hydos.ginger.engine.opengl.render.models.TexturedModel;
|
||||
import com.github.hydos.ginger.engine.opengl.utils.GlLoader;
|
||||
|
|
|
@ -2,10 +2,10 @@ package com.github.halotroop.litecraft.screens;
|
|||
|
||||
import org.joml.*;
|
||||
|
||||
import com.github.hydos.ginger.engine.common.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.common.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.opengl.api.*;
|
||||
import com.github.hydos.ginger.engine.opengl.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.opengl.screen.Screen;
|
||||
|
||||
public class ExitGameScreen extends Screen
|
||||
{
|
||||
|
|
|
@ -4,9 +4,9 @@ import org.joml.*;
|
|||
|
||||
import com.github.halotroop.litecraft.Litecraft;
|
||||
import com.github.hydos.ginger.engine.common.api.GingerRegister;
|
||||
import com.github.hydos.ginger.engine.common.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.common.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.opengl.api.*;
|
||||
import com.github.hydos.ginger.engine.opengl.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.opengl.screen.Screen;
|
||||
|
||||
public class IngameHUD extends Screen
|
||||
{
|
||||
|
|
|
@ -9,10 +9,10 @@ import com.github.halotroop.litecraft.save.LitecraftSave;
|
|||
import com.github.halotroop.litecraft.world.dimension.Dimensions;
|
||||
import com.github.hydos.ginger.engine.common.elements.GuiTexture;
|
||||
import com.github.hydos.ginger.engine.common.elements.buttons.TextureButton;
|
||||
import com.github.hydos.ginger.engine.common.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.common.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.opengl.api.GingerGL;
|
||||
import com.github.hydos.ginger.engine.opengl.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.opengl.screen.Screen;
|
||||
|
||||
/**
|
||||
* YeS
|
||||
|
|
|
@ -17,11 +17,9 @@ import com.github.hydos.ginger.engine.opengl.utils.GlLoader;
|
|||
|
||||
public class BlockRenderer extends Renderer implements WorldGenConstants
|
||||
{
|
||||
|
||||
private StaticShader shader;
|
||||
|
||||
public int atlasID;
|
||||
|
||||
|
||||
public BlockRenderer(StaticShader shader, Matrix4f projectionMatrix)
|
||||
{
|
||||
this.shader = shader;
|
||||
|
@ -33,7 +31,8 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
|
|||
|
||||
private void prepBlockInstance(RenderObject entity)
|
||||
{
|
||||
Matrix4f transformationMatrix = Maths.createTransformationMatrix(entity.getPosition(), entity.getRotX(), entity.getRotY(), entity.getRotZ(), entity.getScale());
|
||||
Matrix4f transformationMatrix = Maths.createTransformationMatrix(entity.getPosition(), entity.getRotX(),
|
||||
entity.getRotY(), entity.getRotZ(), entity.getScale());
|
||||
shader.loadTransformationMatrix(transformationMatrix);
|
||||
}
|
||||
|
||||
|
@ -52,19 +51,18 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
|
|||
GL20.glDisableVertexAttribArray(2);
|
||||
GL30.glBindVertexArray(0);
|
||||
}
|
||||
|
||||
public void enableWireframe() {
|
||||
if (GingerRegister.getInstance().wireframe)
|
||||
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
|
||||
}
|
||||
|
||||
public void disableWireframe() {
|
||||
if (GingerRegister.getInstance().wireframe)
|
||||
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
|
||||
}
|
||||
|
||||
public void prepareRender() {
|
||||
//TODO: combine VBOS
|
||||
|
||||
public void enableWireframe()
|
||||
{ if (GingerRegister.getInstance().wireframe)
|
||||
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE); }
|
||||
|
||||
public void disableWireframe()
|
||||
{ if (GingerRegister.getInstance().wireframe)
|
||||
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); }
|
||||
|
||||
public void prepareRender()
|
||||
{
|
||||
// TODO: combine VBOS
|
||||
shader.start();
|
||||
shader.loadSkyColour(Window.getColour());
|
||||
shader.loadViewMatrix(GingerRegister.getInstance().game.data.camera);
|
||||
|
@ -81,18 +79,18 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
|
|||
for (int x = 0; x < CHUNK_SIZE; x++)
|
||||
for (int y = 0; y < CHUNK_SIZE; y++)
|
||||
for (int z = 0; z < CHUNK_SIZE; z++)
|
||||
{
|
||||
BlockInstance entity = renderList[Chunk.index(x, y, z)];
|
||||
if (entity != null && entity.getModel() != null)
|
||||
{
|
||||
TexturedModel blockModel = entity.getModel();
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID());
|
||||
prepBlockInstance(entity);
|
||||
GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
|
||||
}
|
||||
}
|
||||
{
|
||||
BlockInstance entity = renderList[Chunk.index(x, y, z)];
|
||||
if (entity != null && entity.getModel() != null)
|
||||
{
|
||||
TexturedModel blockModel = entity.getModel();
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID());
|
||||
prepBlockInstance(entity);
|
||||
GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(),
|
||||
GL11.GL_UNSIGNED_INT, 0);
|
||||
}
|
||||
}
|
||||
disableWireframe();
|
||||
shader.stop();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ import java.util.*;
|
|||
|
||||
import com.github.hydos.ginger.engine.common.api.game.Game;
|
||||
import com.github.hydos.ginger.engine.common.elements.buttons.TextureButton;
|
||||
import com.github.hydos.ginger.engine.opengl.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.common.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.common.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.opengl.postprocessing.Fbo;
|
||||
import com.github.hydos.ginger.engine.opengl.render.MasterRenderer;
|
||||
import com.github.hydos.ginger.engine.opengl.screen.Screen;
|
||||
import com.github.hydos.multithreading.GingerThreading;
|
||||
|
||||
/** Used if a game wants to access engine variables safely */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.fbo;
|
||||
package com.github.hydos.ginger.engine.common.fbo;
|
||||
|
||||
public abstract class FboCallbackHandler
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
/** Simple data structure class holding information about a certain glyph in the
|
||||
* font texture atlas. All sizes are for a font-size of 1. */
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
/** Represents a font. It holds the font's texture atlas as well as having the
|
||||
* ability to create the quad vertices for any text using this font. */
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
import org.joml.*;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
/** Stores the vertex data for all the quads on which a text will be rendered. */
|
||||
public class TextMeshData
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.font;
|
||||
package com.github.hydos.ginger.engine.common.font;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.hydos.ginger.engine.opengl.screen;
|
||||
package com.github.hydos.ginger.engine.common.screen;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -9,12 +9,12 @@ import com.github.hydos.ginger.engine.common.api.GingerRegister;
|
|||
import com.github.hydos.ginger.engine.common.api.game.*;
|
||||
import com.github.hydos.ginger.engine.common.elements.buttons.TextureButton;
|
||||
import com.github.hydos.ginger.engine.common.elements.objects.Player;
|
||||
import com.github.hydos.ginger.engine.common.font.*;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.opengl.font.*;
|
||||
import com.github.hydos.ginger.engine.common.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.opengl.postprocessing.*;
|
||||
import com.github.hydos.ginger.engine.opengl.render.MasterRenderer;
|
||||
import com.github.hydos.ginger.engine.opengl.render.tools.MousePicker;
|
||||
import com.github.hydos.ginger.engine.opengl.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.opengl.utils.GlLoader;
|
||||
import com.github.hydos.multithreading.GingerThreading;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.github.hydos.ginger.engine.opengl.api;
|
||||
|
||||
import com.github.hydos.ginger.engine.common.font.TextMaster;
|
||||
import com.github.hydos.ginger.engine.common.obj.ModelLoader;
|
||||
import com.github.hydos.ginger.engine.common.obj.normals.NormalMappedObjLoader;
|
||||
import com.github.hydos.ginger.engine.opengl.font.TextMaster;
|
||||
import com.github.hydos.ginger.engine.opengl.render.MasterRenderer;
|
||||
import com.github.hydos.ginger.engine.opengl.render.models.*;
|
||||
import com.github.hydos.ginger.engine.opengl.render.texture.ModelTexture;
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.github.hydos.ginger.engine.opengl.postprocessing;
|
|||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import com.github.hydos.ginger.engine.opengl.fbo.FboCallbackHandler;
|
||||
import com.github.hydos.ginger.engine.common.fbo.FboCallbackHandler;
|
||||
|
||||
public class ContrastChanger extends FboCallbackHandler
|
||||
{
|
||||
|
|
|
@ -8,8 +8,8 @@ import java.nio.ByteBuffer;
|
|||
import org.lwjgl.glfw.*;
|
||||
import org.lwjgl.system.Callback;
|
||||
|
||||
import com.github.hydos.ginger.engine.common.fbo.FboCallbackHandler;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.opengl.fbo.FboCallbackHandler;
|
||||
|
||||
public class Fbo
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.*;
|
|||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import com.github.hydos.ginger.engine.opengl.font.*;
|
||||
import com.github.hydos.ginger.engine.common.font.*;
|
||||
import com.github.hydos.ginger.engine.opengl.render.Renderer;
|
||||
import com.github.hydos.ginger.engine.opengl.render.shaders.FontShader;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.github.hydos.ginger.engine.opengl.render.shaders;
|
|||
|
||||
import org.joml.*;
|
||||
|
||||
import com.github.hydos.ginger.engine.opengl.font.GUIText;
|
||||
import com.github.hydos.ginger.engine.common.font.GUIText;
|
||||
|
||||
public class FontShader extends ShaderProgram
|
||||
{
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package com.github.hydos.ginger.engine.opengl.voxelutils;
|
||||
|
||||
public class BlockMesher
|
||||
{
|
||||
//TODO: supercoder i ask you that you figure a way to cull inner faces and not just whole blocks :)
|
||||
}
|
Loading…
Reference in New Issue