More work on the GPU API
This commit is contained in:
parent
bc078abea4
commit
c1f6c5ec10
60
.classpath
60
.classpath
@ -1,30 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="bin/main" path="src/main/java">
|
<classpathentry kind="src" output="bin/main" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="gradle_scope" value="main"/>
|
<attribute name="gradle_scope" value="main"/>
|
||||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="bin/main" path="src/main/resources">
|
<classpathentry kind="src" output="bin/main" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="gradle_scope" value="main"/>
|
<attribute name="gradle_scope" value="main"/>
|
||||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="bin/graphics" path="src/graphics/java">
|
<classpathentry kind="src" output="bin/graphics" path="src/graphics/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="gradle_scope" value="graphics"/>
|
<attribute name="gradle_scope" value="graphics"/>
|
||||||
<attribute name="gradle_used_by_scope" value="graphics"/>
|
<attribute name="gradle_used_by_scope" value="graphics"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="bin/graphics" path="src/graphics/resources">
|
<classpathentry kind="src" output="bin/graphics" path="src/graphics/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="gradle_scope" value="graphics"/>
|
<attribute name="gradle_scope" value="graphics"/>
|
||||||
<attribute name="gradle_used_by_scope" value="graphics"/>
|
<attribute name="gradle_used_by_scope" value="graphics"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25/"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25/"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||||
<classpathentry kind="output" path="bin/default"/>
|
<classpathentry kind="output" path="bin/default"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
46
.project
46
.project
@ -1,23 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>GameProject-SimpleJavaEngine</name>
|
<name>SimpleJavaEngine</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
arguments=
|
arguments=
|
||||||
auto.sync=false
|
auto.sync=false
|
||||||
build.scans.enabled=false
|
build.scans.enabled=false
|
||||||
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(9.1.0))
|
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||||
connection.project.dir=
|
connection.project.dir=
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
gradle.user.home=
|
gradle.user.home=
|
||||||
java.home=C\:/Program Files/Java/jdk-25.0.2+10
|
java.home=C\:/Program Files/Java/jdk25
|
||||||
jvm.arguments=
|
jvm.arguments=
|
||||||
offline.mode=false
|
offline.mode=false
|
||||||
override.workspace.settings=true
|
override.workspace.settings=true
|
||||||
show.console.view=false
|
show.console.view=false
|
||||||
show.executions.view=false
|
show.executions.view=false
|
||||||
|
|||||||
15
build.gradle
15
build.gradle
@ -7,10 +7,23 @@ tasks.withType(JavaCompile) {
|
|||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eclipse {
|
eclipse {
|
||||||
classpath {
|
classpath {
|
||||||
downloadJavadoc = true
|
downloadJavadoc = true
|
||||||
downloadSources = true
|
downloadSources = true
|
||||||
|
file {
|
||||||
|
whenMerged { cp ->
|
||||||
|
cp.entries.forEach { entry ->
|
||||||
|
// Target the core LWJGL modules
|
||||||
|
if (entry.kind == 'lib' && entry.path.contains('org.lwjgl')) {
|
||||||
|
// Dynamically add a JPMS modular export rule to the Eclipse compiler
|
||||||
|
def rule = new org.gradle.plugins.ide.eclipse.model.AccessRule('accessible', 'org/lwjgl/system/**')
|
||||||
|
entry.accessRules.add(rule)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +42,7 @@ repositories {
|
|||||||
name = "Speiger Maven"
|
name = "Speiger Maven"
|
||||||
url = "https://maven.speiger.com/repository/main"
|
url = "https://maven.speiger.com/repository/main"
|
||||||
}
|
}
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url "https://central.sonatype.com/repository/maven-snapshots" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
lwjglVersion = 3.3.4
|
lwjglVersion = 3.3.4
|
||||||
lwjglNatives = natives-windows
|
lwjglNatives = natives-windows
|
||||||
10
gradle/wrapper/gradle-wrapper.properties
vendored
10
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
package speiger.src.coreengine.api.buffer;
|
|
||||||
|
|
||||||
public interface VertexBuffer {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
package speiger.src.coreengine.api.core;
|
|
||||||
|
|
||||||
public interface GraphicsCommandQueue {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
package speiger.src.coreengine.api.core;
|
|
||||||
|
|
||||||
public interface GraphicsResource {
|
|
||||||
public void remove();
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
package speiger.src.coreengine.api.texture;
|
|
||||||
|
|
||||||
public abstract class Texture {
|
|
||||||
protected final TextureType type = null;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.buffer;
|
||||||
|
|
||||||
|
public enum BufferState {
|
||||||
|
STATIC_DRAW,
|
||||||
|
STATIC_READ,
|
||||||
|
STATIC_COPY,
|
||||||
|
STREAM_DRAW,
|
||||||
|
STREAM_READ,
|
||||||
|
STREAM_COPY,
|
||||||
|
DYNAMIC_DRAW,
|
||||||
|
DYNAMIC_READ,
|
||||||
|
DYNAMIC_COPY;
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.buffer;
|
||||||
|
|
||||||
|
import java.nio.Buffer;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
import org.lwjgl.system.MemoryUtil;
|
||||||
|
|
||||||
|
import speiger.src.coreengine.graphics.api.core.GraphicsResource;
|
||||||
|
|
||||||
|
public abstract class VertexBuffer implements GraphicsResource {
|
||||||
|
protected final BufferState usage;
|
||||||
|
protected int size;
|
||||||
|
|
||||||
|
public VertexBuffer(BufferState usage, int size) {
|
||||||
|
this.usage = usage;
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BufferState usage() {
|
||||||
|
return usage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int size() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract VertexBuffer allocate(int totalBytes);
|
||||||
|
public abstract VertexBuffer set(long pointer, int totalBytes);
|
||||||
|
public VertexBuffer set(ByteBuffer buffer) {
|
||||||
|
return set(MemoryUtil.memAddress(buffer), buffer.remaining());
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract VertexBuffer fill(long pointer, int totalBytes, int offset);
|
||||||
|
public VertexBuffer fill(int offset, ByteBuffer buffer) {
|
||||||
|
return fill(MemoryUtil.memAddress(buffer), buffer.remaining(), offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract VertexBuffer read(long pointer, int totalbytes, int offset);
|
||||||
|
public VertexBuffer read(Buffer buffer, int totalBytes, int offset) {
|
||||||
|
return read(MemoryUtil.memAddress(buffer), totalBytes, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,9 +1,9 @@
|
|||||||
package speiger.src.coreengine.api.core;
|
package speiger.src.coreengine.graphics.api.core;
|
||||||
|
|
||||||
import speiger.src.coreengine.rendering.input.window.Window;
|
import speiger.src.coreengine.rendering.input.window.Window;
|
||||||
|
|
||||||
public interface Graphics {
|
public interface Graphics {
|
||||||
public String getName();
|
public String getName();
|
||||||
|
|
||||||
public GraphicsDevice createDevice(Window window);
|
public GraphicsDevice createDevice(Window window);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.core;
|
||||||
|
|
||||||
|
public interface GraphicsCommandQueue {
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,12 +1,12 @@
|
|||||||
package speiger.src.coreengine.api.core;
|
package speiger.src.coreengine.graphics.api.core;
|
||||||
|
|
||||||
import speiger.src.coreengine.api.buffer.VertexBuffer;
|
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||||
import speiger.src.coreengine.api.texture.Texture;
|
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||||
import speiger.src.coreengine.rendering.input.window.Window;
|
import speiger.src.coreengine.rendering.input.window.Window;
|
||||||
|
|
||||||
public interface GraphicsDevice {
|
public interface GraphicsDevice {
|
||||||
public GraphicsSurface createSurface(Window window);
|
public GraphicsSurface createSurface(Window window);
|
||||||
public GraphicsCommandQueue getQueue();
|
public GraphicsCommandQueue getQueue();
|
||||||
public VertexBuffer createBuffer();
|
public VertexBuffer createBuffer();
|
||||||
public Texture createTexture();
|
public Texture createTexture();
|
||||||
}
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.core;
|
||||||
|
|
||||||
|
public interface GraphicsResource extends AutoCloseable {
|
||||||
|
public boolean isRemoved();
|
||||||
|
public void remove();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default void close() {
|
||||||
|
remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
package speiger.src.coreengine.api.core;
|
package speiger.src.coreengine.graphics.api.core;
|
||||||
|
|
||||||
public interface GraphicsSurface {
|
public interface GraphicsSurface {
|
||||||
public void setVsync(boolean value);
|
public void setVsync(boolean value);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.sampler;
|
||||||
|
|
||||||
|
public abstract class Sampler {
|
||||||
|
SamplerSettings settings;
|
||||||
|
|
||||||
|
public Sampler(SamplerSettings settings) {
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SamplerSettings settings() {
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.sampler;
|
||||||
|
|
||||||
|
public class SamplerSettings {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.texture;
|
||||||
|
|
||||||
|
import speiger.src.coreengine.graphics.api.core.GraphicsResource;
|
||||||
|
|
||||||
|
public abstract class Texture implements GraphicsResource {
|
||||||
|
final TextureSettings settings;
|
||||||
|
|
||||||
|
public Texture(TextureSettings settings) {
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextureSettings settings() {
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.texture;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.OptionalInt;
|
||||||
|
|
||||||
|
import speiger.src.collections.objects.lists.ImmutableObjectList;
|
||||||
|
import speiger.src.coreengine.graphics.api.texture.states.StencilType;
|
||||||
|
import speiger.src.coreengine.graphics.api.texture.states.SwizzleMask;
|
||||||
|
import speiger.src.coreengine.graphics.api.texture.states.TextureFormat;
|
||||||
|
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||||
|
|
||||||
|
public record TextureSettings(TextureType type, TextureFormat internal, TextureFormat external, boolean generateMipmapping, OptionalInt baseLevel, OptionalInt maxLevel, List<Optional<SwizzleMask>> swizzle, Optional<StencilType> stencilType) {
|
||||||
|
|
||||||
|
public Builder copy() { return new Builder(this); }
|
||||||
|
public static Builder builder() { return new Builder(); }
|
||||||
|
|
||||||
|
public boolean hasSwizzle() {
|
||||||
|
for(int i = 0;i<4;i++) {
|
||||||
|
if(swizzle().get(i).isPresent()) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder {
|
||||||
|
TextureFormat internalFormat;
|
||||||
|
TextureFormat externalFormat;
|
||||||
|
TextureType type;
|
||||||
|
boolean generateMipmapping = false;
|
||||||
|
OptionalInt baseLevel = OptionalInt.empty();
|
||||||
|
OptionalInt maxLevel = OptionalInt.empty();
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Optional<SwizzleMask>[] swizzle = new Optional[] {Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()};
|
||||||
|
Optional<StencilType> stencilType = Optional.empty();
|
||||||
|
|
||||||
|
private Builder() {}
|
||||||
|
private Builder(TextureSettings settings) {
|
||||||
|
type = settings.type;
|
||||||
|
internalFormat = settings.internal;
|
||||||
|
externalFormat = settings.external;
|
||||||
|
generateMipmapping = settings.generateMipmapping;
|
||||||
|
baseLevel = settings.baseLevel;
|
||||||
|
maxLevel = settings.maxLevel;
|
||||||
|
settings.swizzle.toArray(swizzle);
|
||||||
|
stencilType = settings.stencilType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextureSettings build() {
|
||||||
|
return new TextureSettings(
|
||||||
|
Objects.requireNonNull(type, "Texture Type shouldn't be null"),
|
||||||
|
Objects.requireNonNull(internalFormat, "Internal Format shouldn't be null"),
|
||||||
|
Objects.requireNonNull(externalFormat, "External Format shouldn't be null"),
|
||||||
|
generateMipmapping, baseLevel, maxLevel, new ImmutableObjectList<>(swizzle), stencilType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder type(TextureType type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder format(TextureFormat format) {
|
||||||
|
this.internalFormat = format;
|
||||||
|
this.externalFormat = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder internal(TextureFormat format) {
|
||||||
|
this.internalFormat = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder external(TextureFormat format) {
|
||||||
|
this.externalFormat = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder swizzle(SwizzleMask red, SwizzleMask green, SwizzleMask blue, SwizzleMask alpha) {
|
||||||
|
swizzle[0] = Optional.ofNullable(red);
|
||||||
|
swizzle[1] = Optional.ofNullable(green);
|
||||||
|
swizzle[2] = Optional.ofNullable(blue);
|
||||||
|
swizzle[3] = Optional.ofNullable(alpha);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder swizzleRed(SwizzleMask mask) {
|
||||||
|
swizzle[0] = Optional.ofNullable(mask);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder swizzleGreen(SwizzleMask mask) {
|
||||||
|
swizzle[1] = Optional.ofNullable(mask);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder swizzleBlue(SwizzleMask mask) {
|
||||||
|
swizzle[2] = Optional.ofNullable(mask);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder swizzleAlpha(SwizzleMask mask) {
|
||||||
|
swizzle[3] = Optional.ofNullable(mask);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder stencil(StencilType type) {
|
||||||
|
stencilType = Optional.ofNullable(type);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder generateMipmapping(boolean value) {
|
||||||
|
this.generateMipmapping = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mipMapping(int base, int max) {
|
||||||
|
this.baseLevel = OptionalInt.of(base);
|
||||||
|
this.maxLevel = OptionalInt.of(max);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder clearmMipMapping() {
|
||||||
|
this.baseLevel = OptionalInt.empty();
|
||||||
|
this.maxLevel = OptionalInt.empty();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.texture.states;
|
||||||
|
|
||||||
|
public enum StencilType {
|
||||||
|
DEPTH_COMPONENT,
|
||||||
|
STENCIL_INDEX
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.texture.states;
|
||||||
|
|
||||||
|
public enum SwizzleMask {
|
||||||
|
ZERO,
|
||||||
|
ONE,
|
||||||
|
RED,
|
||||||
|
GREEN,
|
||||||
|
BLUE,
|
||||||
|
ALPHA;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package speiger.src.coreengine.graphics.api.texture.states;
|
||||||
|
|
||||||
|
public enum TextureFormat {
|
||||||
|
R,
|
||||||
|
RGB,
|
||||||
|
RGBA,
|
||||||
|
DEPTH,
|
||||||
|
DEPTH_STENCIL,
|
||||||
|
LUMINANCE,
|
||||||
|
LUMINANCE_ALPHA
|
||||||
|
}
|
||||||
@ -1,15 +1,15 @@
|
|||||||
package speiger.src.coreengine.api.texture;
|
package speiger.src.coreengine.graphics.api.texture.states;
|
||||||
|
|
||||||
public enum TextureType {
|
public enum TextureType {
|
||||||
TEXTURE_1D,
|
TEXTURE_1D,
|
||||||
TEXTURE_1D_ARRAY,
|
TEXTURE_1D_ARRAY,
|
||||||
TEXTURE_2D,
|
TEXTURE_2D,
|
||||||
TEXTURE_2D_ARRAY,
|
TEXTURE_2D_ARRAY,
|
||||||
TEXTURE_2D_MULTISAMPLE,
|
TEXTURE_2D_MULTISAMPLE,
|
||||||
TEXTURE_2D_MULTISAMPLE_ARRAY,
|
TEXTURE_2D_MULTISAMPLE_ARRAY,
|
||||||
TEXTURE_3D,
|
TEXTURE_3D,
|
||||||
TEXTURE_CUBE_MAP,
|
TEXTURE_CUBE_MAP,
|
||||||
TEXTURE_CUBE_MAP_ARRAY,
|
TEXTURE_CUBE_MAP_ARRAY,
|
||||||
TEXTURE_RECTANGLE,
|
TEXTURE_RECTANGLE,
|
||||||
TEXTURE_BUFFER;
|
TEXTURE_BUFFER;
|
||||||
}
|
}
|
||||||
@ -1,324 +1,325 @@
|
|||||||
package speiger.src.coreengine;
|
package speiger.src.coreengine;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import org.lwjgl.opengl.GL;
|
import org.lwjgl.opengl.GL;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL43;
|
import org.lwjgl.opengl.GL43;
|
||||||
import org.lwjgl.system.Configuration;
|
import org.lwjgl.system.Configuration;
|
||||||
import org.lwjgl.util.freetype.FreeType;
|
import org.lwjgl.util.freetype.FreeType;
|
||||||
|
|
||||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
|
||||||
import speiger.src.coreengine.assets.AssetLocation;
|
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||||
import speiger.src.coreengine.assets.AssetManager;
|
import speiger.src.coreengine.assets.AssetLocation;
|
||||||
import speiger.src.coreengine.assets.base.IAssetPackage;
|
import speiger.src.coreengine.assets.AssetManager;
|
||||||
import speiger.src.coreengine.assets.base.IAssetProvider;
|
import speiger.src.coreengine.assets.base.IAssetPackage;
|
||||||
import speiger.src.coreengine.math.vector.matrix.Matrix4f;
|
import speiger.src.coreengine.assets.base.IAssetProvider;
|
||||||
import speiger.src.coreengine.rendering.gui.font.Font;
|
import speiger.src.coreengine.math.vector.matrix.Matrix4f;
|
||||||
import speiger.src.coreengine.rendering.gui.font.FontManager;
|
import speiger.src.coreengine.rendering.gui.font.Font;
|
||||||
import speiger.src.coreengine.rendering.gui.font.TextStyle;
|
import speiger.src.coreengine.rendering.gui.font.FontManager;
|
||||||
import speiger.src.coreengine.rendering.gui.font.glyth.Glyth;
|
import speiger.src.coreengine.rendering.gui.font.TextStyle;
|
||||||
import speiger.src.coreengine.rendering.gui.font.glyth.IGlythSheetInfo;
|
import speiger.src.coreengine.rendering.gui.font.glyth.Glyth;
|
||||||
import speiger.src.coreengine.rendering.gui.font.glyth.MissingGlyth;
|
import speiger.src.coreengine.rendering.gui.font.glyth.IGlythSheetInfo;
|
||||||
import speiger.src.coreengine.rendering.gui.font.glyth.UnbakedGlyth.GlythBaker;
|
import speiger.src.coreengine.rendering.gui.font.glyth.MissingGlyth;
|
||||||
import speiger.src.coreengine.rendering.input.devices.FileDrop;
|
import speiger.src.coreengine.rendering.gui.font.glyth.UnbakedGlyth.GlythBaker;
|
||||||
import speiger.src.coreengine.rendering.input.devices.Joystick;
|
import speiger.src.coreengine.rendering.input.devices.FileDrop;
|
||||||
import speiger.src.coreengine.rendering.input.devices.Keyboard;
|
import speiger.src.coreengine.rendering.input.devices.Joystick;
|
||||||
import speiger.src.coreengine.rendering.input.devices.Mouse;
|
import speiger.src.coreengine.rendering.input.devices.Keyboard;
|
||||||
import speiger.src.coreengine.rendering.input.events.KeyEvent;
|
import speiger.src.coreengine.rendering.input.devices.Mouse;
|
||||||
import speiger.src.coreengine.rendering.input.events.MouseEvent;
|
import speiger.src.coreengine.rendering.input.events.KeyEvent;
|
||||||
import speiger.src.coreengine.rendering.input.window.Window;
|
import speiger.src.coreengine.rendering.input.events.MouseEvent;
|
||||||
import speiger.src.coreengine.rendering.input.window.WindowManager;
|
import speiger.src.coreengine.rendering.input.window.Window;
|
||||||
import speiger.src.coreengine.rendering.models.buffers.BufferAttribute;
|
import speiger.src.coreengine.rendering.input.window.WindowManager;
|
||||||
import speiger.src.coreengine.rendering.models.buffers.VertexArray;
|
import speiger.src.coreengine.rendering.models.buffers.BufferAttribute;
|
||||||
import speiger.src.coreengine.rendering.shader.Shader;
|
import speiger.src.coreengine.rendering.models.buffers.VertexArray;
|
||||||
import speiger.src.coreengine.rendering.shader.SimpleShader;
|
import speiger.src.coreengine.rendering.shader.Shader;
|
||||||
import speiger.src.coreengine.rendering.shader.uniform.base.TextureUniform;
|
import speiger.src.coreengine.rendering.shader.SimpleShader;
|
||||||
import speiger.src.coreengine.rendering.shader.uniform.vec.Matrix4fUniform;
|
import speiger.src.coreengine.rendering.shader.uniform.base.TextureUniform;
|
||||||
import speiger.src.coreengine.rendering.tesselation.buffer.IVertexBuilder;
|
import speiger.src.coreengine.rendering.shader.uniform.vec.Matrix4fUniform;
|
||||||
import speiger.src.coreengine.rendering.tesselation.buffer.VertexBuilder;
|
import speiger.src.coreengine.rendering.tesselation.buffer.IVertexBuilder;
|
||||||
import speiger.src.coreengine.rendering.tesselation.format.VertexTypes;
|
import speiger.src.coreengine.rendering.tesselation.buffer.VertexBuilder;
|
||||||
import speiger.src.coreengine.rendering.textures.custom.Drawable;
|
import speiger.src.coreengine.rendering.tesselation.format.VertexTypes;
|
||||||
import speiger.src.coreengine.rendering.textures.custom.DynamicTexture;
|
import speiger.src.coreengine.rendering.textures.custom.Drawable;
|
||||||
import speiger.src.coreengine.rendering.utils.GLStateTracker;
|
import speiger.src.coreengine.rendering.textures.custom.DynamicTexture;
|
||||||
import speiger.src.coreengine.rendering.utils.values.GLDataType;
|
import speiger.src.coreengine.rendering.utils.GLStateTracker;
|
||||||
import speiger.src.coreengine.rendering.utils.values.GLMode;
|
import speiger.src.coreengine.rendering.utils.values.GLDataType;
|
||||||
import speiger.src.coreengine.rendering.utils.values.textures.GLTextureFormat;
|
import speiger.src.coreengine.rendering.utils.values.GLMode;
|
||||||
import speiger.src.coreengine.utils.eventbus.EventBus;
|
import speiger.src.coreengine.rendering.utils.values.textures.GLTextureFormat;
|
||||||
import speiger.src.coreengine.utils.helpers.IOUtils;
|
import speiger.src.coreengine.utils.eventbus.EventBus;
|
||||||
|
import speiger.src.coreengine.utils.helpers.IOUtils;
|
||||||
public class NewInputTest {
|
|
||||||
|
public class NewInputTest {
|
||||||
EventBus bus = new EventBus();
|
|
||||||
WindowManager manager = new WindowManager();
|
EventBus bus = new EventBus();
|
||||||
AssetManager assets = new AssetManager(List.of(IAssetPackage.of(IOUtils.getBaseLocation())));
|
WindowManager manager = new WindowManager();
|
||||||
FontManager fonts = new FontManager();
|
AssetManager assets = new AssetManager(List.of(IAssetPackage.of(IOUtils.getBaseLocation())));
|
||||||
private Shader<TestShader> shaderTest = Shader.create(TestShader::new);
|
FontManager fonts = new FontManager();
|
||||||
private Shader<GuiShader> guiShader = Shader.create(GuiShader::new);
|
private Shader<TestShader> shaderTest = Shader.create(TestShader::new);
|
||||||
|
private Shader<GuiShader> guiShader = Shader.create(GuiShader::new);
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
new NewInputTest().run();
|
public static void main(String[] args) {
|
||||||
}
|
new NewInputTest().run();
|
||||||
|
}
|
||||||
private void applyWindowSize(Window window) {
|
|
||||||
int scale = 0;
|
private void applyWindowSize(Window window) {
|
||||||
guiShader.get().proView.set(new Matrix4f().ortho(0, 0, window.width() >> scale, window.height() >> scale, 1000, -1000));
|
int scale = 0;
|
||||||
}
|
guiShader.get().proView.set(new Matrix4f().ortho(0, 0, window.width() >> scale, window.height() >> scale, 1000, -1000));
|
||||||
|
}
|
||||||
public void run() {
|
|
||||||
Configuration.HARFBUZZ_LIBRARY_NAME.set(FreeType.getLibrary());
|
public void run() {
|
||||||
GLFW.glfwInit();
|
Configuration.HARFBUZZ_LIBRARY_NAME.set(FreeType.getLibrary());
|
||||||
manager.initialize();
|
GLFW.glfwInit();
|
||||||
Mouse.INSTANCE.init(bus);
|
manager.initialize();
|
||||||
Keyboard.INSTANCE.init(bus);
|
Mouse.INSTANCE.init(bus);
|
||||||
Joystick.INSTANCE.init(manager, bus);
|
Keyboard.INSTANCE.init(bus);
|
||||||
FileDrop.INSTANCE.init(bus);
|
Joystick.INSTANCE.init(manager, bus);
|
||||||
manager.addDevices(Mouse.INSTANCE, Keyboard.INSTANCE, Joystick.INSTANCE, FileDrop.INSTANCE);
|
FileDrop.INSTANCE.init(bus);
|
||||||
Window window = manager.builder().title("Testing Engine").width(800).height(600).antialis(0).build();
|
manager.addDevices(Mouse.INSTANCE, Keyboard.INSTANCE, Joystick.INSTANCE, FileDrop.INSTANCE);
|
||||||
Window secondWindow = manager.builder().title("Second Window Engine").width(800).height(600).antialis(0).build();
|
Window window = manager.builder().title("Testing Engine").width(800).height(600).antialis(0).build();
|
||||||
Thread.ofPlatform().start(() -> drawSecondScreen(secondWindow));
|
Window secondWindow = manager.builder().title("Second Window Engine").width(800).height(600).antialis(0).build();
|
||||||
window.setupContext();
|
Thread.ofPlatform().start(() -> drawSecondScreen(secondWindow));
|
||||||
shaderTest.register();
|
window.setupContext();
|
||||||
guiShader.register();
|
shaderTest.register();
|
||||||
assets.addListener(GLStateTracker.instance().shaders);
|
guiShader.register();
|
||||||
assets.addListener(GLStateTracker.TEXTURE_TRACKER);
|
assets.addListener(GLStateTracker.instance().shaders);
|
||||||
assets.addListener(fonts);
|
assets.addListener(GLStateTracker.TEXTURE_TRACKER);
|
||||||
assets.reload();
|
assets.addListener(fonts);
|
||||||
|
assets.reload();
|
||||||
applyWindowSize(window);
|
|
||||||
System.out.println("Testing: "+GL.getCapabilities().OpenGL41);
|
applyWindowSize(window);
|
||||||
System.out.println("Testing: "+Integer.divideUnsigned(-1, 255));
|
System.out.println("Testing: "+GL.getCapabilities().OpenGL41);
|
||||||
|
System.out.println("Testing: "+Integer.divideUnsigned(-1, 255));
|
||||||
GL11.glEnable(GL43.GL_MULTISAMPLE);
|
|
||||||
int size = 512;
|
GL11.glEnable(GL43.GL_MULTISAMPLE);
|
||||||
int half = size >> 1;
|
int size = 512;
|
||||||
int base = size >> 3;
|
int half = size >> 1;
|
||||||
|
int base = size >> 3;
|
||||||
DynamicTexture texture = new DynamicTexture(size, size, DynamicTexture.DEFAULT_PARAMETERS);
|
|
||||||
texture.fill(0, 0, size, size, -1);
|
DynamicTexture texture = new DynamicTexture(size, size, DynamicTexture.DEFAULT_PARAMETERS);
|
||||||
texture.fill(0, 0, half, half, 255, 0, 0, 255);
|
texture.fill(0, 0, size, size, -1);
|
||||||
texture.fill(half, 0, half, half, 0, 255, 0, 255);
|
texture.fill(0, 0, half, half, 255, 0, 0, 255);
|
||||||
texture.fill(half, half, half, half, 255, 0, 0, 255);
|
texture.fill(half, 0, half, half, 0, 255, 0, 255);
|
||||||
texture.fill(0, half, half, half, 0, 0, 255, 255);
|
texture.fill(half, half, half, half, 255, 0, 0, 255);
|
||||||
texture.process(true);
|
texture.fill(0, half, half, half, 0, 0, 255, 255);
|
||||||
window.visible(true);
|
texture.process(true);
|
||||||
|
window.visible(true);
|
||||||
bus.register(MouseEvent.Click.class, T -> {
|
|
||||||
System.out.println("Testing: Button="+T.button()+", Click="+T.press()+", X="+T.x()+", Y="+T.y()+", WindowId="+T.windowId()+", WindowName="+manager.getWindow(T.windowId()).title());
|
bus.register(MouseEvent.Click.class, T -> {
|
||||||
});
|
System.out.println("Testing: Button="+T.button()+", Click="+T.press()+", X="+T.x()+", Y="+T.y()+", WindowId="+T.windowId()+", WindowName="+manager.getWindow(T.windowId()).title());
|
||||||
bus.register(KeyEvent.Key.class, T -> {
|
});
|
||||||
if(T.key() == GLFW.GLFW_KEY_T) {
|
bus.register(KeyEvent.Key.class, T -> {
|
||||||
T.cancel();
|
if(T.key() == GLFW.GLFW_KEY_T) {
|
||||||
// texture.bind();
|
T.cancel();
|
||||||
Drawable drawable = new Drawable(GLTextureFormat.RGBA, half, half);
|
// texture.bind();
|
||||||
drawable.fill(0, 0, half, half, 255, 255, 0, 255);
|
Drawable drawable = new Drawable(GLTextureFormat.RGBA, half, half);
|
||||||
drawable.upload(texture.id(), base * 3, base * 3, base, base, base * 2, base * 2);
|
drawable.fill(0, 0, half, half, 255, 255, 0, 255);
|
||||||
drawable.close();
|
drawable.upload(texture.id(), base * 3, base * 3, base, base, base * 2, base * 2);
|
||||||
}
|
drawable.close();
|
||||||
else if(T.key() == GLFW.GLFW_KEY_U) {
|
}
|
||||||
MissingGlyth glyth = new MissingGlyth(18.5F, 4F);
|
else if(T.key() == GLFW.GLFW_KEY_U) {
|
||||||
glyth.bake(new GlythBaker() {
|
MissingGlyth glyth = new MissingGlyth(18.5F, 4F);
|
||||||
@Override
|
glyth.bake(new GlythBaker() {
|
||||||
public Glyth bake(IGlythSheetInfo info) {
|
@Override
|
||||||
int width = info.width();
|
public Glyth bake(IGlythSheetInfo info) {
|
||||||
int height = info.height();
|
int width = info.width();
|
||||||
info.upload(texture.id(), half - (width >> 1), half - (height >> 1));
|
int height = info.height();
|
||||||
System.out.println("Test3: "+width+", "+height);
|
info.upload(texture.id(), half - (width >> 1), half - (height >> 1));
|
||||||
return null;
|
System.out.println("Test3: "+width+", "+height);
|
||||||
}
|
return null;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
else if(T.key() == GLFW.GLFW_KEY_O && T.press()) {
|
}
|
||||||
window.borderless(!window.isBorderless());
|
else if(T.key() == GLFW.GLFW_KEY_O && T.press()) {
|
||||||
}
|
window.borderless(!window.isBorderless());
|
||||||
});
|
}
|
||||||
|
});
|
||||||
VertexBuilder builder = new VertexBuilder(255);
|
|
||||||
builder.start(GLMode.TRIANGLES, VertexTypes.TESTING);
|
VertexBuilder builder = new VertexBuilder(255);
|
||||||
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
builder.start(GLMode.TRIANGLES, VertexTypes.TESTING);
|
||||||
builder.pos(0.5F, -0.5F, 0).tex(1F, 1F).rgba(-1).endVertex();
|
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
||||||
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
builder.pos(0.5F, -0.5F, 0).tex(1F, 1F).rgba(-1).endVertex();
|
||||||
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
||||||
builder.pos(-0.5F, 0.5F, 0).tex(0F, 0F).rgba(-1).endVertex();
|
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
||||||
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
builder.pos(-0.5F, 0.5F, 0).tex(0F, 0F).rgba(-1).endVertex();
|
||||||
|
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
||||||
// Font font = fonts.createFont(1F);
|
|
||||||
TestModel model = new TestModel(builder.getBytes());
|
// Font font = fonts.createFont(1F);
|
||||||
// TestModel[] guiModel = new TestModel[1];
|
TestModel model = new TestModel(builder.getBytes());
|
||||||
// List<GLDraw> draws = new ObjectArrayList<>();
|
// TestModel[] guiModel = new TestModel[1];
|
||||||
// TexturedBuffer buffer = new TexturedBuffer((K, V) -> {
|
// List<GLDraw> draws = new ObjectArrayList<>();
|
||||||
// draws.addAll(K);
|
// TexturedBuffer buffer = new TexturedBuffer((K, V) -> {
|
||||||
// guiModel[0] = new TestModel(V);
|
// draws.addAll(K);
|
||||||
// System.out.println("Testing: "+V.length+" bytes, "+K.size());
|
// guiModel[0] = new TestModel(V);
|
||||||
// });
|
// System.out.println("Testing: "+V.length+" bytes, "+K.size());
|
||||||
|
// });
|
||||||
// String s = "The Quick brown fox Jumps over the Lazy dog";
|
|
||||||
float x = 50;
|
// String s = "The Quick brown fox Jumps over the Lazy dog";
|
||||||
float y = 50;
|
float x = 50;
|
||||||
float scale = 1F;
|
float y = 50;
|
||||||
y /= scale;
|
float scale = 1F;
|
||||||
TextStyle style = TextStyle.DEFAULT.size(12).bold(false);
|
y /= scale;
|
||||||
// font.drawText(style, "Testing My Theory", x, y, -1, buffer, scale, true);
|
TextStyle style = TextStyle.DEFAULT.size(12).bold(false);
|
||||||
// float offset = font.drawText(style, "The Quick ", 50, y, -1, buffer, scale, false);
|
// font.drawText(style, "Testing My Theory", x, y, -1, buffer, scale, true);
|
||||||
// offset += font.drawText(style, "Brown ", 50+offset, y, -1, buffer, scale, false);
|
// float offset = font.drawText(style, "The Quick ", 50, y, -1, buffer, scale, false);
|
||||||
// offset += font.drawText(style, "§<c=0x24FF00FF>F§<c=r>ox ", 50+offset, y, -1, buffer, scale, false);
|
// offset += font.drawText(style, "Brown ", 50+offset, y, -1, buffer, scale, false);
|
||||||
// offset += font.drawText(style, "Jumps ", 50+offset, y, -1, buffer, scale, false);
|
// offset += font.drawText(style, "§<c=0x24FF00FF>F§<c=r>ox ", 50+offset, y, -1, buffer, scale, false);
|
||||||
// offset += font.drawText(style, "over the Lazy dog", 50+offset, y, -1, buffer, scale, true);
|
// offset += font.drawText(style, "Jumps ", 50+offset, y, -1, buffer, scale, false);
|
||||||
// font.drawText(s, 50, 50, -1, buffer, true);
|
// offset += font.drawText(style, "over the Lazy dog", 50+offset, y, -1, buffer, scale, true);
|
||||||
GLStateTracker tracker = GLStateTracker.instance();
|
// font.drawText(s, 50, 50, -1, buffer, true);
|
||||||
GL11.glClearColor(0.2F, 0.55F, 0.66F, 1F);
|
GLStateTracker tracker = GLStateTracker.instance();
|
||||||
while(!window.shouldClose()) {
|
GL11.glClearColor(0.2F, 0.55F, 0.66F, 1F);
|
||||||
GLFW.glfwPollEvents();
|
while(!window.shouldClose()) {
|
||||||
if(window.changed()) {
|
GLFW.glfwPollEvents();
|
||||||
window.updateViewport();
|
if(window.changed()) {
|
||||||
applyWindowSize(window);
|
window.updateViewport();
|
||||||
}
|
applyWindowSize(window);
|
||||||
|
}
|
||||||
window.beginFrame();
|
|
||||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
|
window.beginFrame();
|
||||||
texture.bind();
|
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
|
||||||
shaderTest.bind();
|
texture.bind();
|
||||||
model.bindArray();
|
shaderTest.bind();
|
||||||
GLStateTracker.drawArrays(GLMode.TRIANGLES.glValue(), 6);
|
model.bindArray();
|
||||||
model.unbindArray();
|
GLStateTracker.drawArrays(GLMode.TRIANGLES.glValue(), 6);
|
||||||
// guiModel[0].bindArray();
|
model.unbindArray();
|
||||||
// guiShader.bind();
|
// guiModel[0].bindArray();
|
||||||
// tracker.blend.enable();
|
// guiShader.bind();
|
||||||
// tracker.blend.setFunction(GLBlendFactor.SRC_ALPHA, GLBlendFactor.ONE_MINUS_SRC_ALPHA);
|
// tracker.blend.enable();
|
||||||
// for(GLDraw draw : draws) {
|
// tracker.blend.setFunction(GLBlendFactor.SRC_ALPHA, GLBlendFactor.ONE_MINUS_SRC_ALPHA);
|
||||||
// tracker.textures.bind(draw.texture());
|
// for(GLDraw draw : draws) {
|
||||||
// GLStateTracker.drawArrays(GLMode.TRIANGLES.glValue(), draw.startVertex(), draw.vertexCount());
|
// tracker.textures.bind(draw.texture());
|
||||||
// }
|
// GLStateTracker.drawArrays(GLMode.TRIANGLES.glValue(), draw.startVertex(), draw.vertexCount());
|
||||||
// GLStateTracker.instance().blend.disable();
|
// }
|
||||||
// guiModel[0].unbindArray();
|
// GLStateTracker.instance().blend.disable();
|
||||||
|
// guiModel[0].unbindArray();
|
||||||
window.handleInput();
|
|
||||||
window.finishFrame();
|
window.handleInput();
|
||||||
try { Thread.sleep(100); }
|
window.finishFrame();
|
||||||
catch(InterruptedException e) { e.printStackTrace(); }
|
try { Thread.sleep(100); }
|
||||||
}
|
catch(InterruptedException e) { e.printStackTrace(); }
|
||||||
window.destroy();
|
}
|
||||||
manager.destroy();
|
window.destroy();
|
||||||
}
|
manager.destroy();
|
||||||
|
}
|
||||||
public void drawSecondScreen(Window window) {
|
|
||||||
window.setupContext();
|
public void drawSecondScreen(Window window) {
|
||||||
assets.addListener(GLStateTracker.instance().shaders);
|
window.setupContext();
|
||||||
Shader<TestShader> secondShader = Shader.createAndRegister(TestShader::new);
|
assets.addListener(GLStateTracker.instance().shaders);
|
||||||
|
Shader<TestShader> secondShader = Shader.createAndRegister(TestShader::new);
|
||||||
guiShader.register();
|
|
||||||
window.visible(true);
|
guiShader.register();
|
||||||
GL11.glClearColor(0.4F, 0.55F, 0.36F, 1F);
|
window.visible(true);
|
||||||
int size = 512;
|
GL11.glClearColor(0.4F, 0.55F, 0.36F, 1F);
|
||||||
int half = size >> 1;
|
int size = 512;
|
||||||
int base = size >> 3;
|
int half = size >> 1;
|
||||||
|
int base = size >> 3;
|
||||||
DynamicTexture texture = new DynamicTexture(size, size, DynamicTexture.DEFAULT_PARAMETERS);
|
|
||||||
texture.fill(0, 0, size, size, -1);
|
DynamicTexture texture = new DynamicTexture(size, size, DynamicTexture.DEFAULT_PARAMETERS);
|
||||||
texture.fill(0, 0, half, half, 255, 0, 0, 255);
|
texture.fill(0, 0, size, size, -1);
|
||||||
texture.fill(half, 0, half, half, 0, 255, 0, 255);
|
texture.fill(0, 0, half, half, 255, 0, 0, 255);
|
||||||
texture.fill(half, half, half, half, 255, 0, 0, 255);
|
texture.fill(half, 0, half, half, 0, 255, 0, 255);
|
||||||
texture.fill(0, half, half, half, 0, 0, 255, 255);
|
texture.fill(half, half, half, half, 255, 0, 0, 255);
|
||||||
texture.process(true);
|
texture.fill(0, half, half, half, 0, 0, 255, 255);
|
||||||
|
texture.process(true);
|
||||||
VertexBuilder builder = new VertexBuilder(255);
|
|
||||||
builder.start(GLMode.TRIANGLES, VertexTypes.TESTING);
|
VertexBuilder builder = new VertexBuilder(255);
|
||||||
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
builder.start(GLMode.TRIANGLES, VertexTypes.TESTING);
|
||||||
builder.pos(0.5F, -0.5F, 0).tex(1F, 1F).rgba(-1).endVertex();
|
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
||||||
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
builder.pos(0.5F, -0.5F, 0).tex(1F, 1F).rgba(-1).endVertex();
|
||||||
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
||||||
builder.pos(-0.5F, 0.5F, 0).tex(0F, 0F).rgba(-1).endVertex();
|
builder.pos(0.5F, 0.5F, 0).tex(1F, 0F).rgba(-1).endVertex();
|
||||||
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
builder.pos(-0.5F, 0.5F, 0).tex(0F, 0F).rgba(-1).endVertex();
|
||||||
|
builder.pos(-0.5F, -0.5F, 0).tex(0F, 1F).rgba(-1).endVertex();
|
||||||
TestModel model = new TestModel(builder.getBytes());
|
|
||||||
while(!window.shouldClose()) {
|
TestModel model = new TestModel(builder.getBytes());
|
||||||
GLFW.glfwPollEvents();
|
while(!window.shouldClose()) {
|
||||||
if(window.changed()) {
|
GLFW.glfwPollEvents();
|
||||||
window.updateViewport();
|
if(window.changed()) {
|
||||||
applyWindowSize(window);
|
window.updateViewport();
|
||||||
}
|
applyWindowSize(window);
|
||||||
window.beginFrame();
|
}
|
||||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
|
window.beginFrame();
|
||||||
texture.bind();
|
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
|
||||||
secondShader.bind();
|
texture.bind();
|
||||||
model.bindArray();
|
secondShader.bind();
|
||||||
GLStateTracker.drawArrays(GLMode.TRIANGLES.glValue(), 6);
|
model.bindArray();
|
||||||
model.unbindArray();
|
GLStateTracker.drawArrays(GLMode.TRIANGLES.glValue(), 6);
|
||||||
|
model.unbindArray();
|
||||||
window.handleInput();
|
|
||||||
window.finishFrame();
|
window.handleInput();
|
||||||
try { Thread.sleep(100); }
|
window.finishFrame();
|
||||||
catch(InterruptedException e) { e.printStackTrace(); }
|
try { Thread.sleep(100); }
|
||||||
}
|
catch(InterruptedException e) { e.printStackTrace(); }
|
||||||
window.destroy();
|
}
|
||||||
}
|
window.destroy();
|
||||||
|
}
|
||||||
public static class TexturedBuffer implements Font.TexturedBuffer {
|
|
||||||
int previousId = -1;
|
public static class TexturedBuffer implements Font.TexturedBuffer {
|
||||||
int lastVertex = 0;
|
int previousId = -1;
|
||||||
List<GLDraw> draws = new ObjectArrayList<>();
|
int lastVertex = 0;
|
||||||
VertexBuilder builder;
|
List<GLDraw> draws = new ObjectArrayList<>();
|
||||||
BiConsumer<List<GLDraw>, byte[]> callbacks;
|
VertexBuilder builder;
|
||||||
|
BiConsumer<List<GLDraw>, byte[]> callbacks;
|
||||||
public TexturedBuffer(BiConsumer<List<GLDraw>, byte[]> callbacks) {
|
|
||||||
this.callbacks = callbacks;
|
public TexturedBuffer(BiConsumer<List<GLDraw>, byte[]> callbacks) {
|
||||||
}
|
this.callbacks = callbacks;
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public IVertexBuilder builderForTexture(int textureId) {
|
@Override
|
||||||
if(builder == null) {
|
public IVertexBuilder builderForTexture(int textureId) {
|
||||||
builder = new VertexBuilder(100000);
|
if(builder == null) {
|
||||||
builder.start(GLMode.TRIANGLES, VertexTypes.TESTING);
|
builder = new VertexBuilder(100000);
|
||||||
previousId = textureId;
|
builder.start(GLMode.TRIANGLES, VertexTypes.TESTING);
|
||||||
}
|
previousId = textureId;
|
||||||
else if(previousId != textureId) {
|
}
|
||||||
int count = builder.size() - lastVertex;
|
else if(previousId != textureId) {
|
||||||
draws.add(new GLDraw(previousId, lastVertex, count));
|
int count = builder.size() - lastVertex;
|
||||||
lastVertex+=count;
|
draws.add(new GLDraw(previousId, lastVertex, count));
|
||||||
previousId = textureId;
|
lastVertex+=count;
|
||||||
}
|
previousId = textureId;
|
||||||
return builder;
|
}
|
||||||
}
|
return builder;
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public void end() {
|
@Override
|
||||||
int count = builder.size() - lastVertex;
|
public void end() {
|
||||||
draws.add(new GLDraw(previousId, lastVertex, count));
|
int count = builder.size() - lastVertex;
|
||||||
callbacks.accept(draws, builder.getBytes());
|
draws.add(new GLDraw(previousId, lastVertex, count));
|
||||||
builder.close();
|
callbacks.accept(draws, builder.getBytes());
|
||||||
}
|
builder.close();
|
||||||
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
public static record GLDraw(int texture, int startVertex, int vertexCount) {
|
|
||||||
|
public static record GLDraw(int texture, int startVertex, int vertexCount) {
|
||||||
}
|
|
||||||
|
}
|
||||||
public static class GuiShader extends SimpleShader {
|
|
||||||
public TextureUniform texture = uniforms.addTexture("texture", 0);
|
public static class GuiShader extends SimpleShader {
|
||||||
public Matrix4fUniform proView = uniforms.addMat("proViewMatrix", new Matrix4f());
|
public TextureUniform texture = uniforms.addTexture("texture", 0);
|
||||||
|
public Matrix4fUniform proView = uniforms.addMat("proViewMatrix", new Matrix4f());
|
||||||
public GuiShader(IAssetProvider provider) {
|
|
||||||
super(provider, "gui_shader", AssetLocation.of("shader/testGui/vertex.vs"), AssetLocation.of("shader/testGui/fragment.fs"), "in_position", "in_tex", "in_color");
|
public GuiShader(IAssetProvider provider) {
|
||||||
}
|
super(provider, "gui_shader", AssetLocation.of("shader/testGui/vertex.vs"), AssetLocation.of("shader/testGui/fragment.fs"), "in_position", "in_tex", "in_color");
|
||||||
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
public static class TestShader extends SimpleShader {
|
|
||||||
public TextureUniform texture = uniforms.addTexture("texture", 0);
|
public static class TestShader extends SimpleShader {
|
||||||
public TestShader(IAssetProvider provider) {
|
public TextureUniform texture = uniforms.addTexture("texture", 0);
|
||||||
super(provider, "testing_shader", AssetLocation.of("shader/testing/vertex.vs"), AssetLocation.of("shader/testing/fragment.fs"), "in_position", "in_tex", "in_color");
|
public TestShader(IAssetProvider provider) {
|
||||||
}
|
super(provider, "testing_shader", AssetLocation.of("shader/testing/vertex.vs"), AssetLocation.of("shader/testing/fragment.fs"), "in_position", "in_tex", "in_color");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public static class TestModel extends VertexArray {
|
|
||||||
public TestModel(byte[] data) {
|
public static class TestModel extends VertexArray {
|
||||||
bind();
|
public TestModel(byte[] data) {
|
||||||
createBuffer(new BufferAttribute(0, 3), new BufferAttribute(1, 2), new BufferAttribute(2, 4, GLDataType.UNSIGNED_BYTE, true)).set(data).unbind();
|
bind();
|
||||||
unbind();
|
createBuffer(new BufferAttribute(0, 3), new BufferAttribute(1, 2), new BufferAttribute(2, 4, GLDataType.UNSIGNED_BYTE, true)).set(data).unbind();
|
||||||
}
|
unbind();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,182 +1,182 @@
|
|||||||
package speiger.src.coreengine.rendering.guiOld.helper.box;
|
package speiger.src.coreengine.rendering.guiOld.helper.box;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||||
import speiger.src.collections.objects.lists.ObjectList;
|
import speiger.src.collections.objects.lists.ObjectList;
|
||||||
|
|
||||||
public class GuiBox implements IGuiBox
|
public class GuiBox implements IGuiBox
|
||||||
{
|
{
|
||||||
ObjectList<IGuiBox> children = new ObjectArrayList<>();
|
ObjectList<IGuiBox> children = new ObjectArrayList<>();
|
||||||
IGuiBox parent;
|
IGuiBox parent;
|
||||||
|
|
||||||
float minX;
|
float minX;
|
||||||
float minY;
|
float minY;
|
||||||
float maxX;
|
float maxX;
|
||||||
float maxY;
|
float maxY;
|
||||||
|
|
||||||
float width;
|
float width;
|
||||||
float height;
|
float height;
|
||||||
float scale = 1F;
|
float scale = 1F;
|
||||||
|
|
||||||
float baseX;
|
float baseX;
|
||||||
float baseY;
|
float baseY;
|
||||||
float baseWidth;
|
float baseWidth;
|
||||||
float baseHeight;
|
float baseHeight;
|
||||||
float baseScale = 1F;
|
float baseScale = 1F;
|
||||||
|
|
||||||
|
|
||||||
protected GuiBox() {}
|
protected GuiBox() {}
|
||||||
|
|
||||||
public GuiBox(float x, float y, float width, float height) {
|
public GuiBox(float x, float y, float width, float height) {
|
||||||
set(x, y, width, height);
|
set(x, y, width, height);
|
||||||
onChanged();
|
onChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IGuiBox clone(IGuiBox box) {
|
public static IGuiBox clone(IGuiBox box) {
|
||||||
return new GuiBox(box.getMinX(), box.getMinY(), box.getWidth(), box.getHeight());
|
return new GuiBox(box.getMinX(), box.getMinY(), box.getWidth(), box.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IGuiBox clonePadded(IGuiBox box, float padding) {
|
public static IGuiBox clonePadded(IGuiBox box, float padding) {
|
||||||
return new GuiBox(box.getMinX() + padding, box.getMinY() + padding, box.getWidth() - padding * 2F, box.getHeight() - padding * 2F);
|
return new GuiBox(box.getMinX() + padding, box.getMinY() + padding, box.getWidth() - padding * 2F, box.getHeight() - padding * 2F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox addChild(IGuiBox box) {
|
public IGuiBox addChild(IGuiBox box) {
|
||||||
children.add(box);
|
children.add(box);
|
||||||
box.setParent(this);
|
box.setParent(this);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox removeChild(IGuiBox box) {
|
public IGuiBox removeChild(IGuiBox box) {
|
||||||
if(children.remove(box)) box.setParent(null);
|
if(children.remove(box)) box.setParent(null);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox clearChildren() {
|
public IGuiBox clearChildren() {
|
||||||
for(int i = 0,m=children.size();i<m;i++) {
|
for(int i = 0,m=children.size();i<m;i++) {
|
||||||
children.get(i).setParent(null);
|
children.get(i).setParent(null);
|
||||||
}
|
}
|
||||||
children.clear();
|
children.clear();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<IGuiBox> children() {
|
public List<IGuiBox> children() {
|
||||||
return children.unmodifiable();
|
return children.unmodifiable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox onChanged() {
|
public IGuiBox onChanged() {
|
||||||
minX = parent == null ? baseX : parent.getMinX(baseX);
|
minX = parent == null ? baseX : parent.getMinX(baseX);
|
||||||
minY = parent == null ? baseY : parent.getMinY(baseY);
|
minY = parent == null ? baseY : parent.getMinY(baseY);
|
||||||
maxX = parent == null ? baseX + width : parent.getMinX(baseX + width);
|
maxX = parent == null ? baseX + width : parent.getMinX(baseX + width);
|
||||||
maxY = parent == null ? baseY + height : parent.getMinY(baseY + height);
|
maxY = parent == null ? baseY + height : parent.getMinY(baseY + height);
|
||||||
scale = parent == null ? baseScale : parent.getScale() * baseScale;
|
scale = parent == null ? baseScale : parent.getScale() * baseScale;
|
||||||
for(int i = 0,m=children.size();i<m;i++) {
|
for(int i = 0,m=children.size();i<m;i++) {
|
||||||
children.get(i).onChanged();
|
children.get(i).onChanged();
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox setParent(IGuiBox box) {
|
public IGuiBox setParent(IGuiBox box) {
|
||||||
parent = box;
|
parent = box;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox getParent() { return parent; }
|
public IGuiBox getParent() { return parent; }
|
||||||
@Override
|
@Override
|
||||||
public float getScale() { return scale; }
|
public float getScale() { return scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getBaseX() { return baseX; }
|
public float getBaseX() { return baseX; }
|
||||||
@Override
|
@Override
|
||||||
public float getBaseY() { return baseY; }
|
public float getBaseY() { return baseY; }
|
||||||
@Override
|
@Override
|
||||||
public float getRelativeX() { return parent != null ? baseX : 0F; }
|
public float getRelativeX() { return parent != null ? baseX : 0F; }
|
||||||
@Override
|
@Override
|
||||||
public float getRelativeY() { return parent != null ? baseY : 0F; }
|
public float getRelativeY() { return parent != null ? baseY : 0F; }
|
||||||
@Override
|
@Override
|
||||||
public float getWidth() { return baseWidth * scale; }
|
public float getWidth() { return baseWidth * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getWidth(float extra) { return baseWidth * scale + extra * baseScale; }
|
public float getWidth(float extra) { return baseWidth * scale + extra * baseScale; }
|
||||||
@Override
|
@Override
|
||||||
public float getHeight() { return baseHeight * scale; }
|
public float getHeight() { return baseHeight * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getHeight(float extra) { return baseHeight * scale + extra * baseScale; }
|
public float getHeight(float extra) { return baseHeight * scale + extra * baseScale; }
|
||||||
@Override
|
@Override
|
||||||
public float getMinX() { return minX; }
|
public float getMinX() { return minX; }
|
||||||
@Override
|
@Override
|
||||||
public float getMinX(float extra) { return minX + extra * scale; }
|
public float getMinX(float extra) { return minX + extra * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getMinY() { return minY; }
|
public float getMinY() { return minY; }
|
||||||
@Override
|
@Override
|
||||||
public float getMinY(float extra) { return minY + extra * scale; }
|
public float getMinY(float extra) { return minY + extra * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getMaxX() { return maxX; }
|
public float getMaxX() { return maxX; }
|
||||||
@Override
|
@Override
|
||||||
public float getMaxX(float extra) { return maxX + extra * scale; }
|
public float getMaxX(float extra) { return maxX + extra * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getMaxY() { return maxY; }
|
public float getMaxY() { return maxY; }
|
||||||
@Override
|
@Override
|
||||||
public float getMaxY(float extra) { return maxY + extra * scale; }
|
public float getMaxY(float extra) { return maxY + extra * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getCenterX() { return minX + (maxX - minX) * 0.5F; }
|
public float getCenterX() { return minX + (maxX - minX) * 0.5F; }
|
||||||
@Override
|
@Override
|
||||||
public float getCenterX(float extra) { return minX + (maxX - minX) * 0.5F + extra * scale; }
|
public float getCenterX(float extra) { return minX + (maxX - minX) * 0.5F + extra * scale; }
|
||||||
@Override
|
@Override
|
||||||
public float getCenterY() { return minY + (maxY - minY) * 0.5F; }
|
public float getCenterY() { return minY + (maxY - minY) * 0.5F; }
|
||||||
@Override
|
@Override
|
||||||
public float getCenterY(float extra) { return minY + (maxY - minY) * 0.5F + extra * scale; }
|
public float getCenterY(float extra) { return minY + (maxY - minY) * 0.5F + extra * scale; }
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox setX(float x) {
|
public IGuiBox setX(float x) {
|
||||||
baseX = x;
|
baseX = x;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox setY(float y) {
|
public IGuiBox setY(float y) {
|
||||||
baseY = y;
|
baseY = y;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox setWidth(float width) {
|
public IGuiBox setWidth(float width) {
|
||||||
baseWidth = width;
|
baseWidth = width;
|
||||||
this.width = baseWidth * baseScale;
|
this.width = baseWidth * baseScale;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox setHeight(float height) {
|
public IGuiBox setHeight(float height) {
|
||||||
baseHeight = height;
|
baseHeight = height;
|
||||||
this.height = baseHeight * baseScale;
|
this.height = baseHeight * baseScale;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox setScale(float scale) {
|
public IGuiBox setScale(float scale) {
|
||||||
baseScale = scale;
|
baseScale = scale;
|
||||||
width = baseWidth * baseScale;
|
width = baseWidth * baseScale;
|
||||||
height = baseHeight * baseScale;
|
height = baseHeight * baseScale;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox move(float xOffset, float yOffset) { return setXY(baseX + xOffset, baseY + yOffset); }
|
public IGuiBox move(float xOffset, float yOffset) { return setXY(baseX + xOffset, baseY + yOffset); }
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox resize(float xGrowth, float yGrowth) { return setBounds(baseWidth + xGrowth, baseHeight + yGrowth); }
|
public IGuiBox resize(float xGrowth, float yGrowth) { return setBounds(baseWidth + xGrowth, baseHeight + yGrowth); }
|
||||||
@Override
|
@Override
|
||||||
public IGuiBox scale(float scale) { return setScale(scale * baseScale); }
|
public IGuiBox scale(float scale) { return setScale(scale * baseScale); }
|
||||||
@Override
|
@Override
|
||||||
public float getBaseScale() { return baseScale; }
|
public float getBaseScale() { return baseScale; }
|
||||||
@Override
|
@Override
|
||||||
public float getBaseWidth() { return baseWidth; }
|
public float getBaseWidth() { return baseWidth; }
|
||||||
@Override
|
@Override
|
||||||
public float getBaseHeight() { return baseHeight; }
|
public float getBaseHeight() { return baseHeight; }
|
||||||
@Override
|
@Override
|
||||||
public String toString() { return "GuiBox[minX="+minX+", minY="+minY+", maxX="+maxX+", maxY="+maxY+", width="+width+", height="+height+"]"; }
|
public String toString() { return "GuiBox[minX="+minX+", minY="+minY+", maxX="+maxX+", maxY="+maxY+", width="+width+", height="+height+"]"; }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user