Work done during Train ride
This commit is contained in:
		
							parent
							
								
									ba4fa73cad
								
							
						
					
					
						commit
						072cf05aff
					
				@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					package speiger.src.coreengine.math.vector.matrix;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import speiger.src.collections.objects.lists.ObjectArrayList;
 | 
				
			||||||
 | 
					import speiger.src.collections.utils.Stack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class Matrix4fStack extends Matrix4f {
 | 
				
			||||||
 | 
						Stack<Matrix4f> stack = new ObjectArrayList<>();
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public void push() {
 | 
				
			||||||
 | 
							stack.push(new Matrix4f(this));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public void pop() {
 | 
				
			||||||
 | 
							load(stack.pop());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public int size() {
 | 
				
			||||||
 | 
							return stack.size();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -6,6 +6,7 @@ import speiger.src.coreengine.math.misc.Facing;
 | 
				
			|||||||
import speiger.src.coreengine.math.vector.matrix.Matrix4f;
 | 
					import speiger.src.coreengine.math.vector.matrix.Matrix4f;
 | 
				
			||||||
import speiger.src.coreengine.math.vector.quaternion.Quaternion;
 | 
					import speiger.src.coreengine.math.vector.quaternion.Quaternion;
 | 
				
			||||||
import speiger.src.coreengine.rendering.guiOld.helper.box.IGuiBox;
 | 
					import speiger.src.coreengine.rendering.guiOld.helper.box.IGuiBox;
 | 
				
			||||||
 | 
					import speiger.src.coreengine.rendering.models.DrawCall;
 | 
				
			||||||
import speiger.src.coreengine.rendering.textures.base.ITexture;
 | 
					import speiger.src.coreengine.rendering.textures.base.ITexture;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface IUIRenderer {
 | 
					public interface IUIRenderer {
 | 
				
			||||||
@ -30,7 +31,7 @@ public interface IUIRenderer {
 | 
				
			|||||||
	public void rotate(Quaternion rotation);
 | 
						public void rotate(Quaternion rotation);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public void drawCustom(Consumer<Matrix4f> matrix);
 | 
						public void drawCustom(Consumer<Matrix4f> matrix);
 | 
				
			||||||
	
 | 
						public void drawCustom(DrawCall drawcall);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public void drawLine(float minX, float minY, float maxX, float maxY, float zLevel, int color);
 | 
						public void drawLine(float minX, float minY, float maxX, float maxY, float zLevel, int color);
 | 
				
			||||||
@ -52,6 +53,4 @@ public interface IUIRenderer {
 | 
				
			|||||||
	public default void drawTexturedRect(float minX, float minY, float maxX, float maxY, float zLevel, ITexture texture, int color) { drawTexturedRect(minX, minY, maxX, maxY, zLevel, texture.id(), texture.minU(), texture.minV(), texture.maxU(), texture.maxV(), color); }
 | 
						public default void drawTexturedRect(float minX, float minY, float maxX, float maxY, float zLevel, ITexture texture, int color) { drawTexturedRect(minX, minY, maxX, maxY, zLevel, texture.id(), texture.minU(), texture.minV(), texture.maxU(), texture.maxV(), color); }
 | 
				
			||||||
	public default void drawTexturedRect(IGuiBox box, float zLevel, ITexture texture, float minU, float minV, float maxU, float maxV, int color) { drawTexturedRect(box.getMinX(), box.getMinY(), box.getMaxX(), box.getMaxY(), zLevel, texture.id(), minU, minV, maxU, maxV, color); }
 | 
						public default void drawTexturedRect(IGuiBox box, float zLevel, ITexture texture, float minU, float minV, float maxU, float maxV, int color) { drawTexturedRect(box.getMinX(), box.getMinY(), box.getMaxX(), box.getMaxY(), zLevel, texture.id(), minU, minV, maxU, maxV, color); }
 | 
				
			||||||
	public void drawTexturedRect(float minX, float minY, float maxX, float maxY, float zLevel, int texture, float minU, float minV, float maxU, float maxV, int color);
 | 
						public void drawTexturedRect(float minX, float minY, float maxX, float maxY, float zLevel, int texture, float minU, float minV, float maxU, float maxV, int color);
 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,115 @@
 | 
				
			|||||||
 | 
					package speiger.src.coreengine.rendering.gui.renderer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.function.Consumer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import speiger.src.collections.objects.lists.ObjectArrayList;
 | 
				
			||||||
 | 
					import speiger.src.collections.utils.Stack;
 | 
				
			||||||
 | 
					import speiger.src.coreengine.math.misc.Facing;
 | 
				
			||||||
 | 
					import speiger.src.coreengine.math.vector.matrix.Matrix4f;
 | 
				
			||||||
 | 
					import speiger.src.coreengine.math.vector.quaternion.Quaternion;
 | 
				
			||||||
 | 
					import speiger.src.coreengine.rendering.guiOld.helper.box.IGuiBox;
 | 
				
			||||||
 | 
					import speiger.src.coreengine.rendering.models.DrawCall;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class SimpleUIRenderer implements IUIRenderer {
 | 
				
			||||||
 | 
						TexturedRect cachedRect = new TexturedRect();
 | 
				
			||||||
 | 
						Stack<Matrix4f> transformCache = ObjectArrayList.wrap(new Matrix4f());
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public boolean isInScissors(IGuiBox box) {
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void pushScissors(IGuiBox box) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void popScissors() {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public TexturedRect getCachedRect() { return cachedRect; }
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void flush() {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void pushTransform() {
 | 
				
			||||||
 | 
							transformCache.push(new Matrix4f(transformCache.top()));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void popTransform() {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void translate(float z) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void translate(float x, float y) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void translate(float x, float y, float z) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void scale(float scale) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void scale(float x, float y) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void rotate(Quaternion rotation) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawCustom(Consumer<Matrix4f> matrix) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawCustom(DrawCall drawcall) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawLine(float minX, float minY, float maxX, float maxY, float zLevel, int color) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawFrame(float minX, float minY, float maxX, float maxY, float zLevel, int color) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawRect(float minX, float minY, float maxX, float maxY, float zLevel, int color) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawGradientRect(float minX, float minY, float maxX, float maxY, float zLevel, int startColor, int endColor, Facing facing) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void drawTexturedRect(float minX, float minY, float maxX, float maxY, float zLevel, int texture, float minU, float minV, float maxU, float maxV, int color) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user