Package com.jme3.system.lwjgl
Class LwjglWindow
java.lang.Object
com.jme3.system.lwjgl.LwjglContext
com.jme3.system.lwjgl.LwjglWindow
- All Implemented Interfaces:
- JmeContext,- Runnable
- Direct Known Subclasses:
- LwjglOffscreenBufferVR
A wrapper class over the GLFW framework in LWJGL 3.
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.jme3.system.JmeContextJmeContext.Type
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected final AtomicBooleanprotected final AtomicBooleanprotected booleanFields inherited from class com.jme3.system.lwjgl.LwjglContextclContext, clPlatform, created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, THREAD_NAME, timer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreate(boolean waitFor) Creates the context and makes it active.protected voidcreateContext(AppSettings settings) Apply the settings, changing resolution, etc.protected voidDe-initialize in the OpenGL thread.voiddestroy(boolean waitFor) Destroys the context completely, making it inactive.protected voidDestroy the context.intReturns the height of the framebuffer.intReturns the width of the framebuffer.getType()getWindowContentScale(Vector2f store) Get the window content scale, for HiDPI support.longintReturns the screen X coordinate of the left edge of the content area.intReturns the screen Y coordinate of the top edge of the content area.protected booleanDoes LWJGL display initialization in the OpenGL threadvoidregisterWindowSizeListener(WindowSizeListener listener) Registers the specified listener to get notified when window size changes.voidremoveWindowSizeListener(WindowSizeListener listener) Removes the specified listener from the listeners list.voidrestart()Restart if it's a windowed or full-screen display.voidrun()protected voidrunLoop()execute one iteration of the render loop in the OpenGL threadvoidsetAutoFlushFrames(boolean enabled) voidSet the title if it's a windowed displayprotected voidsetWindowIcon(AppSettings settings) Set custom icons to the window of this application.protected voidMethods inherited from class com.jme3.system.lwjgl.LwjglContextcreate, createContextAttribs, destroy, determineMaxSamples, getGLVersion, getNumSamplesToUse, getOpenCLContext, getRenderer, getSettings, getSystemListener, getTimer, initContextFirstTime, initOpenCL, internalCreate, internalDestroy, isCreated, isRenderable, loadNatives, printContextInitInfo, reinitContext, setSettings, setSystemListener, waitFor
- 
Field Details- 
needClose
- 
needRestart
- 
wasActiveprotected boolean wasActive
- 
autoFlushprotected boolean autoFlush
- 
allowSwapBuffersprotected boolean allowSwapBuffers
 
- 
- 
Constructor Details- 
LwjglWindow
 
- 
- 
Method Details- 
registerWindowSizeListenerRegisters the specified listener to get notified when window size changes.- Parameters:
- listener- The WindowSizeListener to register.
 
- 
removeWindowSizeListenerRemoves the specified listener from the listeners list.- Parameters:
- listener- The WindowSizeListener to remove.
 
- 
getType- Specified by:
- getTypein interface- JmeContext
- Returns:
- Type.Display or Type.Canvas
 
- 
setTitleSet the title if it's a windowed display- Specified by:
- setTitlein interface- JmeContext
- Parameters:
- title- the title to set
 
- 
restartpublic void restart()Restart if it's a windowed or full-screen display.- Specified by:
- restartin interface- JmeContext
 
- 
createContextApply the settings, changing resolution, etc.- Parameters:
- settings- the settings to apply when creating the context.
 
- 
showWindowprotected void showWindow()
- 
setWindowIconSet custom icons to the window of this application.- Parameters:
- settings- settings for getting the icons
 
- 
destroyContextprotected void destroyContext()Destroy the context.
- 
createpublic void create(boolean waitFor) Description copied from interface:JmeContextCreates the context and makes it active.- Specified by:
- createin interface- JmeContext
- Parameters:
- waitFor- If true, will wait until context has initialized.
 
- 
initInThreadprotected boolean initInThread()Does LWJGL display initialization in the OpenGL thread- Returns:
- returns trueif the context initialization was successful
 
- 
runLoopprotected void runLoop()execute one iteration of the render loop in the OpenGL thread
- 
deinitInThreadprotected void deinitInThread()De-initialize in the OpenGL thread.
- 
runpublic void run()
- 
getJoyInput- Specified by:
- getJoyInputin interface- JmeContext
- Returns:
- Joystick input implementation. May be null if not available.
 
- 
getMouseInput- Specified by:
- getMouseInputin interface- JmeContext
- Returns:
- Mouse input implementation. May be null if not available.
 
- 
getKeyInput- Specified by:
- getKeyInputin interface- JmeContext
- Returns:
- Keyboard input implementation. May be null if not available.
 
- 
getTouchInput- Specified by:
- getTouchInputin interface- JmeContext
- Returns:
- Touch device input implementation. May be null if not available.
 
- 
setAutoFlushFramespublic void setAutoFlushFrames(boolean enabled) - Specified by:
- setAutoFlushFramesin interface- JmeContext
- Parameters:
- enabled- If enabled, the context will automatically flush frames to the video card (swap buffers) after an update cycle.
 
- 
destroypublic void destroy(boolean waitFor) Description copied from interface:JmeContextDestroys the context completely, making it inactive.- Specified by:
- destroyin interface- JmeContext
- Parameters:
- waitFor- If true, will wait until the context is destroyed fully.
 
- 
getWindowHandlepublic long getWindowHandle()
- 
getWindowContentScaleGet the window content scale, for HiDPI support. The content scale is the ratio between the current DPI and the platform's default DPI. This is especially important for text and any UI elements. If the pixel dimensions of your UI scaled by this look appropriate on your machine then it should appear at a reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system DPI and scaling settings being somewhat correct.- Parameters:
- store- A vector2f to store the result
- Returns:
- The window content scale
- See Also:
 
- 
getFramebufferHeightpublic int getFramebufferHeight()Returns the height of the framebuffer.- Specified by:
- getFramebufferHeightin interface- JmeContext
- Overrides:
- getFramebufferHeightin class- LwjglContext
- Returns:
- the height (in pixels)
 
- 
getFramebufferWidthpublic int getFramebufferWidth()Returns the width of the framebuffer.- Specified by:
- getFramebufferWidthin interface- JmeContext
- Overrides:
- getFramebufferWidthin class- LwjglContext
- Returns:
- the width (in pixels)
 
- 
getWindowXPositionpublic int getWindowXPosition()Returns the screen X coordinate of the left edge of the content area.- Specified by:
- getWindowXPositionin interface- JmeContext
- Overrides:
- getWindowXPositionin class- LwjglContext
- Returns:
- the screen X coordinate
 
- 
getWindowYPositionpublic int getWindowYPosition()Returns the screen Y coordinate of the top edge of the content area.- Specified by:
- getWindowYPositionin interface- JmeContext
- Overrides:
- getWindowYPositionin class- LwjglContext
- Returns:
- the screen Y coordinate
 
 
-