Package com.jme3.system.lwjgl
Class LwjglWindowVR
java.lang.Object
com.jme3.system.lwjgl.LwjglContextVR
com.jme3.system.lwjgl.LwjglWindowVR
- All Implemented Interfaces:
JmeContext,Runnable
- Direct Known Subclasses:
LwjglDisplayVR
A wrapper class over the GLFW framework in LWJGL 3.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jme3.system.JmeContext
JmeContext.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected AtomicBooleanprotected final AtomicBooleanprotected booleanFields inherited from class com.jme3.system.lwjgl.LwjglContextVR
created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, THREAD_NAME, timer -
Constructor Summary
ConstructorsConstructorDescriptionLwjglWindowVR(JmeContext.Type type) Create a new wrapper class over the GLFW framework in LWJGL 3. -
Method Summary
Modifier 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()longGet the window handle.intReturns 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 threadvoidrestart()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 displayMethods inherited from class com.jme3.system.lwjgl.LwjglContextVR
create, destroy, determineMaxSamples, getNumSamplesToUse, getRenderer, getSettings, getSystemListener, getTimer, initContextFirstTime, internalCreate, internalDestroy, isCreated, isRenderable, isRetinaDisplay, loadNatives, printContextInitInfo, setSettings, setSystemListener, waitForMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.system.JmeContext
getOpenCLContext
-
Field Details
-
needClose
-
needRestart
-
wasActive
protected boolean wasActive -
autoFlush
protected boolean autoFlush -
allowSwapBuffers
protected boolean allowSwapBuffers
-
-
Constructor Details
-
LwjglWindowVR
Create a new wrapper class over the GLFW framework in LWJGL 3.- Parameters:
type- thetypeof the display.
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceJmeContext- Returns:
- Type.Display or Type.Canvas
-
setTitle
Set the title if it's a windowed display- Specified by:
setTitlein interfaceJmeContext- Parameters:
title- the title to set
-
restart
public void restart()Restart if it's a windowed or full-screen display.- Specified by:
restartin interfaceJmeContext
-
createContext
Apply the settings, changing resolution, etc.- Parameters:
settings- the settings to apply when creating the context.
-
destroyContext
protected void destroyContext()Destroy the context. -
create
public void create(boolean waitFor) Description copied from interface:JmeContextCreates the context and makes it active.- Specified by:
createin interfaceJmeContext- Parameters:
waitFor- If true, will wait until context has initialized.
-
initInThread
protected boolean initInThread()Does LWJGL display initialization in the OpenGL thread -
runLoop
protected void runLoop()execute one iteration of the render loop in the OpenGL thread -
deinitInThread
protected void deinitInThread()De-initialize in the OpenGL thread. -
run
public void run() -
getJoyInput
- Specified by:
getJoyInputin interfaceJmeContext- Returns:
- Joystick input implementation. May be null if not available.
-
getMouseInput
- Specified by:
getMouseInputin interfaceJmeContext- Returns:
- Mouse input implementation. May be null if not available.
-
getKeyInput
- Specified by:
getKeyInputin interfaceJmeContext- Returns:
- Keyboard input implementation. May be null if not available.
-
getTouchInput
- Specified by:
getTouchInputin interfaceJmeContext- Returns:
- Touch device input implementation. May be null if not available.
-
setAutoFlushFrames
public void setAutoFlushFrames(boolean enabled) - Specified by:
setAutoFlushFramesin interfaceJmeContext- Parameters:
enabled- If enabled, the context will automatically flush frames to the video card (swap buffers) after an update cycle.
-
destroy
public void destroy(boolean waitFor) Description copied from interface:JmeContextDestroys the context completely, making it inactive.- Specified by:
destroyin interfaceJmeContext- Parameters:
waitFor- If true, will wait until the context is destroyed fully.
-
getWindowHandle
public long getWindowHandle()Get the window handle.- Returns:
- the window handle as an internal GLFW identifier.
-
getFramebufferHeight
public int getFramebufferHeight()Returns the height of the framebuffer.- Specified by:
getFramebufferHeightin interfaceJmeContext- Returns:
- the height (in pixels)
-
getFramebufferWidth
public int getFramebufferWidth()Returns the width of the framebuffer.- Specified by:
getFramebufferWidthin interfaceJmeContext- Returns:
- the width (in pixels)
-
getWindowXPosition
public int getWindowXPosition()Returns the screen X coordinate of the left edge of the content area.- Specified by:
getWindowXPositionin interfaceJmeContext- Returns:
- the screen X coordinate
-
getWindowYPosition
public int getWindowYPosition()Returns the screen Y coordinate of the top edge of the content area.- Specified by:
getWindowYPositionin interfaceJmeContext- Returns:
- the screen Y coordinate
-