aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
diff options
context:
space:
mode:
authorFalsePattern <me@falsepattern.com>2023-12-01 13:29:09 +0100
committermakamys <makamys@outlook.com>2023-12-01 18:34:00 +0100
commit68357a8cc9c8cf9eab9e177cb6aea18cfbc3f584 (patch)
tree932dd32510e56db5320cc616f0db052defaf7d3a /src/main/java/makamys/neodymium/renderer/NeoRenderer.java
parentfbe408c777dcf6ea5d2d784b739287d6db2bf52c (diff)
downloadNeodymium-68357a8cc9c8cf9eab9e177cb6aea18cfbc3f584.tar.gz
Neodymium-68357a8cc9c8cf9eab9e177cb6aea18cfbc3f584.tar.bz2
Neodymium-68357a8cc9c8cf9eab9e177cb6aea18cfbc3f584.zip
unify stride calculation into NeoRenderer
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index 61dac28..048fc7a 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -22,6 +22,7 @@ import java.util.Map.Entry;
import java.util.Set;
import makamys.neodymium.renderer.attribs.AttributeSet;
+import makamys.neodymium.util.BufferWriter;
import org.lwjgl.BufferUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@@ -378,7 +379,10 @@ public class NeoRenderer {
}
private AttributeSet attributes;
-
+
+ /**
+ * @implSpec The attributes here need to be kept in sync with {@link MeshQuad#writeToBuffer(BufferWriter)}
+ */
public boolean init() {
// The average mesh is 60 KB. Let's be safe and assume 8 KB per mesh.
// This means 1 MB of index data per 512 MB of VRAM.
@@ -417,6 +421,10 @@ public class NeoRenderer {
return true;
}
+
+ public int getStride() {
+ return attributes.stride();
+ }
public void reloadShader(int pass, AttributeSet attributeSet) {
for(int hasFog = 0; hasFog <= 1; hasFog++) {