latest state

This commit is contained in:
Speiger 2024-08-15 18:28:39 +02:00
parent 96d3c5b345
commit a1453f0a6c
5 changed files with 20 additions and 6 deletions

View File

@ -136,6 +136,9 @@ public class NewInputTest {
} }
}); });
} }
else if(T.key() == GLFW.GLFW_KEY_O && T.press()) {
window.borderless(!window.isBorderless());
}
}); });
VertexBuilder builder = new VertexBuilder(255); VertexBuilder builder = new VertexBuilder(255);

View File

@ -0,0 +1,7 @@
package speiger.src.coreengine.rendering.gui.font;
public class FontCache {
float size;
}

View File

@ -5,8 +5,8 @@ import speiger.src.coreengine.rendering.gui.font.FontTexture;
import speiger.src.coreengine.rendering.textures.custom.Drawable; import speiger.src.coreengine.rendering.textures.custom.Drawable;
public class MissingGlyth implements UnbakedGlyth { public class MissingGlyth implements UnbakedGlyth {
private static final int WIDTH = 10; private static final int WIDTH = 15;
private static final int HEIGHT = 57; private static final int HEIGHT = 28;
float size; float size;
float oversample; float oversample;
float advance; float advance;
@ -21,7 +21,7 @@ public class MissingGlyth implements UnbakedGlyth {
this.scale = (size * oversample) / HEIGHT; this.scale = (size * oversample) / HEIGHT;
this.advance = WIDTH * (size / HEIGHT); this.advance = WIDTH * (size / HEIGHT);
this.width = (int)(WIDTH * scale); this.width = (int)(WIDTH * scale);
this.height = (int)(HEIGHT * scale); this.height = (int)(HEIGHT * scale * 0.5F);
} }
public void cleanCache() { public void cleanCache() {
@ -41,8 +41,12 @@ public class MissingGlyth implements UnbakedGlyth {
@Override @Override
public int height() { return height; } public int height() { return height; }
@Override @Override
public float yOffset() {
return -height * 0.5F;
}
@Override
public void upload(int texture, int x, int y) { public void upload(int texture, int x, int y) {
Drawable drawable = new Drawable(FontTexture.formatByColor(false), width, height); Drawable drawable = new Drawable(FontTexture.formatByColor(false), width, (int)(height));
draw(drawable); draw(drawable);
drawable.upload(texture, x, y, 0, 0, width, height); drawable.upload(texture, x, y, 0, 0, width, height);
drawable.close(); drawable.close();

View File

@ -22,7 +22,7 @@ public class FileDrop extends AbstractDevice<Void, DropTask> {
} }
private void drop(long windowId, int count, long names) { private void drop(long windowId, int count, long names) {
List<Path> paths = new ObjectArrayList<>(); List<Path> paths = new ObjectArrayList<>(count);
for(int i = 0;i<count;i++) { for(int i = 0;i<count;i++) {
Path path = Path.of(GLFWDropCallback.getName(names, i)); Path path = Path.of(GLFWDropCallback.getName(names, i));
if(Files.notExists(path)) continue; if(Files.notExists(path)) continue;

View File

@ -4,7 +4,7 @@
"file": "font/roboto/Roboto-Medium.ttf", "file": "font/roboto/Roboto-Medium.ttf",
"oversample": 3, "oversample": 3,
"shadowOffset": 1, "shadowOffset": 1,
"skip": "", "skip": "s",
"offset": { "x": 0, "y": 0 } "offset": { "x": 0, "y": 0 }
} }
} }