Class GraphicsConfig
java.lang.Object
dev.engine.graphics.GraphicsConfig
- Direct Known Subclasses:
GraphicsConfigLegacy, OpenGlConfig, VulkanConfig, WebGpuConfig
Base class for graphics backend configuration. Each backend extends this
with backend-specific settings while inheriting common configuration.
Common settings apply across all backends. Backend-specific subclasses
add their own settings (present mode for Vulkan, etc.) and implement
createDevice(WindowHandle) to construct the appropriate render device.
// OpenGL with defaults
var gfx = new OpenGlConfig(toolkit, glBindings);
// Vulkan with specific settings
var gfx = VulkanConfig.builder(toolkit, vkBindings, surfaceCreator)
.presentMode(VulkanConfig.PresentMode.MAILBOX)
.validation(true)
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal GraphicsBackendcreate(WindowDescriptor window) Creates the complete backend infrastructure: window + render device.protected abstract RenderDevicecreateDevice(WindowHandle window) Creates the backend-specific render device for the given window.booleanheadless()Whether this is a headless (offscreen) configuration.headless(boolean headless) floatMaximum anisotropic filtering level (1 = disabled).maxAnisotropy(float aniso) intMSAA sample count (1 = disabled, 2/4/8 = multisampled).msaaSamples(int samples) The present mode (vsync behavior).presentMode(PresentMode presentMode) booleansrgb()Whether to use sRGB framebuffer.srgb(boolean srgb) toolkit()The window toolkit used for window creation.booleanWhether to enable backend validation layers (Vulkan validation, WebGPU error reporting).validation(boolean validation)
-
Constructor Details
-
GraphicsConfig
-
-
Method Details
-
toolkit
The window toolkit used for window creation. -
headless
public boolean headless()Whether this is a headless (offscreen) configuration. -
validation
public boolean validation()Whether to enable backend validation layers (Vulkan validation, WebGPU error reporting). -
presentMode
The present mode (vsync behavior). -
msaaSamples
public int msaaSamples()MSAA sample count (1 = disabled, 2/4/8 = multisampled). -
srgb
public boolean srgb()Whether to use sRGB framebuffer. -
maxAnisotropy
public float maxAnisotropy()Maximum anisotropic filtering level (1 = disabled). -
headless
-
validation
-
presentMode
-
msaaSamples
-
srgb
-
maxAnisotropy
-
create
Creates the complete backend infrastructure: window + render device. Called by the engine during initialization. -
createDevice
Creates the backend-specific render device for the given window. Implemented by each backend config.
-