Class VulkanGLFWRenderModuleWindow
java.lang.Object
io.codetoil.curved_spacetime.render.RenderModuleWindow
io.codetoil.curved_spacetime.render.glfw.GLFWRenderModuleWindow
io.codetoil.curved_spacetime.render.vulkan_glfw.VulkanGLFWRenderModuleWindow
A GLFW window configured for Vulkan rather than OpenGL.
Supplies the two API-specific pieces GLFWRenderModuleWindow leaves open: checking that a
Vulkan driver is present, and setting GLFW_CLIENT_API to GLFW_NO_API so GLFW does
not create an OpenGL context for a window Vulkan will render into.
-
Field Summary
Fields inherited from class GLFWRenderModuleWindow
height, initialized, width, windowHandleFields inherited from class RenderModuleWindow
logger, mainModuleEngine, renderModuleKeyboardInput, renderModuleMouseInput, shouldClose, title -
Constructor Summary
ConstructorsConstructorDescriptionVulkanGLFWRenderModuleWindow(MainModuleEngine mainModuleEngine, String title, Logger logger) Creates a Vulkan-capable GLFW window. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether a driver for the subclass's graphics API is present.protected voidApplies the GLFW window hints the subclass's graphics API requires.protected voidFails with a message naming the graphics API that could not be found.Methods inherited from class GLFWRenderModuleWindow
clean, getHeight, getWidth, getWindowHandle, init, isInitialized, loop, setShouldClose, shouldCloseMethods inherited from class RenderModuleWindow
getKeyboardInput, getMouseInput, pollEvents, resetInput
-
Constructor Details
-
VulkanGLFWRenderModuleWindow
Creates a Vulkan-capable GLFW window.Nothing is opened until
GLFWRenderModuleWindow.init()is called.- Parameters:
mainModuleEngine- the engine this window belongs totitle- the window's title bar textlogger- the logger to write window diagnostics to
-
-
Method Details
-
doesDriverExist
public boolean doesDriverExist()Description copied from class:GLFWRenderModuleWindowReturns whether a driver for the subclass's graphics API is present.Checked during
GLFWRenderModuleWindow.init(), before the window is created, so that an unusable environment is reported before any resource is acquired.- Specified by:
doesDriverExistin classGLFWRenderModuleWindow- Returns:
trueif the graphics API can be used on this machine
-
throwDriverNotFoundException
protected void throwDriverNotFoundException()Description copied from class:GLFWRenderModuleWindowFails with a message naming the graphics API that could not be found.Called when
GLFWRenderModuleWindow.doesDriverExist()returnsfalse; implementations are expected to throw rather than return.- Specified by:
throwDriverNotFoundExceptionin classGLFWRenderModuleWindow
-
setWindowHints
protected void setWindowHints()Description copied from class:GLFWRenderModuleWindowApplies the GLFW window hints the subclass's graphics API requires.Called before the window is created. A Vulkan implementation, for example, sets
GLFW_CLIENT_APItoGLFW_NO_APIso GLFW does not create an OpenGL context.- Specified by:
setWindowHintsin classGLFWRenderModuleWindow
-