public abstract class DisplayInterface
extends java.lang.Object
implements java.io.Closeable
Display manager interface.
This class provides interface for switching between text and graphics display modes. It also provides interface for opening graphics framebuffer.
Modifier and Type | Field and Description |
---|---|
protected JavaFramebuffer |
fbInstance |
Constructor and Description |
---|
DisplayInterface() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeFramebuffer()
Close the internal framebuffer.
|
protected void |
initializeFramebuffer(NativeFramebuffer backend,
boolean enable)
Initialize new internal instance of JavaFramebuffer.
|
abstract JavaFramebuffer |
openFramebuffer()
Get the framebuffer for the system display.
|
void |
releaseFramebuffer(JavaFramebuffer fb)
Remove all references to this framebuffer.
|
abstract void |
switchToGraphicsMode()
Switch the display to a graphics mode.
|
abstract void |
switchToTextMode()
Switch the display to a text mode.
|
protected JavaFramebuffer fbInstance
public abstract void switchToGraphicsMode()
Switch the display to a graphics mode.
java.lang.RuntimeException
- when the switch failspublic abstract void switchToTextMode()
Switch the display to a text mode.
java.lang.RuntimeException
- when the switch failspublic abstract JavaFramebuffer openFramebuffer()
Get the framebuffer for the system display.
The framebuffer is initialized only once, later calls return references to the same instance.
java.lang.RuntimeException
- when switch to graphics mode or the framebuffer initialization fails.public void releaseFramebuffer(JavaFramebuffer fb)
Remove all references to this framebuffer.
fb
- Framebuffer to remove.protected void closeFramebuffer()
protected void initializeFramebuffer(NativeFramebuffer backend, boolean enable)
backend
- Device behind JavaFramebuffer.enable
- Whether to enable framebuffer flushing from the beginning.