Class VulkanGLFWRenderModuleConfig
- All Implemented Interfaces:
ModuleConfig
config/vulkan-glfw-render-module.config.
One key, requestedImages, which decides how many swap chain images to ask for. More
images allow more frames in flight at the cost of latency and memory; the surface's supported
range is the final say.
-
Constructor Summary
ConstructorsConstructorDescriptionVulkanGLFWRenderModuleConfig(Logger logger) Creates a configuration that reports load problems to the given logger. -
Method Summary
Modifier and TypeMethodDescriptionintReturns how many swap chain images to ask for.booleanisDirty()Returns whether this configuration differs from what is on disk.load()Reads this configuration from disk, substituting defaults for anything missing or invalid.voidsave()Writes this configuration to disk, creatingconfig/if it does not exist.
-
Constructor Details
-
VulkanGLFWRenderModuleConfig
Creates a configuration that reports load problems to the given logger.- Parameters:
logger- the logger to warn through when a key is missing or invalid
-
-
Method Details
-
getRequestedImages
public int getRequestedImages()Returns how many swap chain images to ask for.A request, not a guarantee: the surface's supported range wins.
- Returns:
- the requested swap chain image count
-
load
Description copied from interface:ModuleConfigReads this configuration from disk, substituting defaults for anything missing or invalid.An absent file is not an error. For each key that is missing or fails to parse, an implementation logs a warning identifying the key and the accepted range, substitutes the documented default, and sets the dirty flag.
- Specified by:
loadin interfaceModuleConfig- Returns:
- this configuration, so that construction and loading compose
- Throws:
IOException- if the file exists but cannot be read
-
save
Description copied from interface:ModuleConfigWrites this configuration to disk, creatingconfig/if it does not exist.Every known key is written, not only those that changed, so that a user who deletes the file gets a complete one back on the next run. The dirty flag is cleared on success.
- Specified by:
savein interfaceModuleConfig- Throws:
IOException- if the directory cannot be created or the file cannot be written
-
isDirty
public boolean isDirty()Description copied from interface:ModuleConfigReturns whether this configuration differs from what is on disk.Set whenever the in-memory state diverges from the file.
ModuleConfig.load()substituting a default for a missing or unparseable key is the usual cause, but any later change to a value counts equally.ModuleConfig.save()clears it, since writing the file makes the two agree again.- Specified by:
isDirtyin interfaceModuleConfig- Returns:
trueif the file does not match this configuration and should be rewritten
-