Add renderer and render info settings
Some checks failed
build-and-test / build (push) Has been cancelled
build-and-test / test (push) Has been cancelled
build-and-test / generate-javadoc (push) Has been cancelled

This commit is contained in:
JeremyStar™ 2024-12-01 20:09:36 +01:00
parent 91b2ab7a22
commit 3450ba3fb0
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
9 changed files with 247 additions and 70 deletions

View file

@ -25,7 +25,6 @@ import de.staropensource.engine.base.implementable.Event;
import de.staropensource.engine.base.implementable.SubsystemClass; import de.staropensource.engine.base.implementable.SubsystemClass;
import de.staropensource.engine.base.implementable.helper.EventHelper; import de.staropensource.engine.base.implementable.helper.EventHelper;
import de.staropensource.engine.base.logging.Logger; import de.staropensource.engine.base.logging.Logger;
import de.staropensource.engine.base.utility.misc.NumberUtil;
import de.staropensource.engine.base.utility.information.EngineInformation; import de.staropensource.engine.base.utility.information.EngineInformation;
import de.staropensource.engine.base.implementation.versioning.StarOpenSourceVersioningSystem; import de.staropensource.engine.base.implementation.versioning.StarOpenSourceVersioningSystem;
import de.staropensource.engine.base.event.InternalEngineShutdownEvent; import de.staropensource.engine.base.event.InternalEngineShutdownEvent;
@ -36,18 +35,13 @@ import de.staropensource.engine.rendering.event.RenderingErrorEvent;
import de.staropensource.engine.rendering.exception.NotOnMainThreadException; import de.staropensource.engine.rendering.exception.NotOnMainThreadException;
import de.staropensource.engine.rendering.renderer.Renderer; import de.staropensource.engine.rendering.renderer.Renderer;
import de.staropensource.engine.rendering.type.Window; import de.staropensource.engine.rendering.type.Window;
import de.staropensource.engine.rendering.type.window.RenderingPlatform; import de.staropensource.engine.rendering.type.window.Platform;
import de.staropensource.engine.rendering.type.window.VsyncMode;
import lombok.Getter; import lombok.Getter;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.*; import org.lwjgl.glfw.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.concurrent.atomic.AtomicReference;
import static org.lwjgl.glfw.GLFW.*; import static org.lwjgl.glfw.GLFW.*;
@ -160,10 +154,10 @@ public final class RenderingSubsystem extends SubsystemClass {
Logger.diag("Setting initialization hints"); Logger.diag("Setting initialization hints");
switch (RenderingSubsystemConfiguration.getInstance().getInitialPlatform()) { switch (RenderingSubsystemConfiguration.getInstance().getInitialPlatform()) {
case ANY -> glfwInitHint(GLFW_PLATFORM, GLFW_ANY_PLATFORM); case ANY -> glfwInitHint(GLFW_PLATFORM, GLFW_ANY_PLATFORM);
case WAYLAND -> tryPlatform(GLFW_PLATFORM_WAYLAND, RenderingPlatform.WAYLAND); case WAYLAND -> tryPlatform(GLFW_PLATFORM_WAYLAND, Platform.WAYLAND);
case X11 -> tryPlatform(GLFW_PLATFORM_X11, RenderingPlatform.X11); case X11 -> tryPlatform(GLFW_PLATFORM_X11, Platform.X11);
case WIN32 -> tryPlatform(GLFW_PLATFORM_WIN32, RenderingPlatform.WIN32); case WIN32 -> tryPlatform(GLFW_PLATFORM_WIN32, Platform.WIN32);
case COCOA -> tryPlatform(GLFW_PLATFORM_COCOA, RenderingPlatform.COCOA); case COCOA -> tryPlatform(GLFW_PLATFORM_COCOA, Platform.COCOA);
case NONE -> glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_NULL); case NONE -> glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_NULL);
} }
glfwInitHint(GLFW_WAYLAND_LIBDECOR, RenderingSubsystemConfiguration.getInstance().isInitialDisableLibdecor() ? GLFW_WAYLAND_DISABLE_LIBDECOR : GLFW_WAYLAND_PREFER_LIBDECOR); glfwInitHint(GLFW_WAYLAND_LIBDECOR, RenderingSubsystemConfiguration.getInstance().isInitialDisableLibdecor() ? GLFW_WAYLAND_DISABLE_LIBDECOR : GLFW_WAYLAND_PREFER_LIBDECOR);
@ -220,20 +214,20 @@ public final class RenderingSubsystem extends SubsystemClass {
* and if so, specifies it as the platform to use. * and if so, specifies it as the platform to use.
* *
* @param platform platform to try * @param platform platform to try
* @param renderingPlatform {@link RenderingPlatform} used to log that the platform is unsupported (set to {@code null} to disable) * @param renderingPlatform {@link Platform} used to log that the platform is unsupported (set to {@code null} to disable)
* @since v1-alpha9 * @since v1-alpha9
*/ */
private void tryPlatform(int platform, @Nullable RenderingPlatform renderingPlatform) { private void tryPlatform(int platform, @Nullable Platform renderingPlatform) {
if (glfwPlatformSupported(platform)) if (glfwPlatformSupported(platform))
if (platform != GLFW_PLATFORM_WAYLAND) if (platform != GLFW_PLATFORM_WAYLAND)
glfwInitHint(GLFW_PLATFORM, platform); glfwInitHint(GLFW_PLATFORM, platform);
else { else {
Logger.warn("Wayland is not supported by the StarOpenSource Engine due to various issues with it, sorry."); Logger.warn("Wayland is not supported by the StarOpenSource Engine due to various issues with it, sorry.");
tryPlatform(GLFW_PLATFORM_X11, RenderingPlatform.X11); tryPlatform(GLFW_PLATFORM_X11, Platform.X11);
} }
else { else {
if (renderingPlatform != null) if (renderingPlatform != null)
Logger.warn("Platform RenderingPlatform." + renderingPlatform.name() + " is not supported GLFW. Using RenderingPlatform.ANY instead"); Logger.warn("Platform Platform." + renderingPlatform.name() + " is not supported GLFW. Using Platform.ANY instead");
glfwInitHint(GLFW_PLATFORM, GLFW_ANY_PLATFORM); glfwInitHint(GLFW_PLATFORM, GLFW_ANY_PLATFORM);
} }
} }

View file

@ -23,8 +23,9 @@ import de.staropensource.engine.base.implementable.Configuration;
import de.staropensource.engine.base.logging.Logger; import de.staropensource.engine.base.logging.Logger;
import de.staropensource.engine.base.utility.PropertiesReader; import de.staropensource.engine.base.utility.PropertiesReader;
import de.staropensource.engine.rendering.event.RenderingErrorEvent; import de.staropensource.engine.rendering.event.RenderingErrorEvent;
import de.staropensource.engine.rendering.type.window.RenderingAdapter; import de.staropensource.engine.rendering.type.window.Adapter;
import de.staropensource.engine.rendering.type.window.RenderingPlatform; import de.staropensource.engine.rendering.type.window.Platform;
import de.staropensource.engine.rendering.type.window.Renderer;
import de.staropensource.engine.rendering.type.window.VsyncMode; import de.staropensource.engine.rendering.type.window.VsyncMode;
import lombok.Getter; import lombok.Getter;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -124,6 +125,20 @@ public final class RenderingSubsystemConfiguration extends Configuration {
*/ */
private boolean debugWindowStates; private boolean debugWindowStates;
/**
* Contains if rendering information
* shall be visible on every window.
*
* @since v1-alpha0
* -- GETTER --
* Returns if rendering information
* shall be visible on every window.
*
* @return display rendering information?
* @since v1-alpha0
*/
private boolean debugRenderInfo;
/** /**
* Contains if to allow updates to a window's * Contains if to allow updates to a window's
* position. May cause errors and crashes to * position. May cause errors and crashes to
@ -151,20 +166,44 @@ public final class RenderingSubsystemConfiguration extends Configuration {
* @return GLFW platform * @return GLFW platform
* @since v1-alpha9 * @since v1-alpha9
*/ */
private RenderingPlatform initialPlatform; private Platform initialPlatform;
/**
* Contains the adapter bgfx shall use.
*
* @since v1-alpha9
* -- GETTER --
* Returns the adapter bgfx shall use.
*
* @return bgfx adapter
* @since v1-alpha9
*/
private Adapter initialAdapter;
/**
* Contains the renderer bgfx shall use.
*
* @since v1-alpha9
* -- GETTER --
* Returns the renderer bgfx shall use.
*
* @return bgfx renderer
* @since v1-alpha9
*/
private Renderer initialRenderer;
/** /**
* Contains whether or not to disable support for * Contains whether or not to disable support for
* <a href="https://gitlab.freedesktop.org/libdecor/libdecor">libdecor</a>. * <a href="https://gitlab.freedesktop.org/libdecor/libdecor">libdecor</a>.
* <p> * <p>
* Only affects the {@link RenderingPlatform#WAYLAND} platform. * Only affects the {@link Platform#WAYLAND} platform.
* *
* @since v1-alpha9 * @since v1-alpha9
* -- GETTER -- * -- GETTER --
* Returns whether or not to disable support for * Returns whether or not to disable support for
* <a href="https://gitlab.freedesktop.org/libdecor/libdecor">libdecor</a>. * <a href="https://gitlab.freedesktop.org/libdecor/libdecor">libdecor</a>.
* <p> * <p>
* Only affects the {@link RenderingPlatform#WAYLAND} platform. * Only affects the {@link Platform#WAYLAND} platform.
* *
* @return libdecor support disabled? * @return libdecor support disabled?
* @since v1-alpha9 * @since v1-alpha9
@ -197,18 +236,6 @@ public final class RenderingSubsystemConfiguration extends Configuration {
private boolean errorRenderingFailures; private boolean errorRenderingFailures;
/**
* Contains the adapter bgfx shall use.
*
* @since v1-alpha9
* -- GETTER --
* Returns the adapter bgfx shall use.
*
* @return bgfx adapter
* @since v1-alpha9
*/
private RenderingAdapter renderingAdapter;
/** /**
* Contains which {@link VsyncMode} to use. * Contains which {@link VsyncMode} to use.
* <p> * <p>
@ -279,26 +306,34 @@ public final class RenderingSubsystemConfiguration extends Configuration {
case "debugInput" -> debugInput = parser.getBoolean(group + property); case "debugInput" -> debugInput = parser.getBoolean(group + property);
case "debugFrames" -> debugFrames = parser.getBoolean(group + property); case "debugFrames" -> debugFrames = parser.getBoolean(group + property);
case "debugWindowStates" -> debugWindowStates = parser.getBoolean(group + property); case "debugWindowStates" -> debugWindowStates = parser.getBoolean(group + property);
case "debugRenderInfo" -> debugRenderInfo = parser.getBoolean(group + property);
case "debugAllowPositionUpdates" -> debugAllowPositionUpdates = parser.getBoolean(group + property); case "debugAllowPositionUpdates" -> debugAllowPositionUpdates = parser.getBoolean(group + property);
case "initialPlatform" -> { case "initialPlatform" -> {
try { try {
initialPlatform = RenderingPlatform.valueOf(parser.getString(group + property).toUpperCase()); initialPlatform = Platform.valueOf(parser.getString(group + property).toUpperCase());
} catch (IllegalArgumentException ignored) { } catch (IllegalArgumentException ignored) {
Logger.error("Rendering platform " + parser.getString(group + property) + " is not valid"); Logger.error("Platform '" + parser.getString(group + property) + "' is not valid");
}
}
case "initialAdapter" -> {
try {
initialAdapter = Adapter.valueOf(parser.getString(group + property).toUpperCase());
} catch (IllegalArgumentException exception) {
Logger.error("Adapter '" + parser.getString(group + property) + "' is not valid");
}
}
case "initialRenderer" -> {
try {
initialRenderer = Renderer.valueOf(parser.getString(group + property).toUpperCase());
} catch (IllegalArgumentException exception) {
Logger.error("Renderer '" + parser.getString(group + property) + "' is not valid");
} }
} }
case "initialDisableLibdecor" -> initialDisableLibdecor = parser.getBoolean(group + property); case "initialDisableLibdecor" -> initialDisableLibdecor = parser.getBoolean(group + property);
case "errorRenderingFailures" -> errorRenderingFailures = parser.getBoolean(group + property); case "errorRenderingFailures" -> errorRenderingFailures = parser.getBoolean(group + property);
case "renderingAdapter" -> {
try {
renderingAdapter = RenderingAdapter.valueOf(parser.getString(group + property).toUpperCase());
} catch (IllegalArgumentException exception) {
Logger.error("Rendering adapter " + parser.getString(group + property) + " is not valid");
}
}
case "vsyncMode" -> { case "vsyncMode" -> {
try { try {
vsyncMode = VsyncMode.valueOf(parser.getString(group + property).toUpperCase()); vsyncMode = VsyncMode.valueOf(parser.getString(group + property).toUpperCase());
@ -318,6 +353,7 @@ public final class RenderingSubsystemConfiguration extends Configuration {
debugInput = false; debugInput = false;
debugFrames = false; debugFrames = false;
debugWindowStates = false; debugWindowStates = false;
debugRenderInfo = false;
debugAllowPositionUpdates = false; debugAllowPositionUpdates = false;
} }
} }
@ -327,17 +363,19 @@ public final class RenderingSubsystemConfiguration extends Configuration {
public void loadDefaultConfiguration() { public void loadDefaultConfiguration() {
debug = true; debug = true;
debugInput = false; debugInput = false;
debugFrames = true; debugFrames = false;
debugWindowStates = true; debugWindowStates = false;
debugRenderInfo = true;
debugAllowPositionUpdates = false; debugAllowPositionUpdates = false;
initialPlatform = RenderingPlatform.ANY; initialPlatform = Platform.ANY;
initialAdapter = Adapter.ANY;
initialRenderer = Renderer.ANY;
initialDisableLibdecor = false; initialDisableLibdecor = false;
errorRenderingFailures = true; errorRenderingFailures = true;
renderingAdapter = RenderingAdapter.ANY; vsyncMode = VsyncMode.ON;
vsyncMode = VsyncMode.OFF;
maximumFramesPerSecond = 60; maximumFramesPerSecond = 60;
} }
@ -349,14 +387,16 @@ public final class RenderingSubsystemConfiguration extends Configuration {
case "debugInput" -> { return debugInput; } case "debugInput" -> { return debugInput; }
case "debugFrames" -> { return debugFrames; } case "debugFrames" -> { return debugFrames; }
case "debugWindowStates" -> { return debugWindowStates; } case "debugWindowStates" -> { return debugWindowStates; }
case "debugRenderInfo" -> { return debugRenderInfo; }
case "debugAllowPositionUpdates" -> { return debugAllowPositionUpdates; } case "debugAllowPositionUpdates" -> { return debugAllowPositionUpdates; }
case "initialPlatform" -> { return initialPlatform; } case "initialPlatform" -> { return initialPlatform; }
case "initialAdapter" -> { return initialAdapter; }
case "initialRenderer" -> { return initialRenderer; }
case "disableLibdecor" -> { return initialDisableLibdecor; } case "disableLibdecor" -> { return initialDisableLibdecor; }
case "errorRenderingFailures" -> { return errorRenderingFailures; } case "errorRenderingFailures" -> { return errorRenderingFailures; }
case "renderingAdapter" -> { return renderingAdapter; }
case "vsyncMode" -> { return vsyncMode; } case "vsyncMode" -> { return vsyncMode; }
case "maximumFramesPerSecond" -> { return maximumFramesPerSecond; } case "maximumFramesPerSecond" -> { return maximumFramesPerSecond; }
default -> { return null; } default -> { return null; }

View file

@ -31,7 +31,7 @@ import org.jetbrains.annotations.NotNull;
*/ */
@Getter @Getter
@SuppressWarnings({ "JavadocDeclaration" }) @SuppressWarnings({ "JavadocDeclaration" })
public class WindowCallback { public abstract class WindowCallback {
/** /**
* Refers to the {@link Window} instance * Refers to the {@link Window} instance
* this callback is tied to. * this callback is tied to.

View file

@ -28,6 +28,7 @@ import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.lwjgl.bgfx.BGFXInit;
import java.time.LocalTime; import java.time.LocalTime;
import java.util.*; import java.util.*;
@ -252,22 +253,20 @@ public final class Renderer {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void run() { public void run() {
int offset = 7; if (RenderingSubsystemConfiguration.getInstance().isDebugRenderInfo()) {
bgfx_dbg_text_printf(0, 0, 0x0f, "Time: " + NumberUtil.padNumbers(LocalTime.now().getHour(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getMinute(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getSecond(), 2));
bgfx_dbg_text_printf(0, 1, 0x0f, "Frames: " + Renderer.getFrameCount());
bgfx_dbg_text_printf(0, 2, 0x0f, "Frames/s: " + Renderer.getFramesPerSecond());
bgfx_dbg_text_printf(0, 3, 0x0f, "Delta: " + Renderer.getDeltaTime() + "s");
bgfx_dbg_text_printf(0, 4, 0x0f, "V-Sync mode: " + RenderingSubsystemConfiguration.getInstance().getVsyncMode().name());
bgfx_dbg_text_printf(0, 6, 0x0f, "Rendering time:");
bgfx_dbg_text_clear(0, false); int offset = 7;
bgfx_dbg_text_printf(0, 0, 0x0f, "Time: " + NumberUtil.padNumbers(LocalTime.now().getHour(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getMinute(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getSecond(), 2)); for (String item : lastFrameTime.keySet()) {
bgfx_dbg_text_printf(0, 1, 0x0f, "Frames: " + Renderer.getFrameCount()); bgfx_dbg_text_printf(0, offset, 0x0f, item + ": " + lastFrameTime.get(item) + "ms");
bgfx_dbg_text_printf(0, 2, 0x0f, "Frames/s: " + Renderer.getFramesPerSecond()); offset += 1;
bgfx_dbg_text_printf(0, 3, 0x0f, "Delta: " + Renderer.getDeltaTime() + "s"); }
bgfx_dbg_text_printf(0, 4, 0x0f, "V-Sync mode: " + RenderingSubsystemConfiguration.getInstance().getVsyncMode().name());
bgfx_dbg_text_printf(0, 6, 0x0f, "Rendering time:");
for (String item : lastFrameTime.keySet()) {
bgfx_dbg_text_printf(0, offset, 0x0f, item + ": " + lastFrameTime.get(item) + "ms");
offset += 1;
} }
try {
Thread.sleep(0);
} catch (InterruptedException ignored) {}
} }
}); });
@ -344,6 +343,7 @@ public final class Renderer {
@SuppressWarnings({ "InfiniteLoopStatement" }) @SuppressWarnings({ "InfiniteLoopStatement" })
private static void render() { private static void render() {
while (true) { while (true) {
RenderingCode.resetFrame();
RenderingCode.invokeFrameHandlers(); RenderingCode.invokeFrameHandlers();
RenderingCode.renderWindows(); RenderingCode.renderWindows();
RenderingCode.waitForNextFrame(); RenderingCode.waitForNextFrame();

View file

@ -103,6 +103,15 @@ final class RenderingCode {
private static long timesPSO = System.currentTimeMillis() + 1000; private static long timesPSO = System.currentTimeMillis() + 1000;
/**
* Resets all frame data.
*
* @since v1-alpha9
*/
public static void resetFrame() {
bgfx_dbg_text_clear(0, false);
}
/** /**
* Invokes all frame handlers. * Invokes all frame handlers.
* *
@ -145,11 +154,15 @@ final class RenderingCode {
*/ */
private static void resetBackBuffer() { private static void resetBackBuffer() {
int resetSettings = 0; int resetSettings = 0;
if (RenderingSubsystemConfiguration.getInstance().getVsyncMode() == VsyncMode.ON) if (RenderingSubsystemConfiguration.getInstance().getVsyncMode() == VsyncMode.ON)
resetSettings |= BGFX_RESET_TRANSPARENT_BACKBUFFER; resetSettings |= BGFX_RESET_TRANSPARENT_BACKBUFFER;
for (Window window : Window.getWindows()) for (Window window : Window.getWindows())
if (window.isTransparent()) if (window.isTransparent()) {
resetSettings |= BGFX_RESET_TRANSPARENT_BACKBUFFER; resetSettings |= BGFX_RESET_TRANSPARENT_BACKBUFFER;
break;
}
bgfx_reset( bgfx_reset(
Window.getWindows().getFirst().getSize().getX(), Window.getWindows().getFirst().getSize().getX(),

View file

@ -43,6 +43,7 @@ import org.lwjgl.system.MemoryStack;
import java.io.Closeable; import java.io.Closeable;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.*; import java.util.*;
@ -453,8 +454,7 @@ public final class Window implements Closeable {
updateState(); updateState();
// Initialize bgfx // Initialize bgfx
if (glfwGetPlatform() != GLFW_PLATFORM_NULL) initializeBgfx();
initializeBgfx();
// Declare window as ready // Declare window as ready
windows.add(this); windows.add(this);
@ -536,9 +536,26 @@ public final class Window implements Closeable {
BGFXInit init = BGFXInit.calloc(stack); BGFXInit init = BGFXInit.calloc(stack);
bgfx_init_ctor(init); bgfx_init_ctor(init);
// Set renderer
if (glfwGetPlatform() == GLFW_PLATFORM_NULL)
init.type(BGFX_RENDERER_TYPE_NOOP);
else
switch (RenderingSubsystemConfiguration.getInstance().getInitialRenderer()) {
case ANY -> {}
case AGC -> init.type(BGFX_RENDERER_TYPE_AGC);
case DIRECT3D_11 -> init.type(BGFX_RENDERER_TYPE_DIRECT3D11);
case DIRECT3D_12 -> init.type(BGFX_RENDERER_TYPE_DIRECT3D12);
case GNM -> init.type(BGFX_RENDERER_TYPE_GNM);
case METAL -> init.type(BGFX_RENDERER_TYPE_METAL);
case NVM -> init.type(BGFX_RENDERER_TYPE_NVN);
case OPENGL -> init.type(BGFX_RENDERER_TYPE_OPENGL);
case OPENGL_ES -> init.type(BGFX_RENDERER_TYPE_OPENGLES);
case VULKAN -> init.type(BGFX_RENDERER_TYPE_VULKAN);
}
// Set adapter // Set adapter
Logger.diag("Setting adapter"); Logger.diag("Setting adapter");
init.vendorId(switch (RenderingSubsystemConfiguration.getInstance().getRenderingAdapter()) { init.vendorId(switch (RenderingSubsystemConfiguration.getInstance().getInitialAdapter()) {
case ANY -> BGFX_PCI_ID_NONE; case ANY -> BGFX_PCI_ID_NONE;
case SOFTWARE -> BGFX_PCI_ID_SOFTWARE_RASTERIZER; case SOFTWARE -> BGFX_PCI_ID_SOFTWARE_RASTERIZER;
case AMD -> BGFX_PCI_ID_AMD; case AMD -> BGFX_PCI_ID_AMD;
@ -812,6 +829,22 @@ public final class Window implements Closeable {
return glfwWindowShouldClose(internalWindowIdentifier); return glfwWindowShouldClose(internalWindowIdentifier);
} }
/**
* Returns the position of the cursor.
*
* @return cursor position inside the window
* @since v1-alpha9
*/
public @NotNull Vec2i getCursorPosition() {
try (MemoryStack stack = stackPush()) {
DoubleBuffer x = stack.mallocDouble(1);
DoubleBuffer y = stack.mallocDouble(1);
glfwGetCursorPos(internalWindowIdentifier, x, y);
return new Vec2i((int) x.get(), (int) y.get());
}
}
/** /**
* Sets the name of this window. * Sets the name of this window.
* <p> * <p>

View file

@ -20,11 +20,11 @@
package de.staropensource.engine.rendering.type.window; package de.staropensource.engine.rendering.type.window;
/** /**
* Represents all available rendering adapters. * Represents all available adapters.
* *
* @since v1-alpha9 * @since v1-alpha9
*/ */
public enum RenderingAdapter { public enum Adapter {
/** /**
* Allows the bgfx to autodetect the adapter to use. * Allows the bgfx to autodetect the adapter to use.
* *

View file

@ -20,11 +20,11 @@
package de.staropensource.engine.rendering.type.window; package de.staropensource.engine.rendering.type.window;
/** /**
* Represents all available rendering platforms. * Represents all available platforms.
* *
* @since v1-alpha9 * @since v1-alpha9
*/ */
public enum RenderingPlatform { public enum Platform {
/** /**
* Allows GLFW to autodetect the platform to use. * Allows GLFW to autodetect the platform to use.
* *

View file

@ -0,0 +1,97 @@
/*
* STAROPENSOURCE ENGINE SOURCE FILE
* Copyright (c) 2024 The StarOpenSource Engine Authors
* Licensed under the GNU Affero General Public License v3
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.staropensource.engine.rendering.type.window;
/**
* Represents all available renderers.
*
* @since v1-alpha9
*/
public enum Renderer {
/**
* Allows the bgfx to autodetect the renderer to use.
*
* @since v1-alpha9
*/
ANY,
/**
* Tells bgfx to use AGC for rendering.
*
* @since v1-alpha9
*/
AGC,
/**
* Tells bgfx to use Direct 3D 11 for rendering.
*
* @since v1-alpha9
*/
DIRECT3D_11,
/**
* Tells bgfx to use Direct 3D 12 for rendering.
*
* @since v1-alpha9
*/
DIRECT3D_12,
/**
* Tells bgfx to use GNM for rendering.
*
* @since v1-alpha9
*/
GNM,
/**
* Tells bgfx to use Metal for rendering.
*
* @since v1-alpha9
*/
METAL,
/**
* Tells bgfx to use NVM for rendering.
*
* @since v1-alpha9
*/
NVM,
/**
* Tells bgfx to use OpenGL for rendering.
*
* @since v1-alpha9
*/
OPENGL,
/**
* Tells bgfx to use OpenGL ES for rendering.
*
* @since v1-alpha9
*/
OPENGL_ES,
/**
* Tells bgfx to use Vulkan for rendering.
*
* @since v1-alpha9
*/
VULKAN,
}