public abstract class LwjglWindow extends LwjglContext implements java.lang.Runnable
JmeContext.Type| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowSwapBuffers |
protected boolean |
autoFlush |
protected java.util.concurrent.atomic.AtomicBoolean |
needClose |
protected java.util.concurrent.atomic.AtomicBoolean |
needRestart |
protected boolean |
wasActive |
clContext, clPlatform, created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, THREAD_NAME, timer| Constructor and Description |
|---|
LwjglWindow(JmeContext.Type type) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(boolean waitFor)
Creates the context and makes it active.
|
protected void |
createContext(AppSettings settings)
Apply the settings, changing resolution, etc.
|
protected void |
deinitInThread()
De-initialize in the OpenGL thread.
|
void |
destroy(boolean waitFor)
Destroys the context completely, making it inactive.
|
protected void |
destroyContext()
Destroy the context.
|
int |
getFramebufferHeight()
Returns the height of the framebuffer.
|
int |
getFramebufferWidth()
Returns the width of the framebuffer.
|
JoyInput |
getJoyInput() |
KeyInput |
getKeyInput() |
MouseInput |
getMouseInput() |
TouchInput |
getTouchInput() |
JmeContext.Type |
getType() |
Vector2f |
getWindowContentScale(Vector2f store)
Get the window content scale, for HiDPI support.
|
long |
getWindowHandle() |
int |
getWindowXPosition()
Returns the screen X coordinate of the left edge of the content area.
|
int |
getWindowYPosition()
Returns the screen Y coordinate of the top edge of the content area.
|
protected boolean |
initInThread()
Does LWJGL display initialization in the OpenGL thread
|
void |
registerWindowSizeListener(WindowSizeListener listener)
Registers the specified listener to get notified when window size changes.
|
void |
removeWindowSizeListener(WindowSizeListener listener)
Removes the specified listener from the listeners list.
|
void |
restart()
Restart if it's a windowed or full-screen display.
|
void |
run() |
protected void |
runLoop()
execute one iteration of the render loop in the OpenGL thread
|
void |
setAutoFlushFrames(boolean enabled) |
void |
setTitle(java.lang.String title)
Set the title if it's a windowed display
|
protected void |
setWindowIcon(AppSettings settings)
Set custom icons to the window of this application.
|
protected void |
showWindow() |
create, createContextAttribs, destroy, determineMaxSamples, getGLVersion, getNumSamplesToUse, getOpenCLContext, getRenderer, getSettings, getSystemListener, getTimer, initContextFirstTime, initOpenCL, internalCreate, internalDestroy, isCreated, isRenderable, loadNatives, printContextInitInfo, reinitContext, setSettings, setSystemListener, waitForprotected final java.util.concurrent.atomic.AtomicBoolean needClose
protected final java.util.concurrent.atomic.AtomicBoolean needRestart
protected boolean wasActive
protected boolean autoFlush
protected boolean allowSwapBuffers
public LwjglWindow(JmeContext.Type type)
public void registerWindowSizeListener(WindowSizeListener listener)
listener - The WindowSizeListener to register.public void removeWindowSizeListener(WindowSizeListener listener)
listener - The WindowSizeListener to remove.public JmeContext.Type getType()
getType in interface JmeContextpublic void setTitle(java.lang.String title)
setTitle in interface JmeContexttitle - the title to setpublic void restart()
restart in interface JmeContextprotected void createContext(AppSettings settings)
settings - the settings to apply when creating the context.protected void showWindow()
protected void setWindowIcon(AppSettings settings)
settings - settings for getting the iconsprotected void destroyContext()
public void create(boolean waitFor)
JmeContextcreate in interface JmeContextwaitFor - If true, will wait until context has initialized.protected boolean initInThread()
true if the context initialization was successfulprotected void runLoop()
protected void deinitInThread()
public void run()
run in interface java.lang.Runnablepublic JoyInput getJoyInput()
getJoyInput in interface JmeContextpublic MouseInput getMouseInput()
getMouseInput in interface JmeContextpublic KeyInput getKeyInput()
getKeyInput in interface JmeContextpublic TouchInput getTouchInput()
getTouchInput in interface JmeContextpublic void setAutoFlushFrames(boolean enabled)
setAutoFlushFrames in interface JmeContextenabled - If enabled, the context will automatically flush
frames to the video card (swap buffers) after an update cycle.public void destroy(boolean waitFor)
JmeContextdestroy in interface JmeContextwaitFor - If true, will wait until the context is destroyed fully.public long getWindowHandle()
public Vector2f getWindowContentScale(Vector2f store)
store - A vector2f to store the resultpublic int getFramebufferHeight()
getFramebufferHeight in interface JmeContextgetFramebufferHeight in class LwjglContextpublic int getFramebufferWidth()
getFramebufferWidth in interface JmeContextgetFramebufferWidth in class LwjglContextpublic int getWindowXPosition()
getWindowXPosition in interface JmeContextgetWindowXPosition in class LwjglContextpublic int getWindowYPosition()
getWindowYPosition in interface JmeContextgetWindowYPosition in class LwjglContext