APIdia Launch Partner
Top Inners Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl3

public Class Lwjgl3Graphics

extends AbstractGraphics
implements Disposable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.utils.Disposable
Imports
java.nio.IntBuffer, com.badlogic.gdx.AbstractGraphics, .Application, com.badlogic.gdx.math.GridPoint2, com.badlogic.gdx.utils.GdxRuntimeException, .Disposable, org.lwjgl.BufferUtils, .PointerBuffer, org.lwjgl.glfw.GLFW, .GLFWFramebufferSizeCallback, com.badlogic.gdx.graphics.Cursor, .Cursor.SystemCursor, .GL20, .GL30, .GL31, .GL32, .Pixmap, com.badlogic.gdx.graphics.glutils.GLVersion, .HdpiMode, org.lwjgl.opengl.GL11, org.lwjgl.system.Configuration

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private volatile int
private volatile int
private Graphics.BufferFormat
private float
private Graphics.DisplayMode
private int
private long
private long
private int
pack-priv GL20
private GL30
private GL31
private GL32
private GLVersion
private volatile boolean
private long
private volatile int
private volatile int
private boolean
pack-priv GLFWFramebufferSizeCallback
pack-priv IntBuffer
pack-priv IntBuffer
pack-priv final Lwjgl3Window
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

public void
enableCubeMapSeamless(boolean enable)

Enable or disable cubemap seamless feature.

public int
public int
public Graphics.BufferFormat
public float
public Graphics.DisplayMode
public Graphics.DisplayMode
public Graphics.DisplayMode[]
public Graphics.DisplayMode[]
public long
getFrameId()

Implements com.badlogic.gdx.Graphics.getFrameId.

Returns the id of the current frame.

public int
public GL20
public GL30
public GL31
public GL32
public GLVersion
public int
public int
public int
public Graphics.Monitor
public Graphics.Monitor[]
public float
public float
public float
public float
public Graphics.Monitor
public int
public int
public int
public int
public Graphics.GraphicsType
public int
public Lwjgl3Window
private void
public boolean
public boolean
isFullscreen()

Implements com.badlogic.gdx.Graphics.isFullscreen.

Whether the app is fullscreen or not

public boolean
isGL30Available()

Implements com.badlogic.gdx.Graphics.isGL30Available.

Returns whether OpenGL ES 3.0 is available.

public boolean
isGL31Available()

Implements com.badlogic.gdx.Graphics.isGL31Available.

Returns whether OpenGL ES 3.1 is available.

public boolean
isGL32Available()

Implements com.badlogic.gdx.Graphics.isGL32Available.

Returns whether OpenGL ES 3.2 is available.

public Cursor
newCursor(Pixmap pixmap, int xHotspot, int yHotspot)

Implements com.badlogic.gdx.Graphics.newCursor.

Create a new cursor represented by the com.badlogic.gdx.graphics.Pixmap.

public void
requestRendering()

Implements com.badlogic.gdx.Graphics.requestRendering.

Requests a new frame to be rendered if the rendering mode is non-continuous.

public void
public void
setContinuousRendering(boolean isContinuous)

Implements com.badlogic.gdx.Graphics.setContinuousRendering.

Sets whether to render continuously.

public void
setCursor(Cursor cursor)

Implements com.badlogic.gdx.Graphics.setCursor.

Only viable on the lwjgl-backend and on the gwt-backend.

public void
setForegroundFPS(int
fps
fps
)

Implements com.badlogic.gdx.Graphics.setForegroundFPS.

Sets the target framerate for the application, when using continuous rendering.

public boolean
setFullscreenMode(Graphics.DisplayMode displayMode)

Implements com.badlogic.gdx.Graphics.setFullscreenMode.

Sets the window to full-screen mode.

public void
setGL20(GL20 gl20)

Implements com.badlogic.gdx.Graphics.setGL20.

Set the GL20 instance

public void
setGL30(GL30 gl30)

Implements com.badlogic.gdx.Graphics.setGL30.

Set the GL30 instance

public void
setGL31(GL31 gl31)

Implements com.badlogic.gdx.Graphics.setGL31.

Set the GL31 instance

public void
setGL32(GL32 gl32)

Implements com.badlogic.gdx.Graphics.setGL32.

Set the GL32 instance

public void
setResizable(boolean resizable)

Implements com.badlogic.gdx.Graphics.setResizable.

Sets whether or not the window should be resizable.

public void
setSystemCursor(Cursor.SystemCursor systemCursor)

Implements com.badlogic.gdx.Graphics.setSystemCursor.

Sets one of the predefined SystemCursors

public void
setTitle(String title)

Implements com.badlogic.gdx.Graphics.setTitle.

Sets the title of the window.

public void
setUndecorated(boolean undecorated)

Implements com.badlogic.gdx.Graphics.setUndecorated.

Sets the window decoration as enabled or disabled.

public void
setVSync(boolean vsync)

Implements com.badlogic.gdx.Graphics.setVSync.

Enable/Disable vsynching.

public boolean
setWindowedMode(int width, int height)

Implements com.badlogic.gdx.Graphics.setWindowedMode.

Sets the window to windowed mode.

private void
public boolean
supportsCubeMapSeamless()

Returns: whether cubemap seamless feature is supported.

public boolean
supportsDisplayModeChange()

Implements com.badlogic.gdx.Graphics.supportsDisplayModeChange.

Whether the given backend supports a display mode change via calling Graphics#setFullscreenMode(DisplayMode)

public boolean
pack-priv void
pack-priv void
Inherited from com.badlogic.gdx.AbstractGraphics:
getBackBufferScalegetDensitygetRawDeltaTime

Field Detail

backBufferHeightback to summary
private volatile int backBufferHeight
backBufferWidthback to summary
private volatile int backBufferWidth
bufferFormatback to summary
private Graphics.BufferFormat bufferFormat
deltaTimeback to summary
private float deltaTime
displayModeBeforeFullscreenback to summary
private Graphics.DisplayMode displayModeBeforeFullscreen
fpsback to summary
private int fps
frameCounterStartback to summary
private long frameCounterStart
frameIdback to summary
private long frameId
framesback to summary
private int frames
gl20back to summary
pack-priv GL20 gl20
gl30back to summary
private GL30 gl30
gl31back to summary
private GL31 gl31
gl32back to summary
private GL32 gl32
glVersionback to summary
private GLVersion glVersion
isContinuousback to summary
private volatile boolean isContinuous
lastFrameTimeback to summary
private long lastFrameTime
logicalHeightback to summary
private volatile int logicalHeight
logicalWidthback to summary
private volatile int logicalWidth
resetDeltaTimeback to summary
private boolean resetDeltaTime
resizeCallbackback to summary
pack-priv GLFWFramebufferSizeCallback resizeCallback
tmpBufferback to summary
pack-priv IntBuffer tmpBuffer
tmpBuffer2back to summary
pack-priv IntBuffer tmpBuffer2
windowback to summary
pack-priv final Lwjgl3Window window
windowHeightBeforeFullscreenback to summary
private int windowHeightBeforeFullscreen
windowPosXBeforeFullscreenback to summary
private int windowPosXBeforeFullscreen
windowPosYBeforeFullscreenback to summary
private int windowPosYBeforeFullscreen
windowWidthBeforeFullscreenback to summary
private int windowWidthBeforeFullscreen

Constructor Detail

Lwjgl3Graphicsback to summary
public Lwjgl3Graphics(Lwjgl3Window window)

Method Detail

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Doc from com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

Annotations
@Override
enableCubeMapSeamlessback to summary
public void enableCubeMapSeamless(boolean enable)

Enable or disable cubemap seamless feature. Default is true if supported. Should only be called if this feature is supported. (see supportsCubeMapSeamless())

getBackBufferHeightback to summary
public int getBackBufferHeight()

Implements com.badlogic.gdx.Graphics.getBackBufferHeight.

Annotations
@Override
getBackBufferWidthback to summary
public int getBackBufferWidth()

Implements com.badlogic.gdx.Graphics.getBackBufferWidth.

Annotations
@Override
getBufferFormatback to summary
public Graphics.BufferFormat getBufferFormat()

Implements com.badlogic.gdx.Graphics.getBufferFormat.

Annotations
@Override
getDeltaTimeback to summary
public float getDeltaTime()

Implements com.badlogic.gdx.Graphics.getDeltaTime.

Annotations
@Override
getDisplayModeback to summary
public Graphics.DisplayMode getDisplayMode()

Implements com.badlogic.gdx.Graphics.getDisplayMode.

Annotations
@Override
getDisplayModeback to summary
public Graphics.DisplayMode getDisplayMode(Graphics.Monitor monitor)

Implements com.badlogic.gdx.Graphics.getDisplayMode.

Annotations
@Override
getDisplayModesback to summary
public Graphics.DisplayMode[] getDisplayModes()

Implements com.badlogic.gdx.Graphics.getDisplayModes.

Annotations
@Override
getDisplayModesback to summary
public Graphics.DisplayMode[] getDisplayModes(Graphics.Monitor monitor)

Implements com.badlogic.gdx.Graphics.getDisplayModes.

Annotations
@Override
getFrameIdback to summary
public long getFrameId()

Implements com.badlogic.gdx.Graphics.getFrameId.

Doc from com.badlogic.gdx.Graphics.getFrameId.

Returns the id of the current frame. The general contract of this method is that the id is incremented only when the application is in the running state right before calling the ApplicationListener#render() method. Also, the id of the first frame is 0; the id of subsequent frames is guaranteed to take increasing values for 263-1 rendering cycles.

Annotations
@Override
getFramesPerSecondback to summary
public int getFramesPerSecond()

Implements com.badlogic.gdx.Graphics.getFramesPerSecond.

Annotations
@Override
getGL20back to summary
public GL20 getGL20()

Implements com.badlogic.gdx.Graphics.getGL20.

Annotations
@Override
getGL30back to summary
public GL30 getGL30()

Implements com.badlogic.gdx.Graphics.getGL30.

Annotations
@Override
getGL31back to summary
public GL31 getGL31()

Implements com.badlogic.gdx.Graphics.getGL31.

Annotations
@Override
getGL32back to summary
public GL32 getGL32()

Implements com.badlogic.gdx.Graphics.getGL32.

Annotations
@Override
getGLVersionback to summary
public GLVersion getGLVersion()

Implements com.badlogic.gdx.Graphics.getGLVersion.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements com.badlogic.gdx.Graphics.getHeight.

Annotations
@Override
getLogicalHeightback to summary
public int getLogicalHeight()
getLogicalWidthback to summary
public int getLogicalWidth()
getMonitorback to summary
public Graphics.Monitor getMonitor()

Implements com.badlogic.gdx.Graphics.getMonitor.

Annotations
@Override
getMonitorsback to summary
public Graphics.Monitor[] getMonitors()

Implements com.badlogic.gdx.Graphics.getMonitors.

Annotations
@Override
getPpcXback to summary
public float getPpcX()

Implements com.badlogic.gdx.Graphics.getPpcX.

Annotations
@Override
getPpcYback to summary
public float getPpcY()

Implements com.badlogic.gdx.Graphics.getPpcY.

Annotations
@Override
getPpiXback to summary
public float getPpiX()

Implements com.badlogic.gdx.Graphics.getPpiX.

Annotations
@Override
getPpiYback to summary
public float getPpiY()

Implements com.badlogic.gdx.Graphics.getPpiY.

Annotations
@Override
getPrimaryMonitorback to summary
public Graphics.Monitor getPrimaryMonitor()

Implements com.badlogic.gdx.Graphics.getPrimaryMonitor.

Annotations
@Override
getSafeInsetBottomback to summary
public int getSafeInsetBottom()

Implements com.badlogic.gdx.Graphics.getSafeInsetBottom.

Annotations
@Override
getSafeInsetLeftback to summary
public int getSafeInsetLeft()

Implements com.badlogic.gdx.Graphics.getSafeInsetLeft.

Annotations
@Override
getSafeInsetRightback to summary
public int getSafeInsetRight()

Implements com.badlogic.gdx.Graphics.getSafeInsetRight.

Annotations
@Override
getSafeInsetTopback to summary
public int getSafeInsetTop()

Implements com.badlogic.gdx.Graphics.getSafeInsetTop.

Annotations
@Override
getTypeback to summary
public Graphics.GraphicsType getType()

Implements com.badlogic.gdx.Graphics.getType.

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements com.badlogic.gdx.Graphics.getWidth.

Annotations
@Override
getWindowback to summary
public Lwjgl3Window getWindow()
initiateGLback to summary
private void initiateGL()
isContinuousRenderingback to summary
public boolean isContinuousRendering()

Implements com.badlogic.gdx.Graphics.isContinuousRendering.

Annotations
@Override
isFullscreenback to summary
public boolean isFullscreen()

Implements com.badlogic.gdx.Graphics.isFullscreen.

Doc from com.badlogic.gdx.Graphics.isFullscreen.

Whether the app is fullscreen or not

Annotations
@Override
isGL30Availableback to summary
public boolean isGL30Available()

Implements com.badlogic.gdx.Graphics.isGL30Available.

Doc from com.badlogic.gdx.Graphics.isGL30Available.

Returns whether OpenGL ES 3.0 is available. If it is you can get an instance of GL30 via getGL30() to access OpenGL ES 3.0 functionality. Note that this functionality will only be available if you instructed the Application instance to use OpenGL ES 3.0!

Annotations
@Override
isGL31Availableback to summary
public boolean isGL31Available()

Implements com.badlogic.gdx.Graphics.isGL31Available.

Doc from com.badlogic.gdx.Graphics.isGL31Available.

Returns whether OpenGL ES 3.1 is available. If it is you can get an instance of GL31 via getGL31() to access OpenGL ES 3.1 functionality. Note that this functionality will only be available if you instructed the Application instance to use OpenGL ES 3.1!

Annotations
@Override
isGL32Availableback to summary
public boolean isGL32Available()

Implements com.badlogic.gdx.Graphics.isGL32Available.

Doc from com.badlogic.gdx.Graphics.isGL32Available.

Returns whether OpenGL ES 3.2 is available. If it is you can get an instance of GL32 via getGL32() to access OpenGL ES 3.2 functionality. Note that this functionality will only be available if you instructed the Application instance to use OpenGL ES 3.2!

Annotations
@Override
newCursorback to summary
public Cursor newCursor(Pixmap pixmap, int xHotspot, int yHotspot)

Implements com.badlogic.gdx.Graphics.newCursor.

Doc from com.badlogic.gdx.Graphics.newCursor.

Create a new cursor represented by the com.badlogic.gdx.graphics.Pixmap. The Pixmap must be in RGBA8888 format, width & height must be powers-of-two greater than zero (not necessarily equal) and of a certain minimum size (32x32 is a safe bet), and alpha transparency must be single-bit (i.e., 0x00 or 0xFF only). This function returns a Cursor object that can be set as the system cursor by calling setCursor(Cursor) .

Annotations
@Override
requestRenderingback to summary
public void requestRendering()

Implements com.badlogic.gdx.Graphics.requestRendering.

Doc from com.badlogic.gdx.Graphics.requestRendering.

Requests a new frame to be rendered if the rendering mode is non-continuous. This method can be called from any thread.

Annotations
@Override
resetDeltaTimeback to summary
public void resetDeltaTime()
setContinuousRenderingback to summary
public void setContinuousRendering(boolean isContinuous)

Implements com.badlogic.gdx.Graphics.setContinuousRendering.

Doc from com.badlogic.gdx.Graphics.setContinuousRendering.

Sets whether to render continuously. In case rendering is performed non-continuously, the following events will trigger a redraw:

  • A call to requestRendering()
  • Input events from the touch screen/mouse or keyboard
  • A Runnable is posted to the rendering thread via Application#postRunnable(Runnable). In the case of a multi-window app, all windows will request rendering if a runnable is posted to the application. To avoid this, post a runnable to the window instead.
Life-cycle events will also be reported as usual, see ApplicationListener. This method can be called from any thread.
Annotations
@Override
setCursorback to summary
public void setCursor(Cursor cursor)

Implements com.badlogic.gdx.Graphics.setCursor.

Doc from com.badlogic.gdx.Graphics.setCursor.

Only viable on the lwjgl-backend and on the gwt-backend. Browsers that support cursor:url() and support the png format (the pixmap is converted to a data-url of type image/png) should also support custom cursors. Will set the mouse cursor image to the image represented by the com.badlogic.gdx.graphics.Cursor. It is recommended to call this function in the main render thread, and maximum one time per frame.

Annotations
@Override
setForegroundFPSback to summary
public void setForegroundFPS(int fps)

Implements com.badlogic.gdx.Graphics.setForegroundFPS.

Sets the target framerate for the application, when using continuous rendering. Must be positive. The cpu sleeps as needed. Use 0 to never sleep. If there are multiple windows, the value for the first window created is used for all. Default is 0.

Parameters
fps:int

fps

Annotations
@Override
setFullscreenModeback to summary
public boolean setFullscreenMode(Graphics.DisplayMode displayMode)

Implements com.badlogic.gdx.Graphics.setFullscreenMode.

Doc from com.badlogic.gdx.Graphics.setFullscreenMode.

Sets the window to full-screen mode.

Annotations
@Override
setGL20back to summary
public void setGL20(GL20 gl20)

Implements com.badlogic.gdx.Graphics.setGL20.

Doc from com.badlogic.gdx.Graphics.setGL20.

Set the GL20 instance

Annotations
@Override
setGL30back to summary
public void setGL30(GL30 gl30)

Implements com.badlogic.gdx.Graphics.setGL30.

Doc from com.badlogic.gdx.Graphics.setGL30.

Set the GL30 instance

Annotations
@Override
setGL31back to summary
public void setGL31(GL31 gl31)

Implements com.badlogic.gdx.Graphics.setGL31.

Doc from com.badlogic.gdx.Graphics.setGL31.

Set the GL31 instance

Annotations
@Override
setGL32back to summary
public void setGL32(GL32 gl32)

Implements com.badlogic.gdx.Graphics.setGL32.

Doc from com.badlogic.gdx.Graphics.setGL32.

Set the GL32 instance

Annotations
@Override
setResizableback to summary
public void setResizable(boolean resizable)

Implements com.badlogic.gdx.Graphics.setResizable.

Doc from com.badlogic.gdx.Graphics.setResizable.

Sets whether or not the window should be resizable. Ignored on Android. Note that immediate behavior of this method may vary depending on the implementation. It may be necessary for the window to be recreated in order for the changes to take effect. Consult the documentation for the backend in use for more information. Supported on all GDX desktop backends.

Annotations
@Override
setSystemCursorback to summary
public void setSystemCursor(Cursor.SystemCursor systemCursor)

Implements com.badlogic.gdx.Graphics.setSystemCursor.

Doc from com.badlogic.gdx.Graphics.setSystemCursor.

Sets one of the predefined SystemCursors

Annotations
@Override
setTitleback to summary
public void setTitle(String title)

Implements com.badlogic.gdx.Graphics.setTitle.

Doc from com.badlogic.gdx.Graphics.setTitle.

Sets the title of the window. Ignored on Android.

Annotations
@Override
setUndecoratedback to summary
public void setUndecorated(boolean undecorated)

Implements com.badlogic.gdx.Graphics.setUndecorated.

Doc from com.badlogic.gdx.Graphics.setUndecorated.

Sets the window decoration as enabled or disabled. On Android, this will enable/disable the menu bar. Note that immediate behavior of this method may vary depending on the implementation. It may be necessary for the window to be recreated in order for the changes to take effect. Consult the documentation for the backend in use for more information. Supported on all GDX desktop backends and on Android (to disable the menu bar).

Annotations
@Override
setVSyncback to summary
public void setVSync(boolean vsync)

Implements com.badlogic.gdx.Graphics.setVSync.

Doc from com.badlogic.gdx.Graphics.setVSync.

Enable/Disable vsynching. This is a best-effort attempt which might not work on all platforms.

Annotations
@Override
setWindowedModeback to summary
public boolean setWindowedMode(int width, int height)

Implements com.badlogic.gdx.Graphics.setWindowedMode.

Doc from com.badlogic.gdx.Graphics.setWindowedMode.

Sets the window to windowed mode.

Annotations
@Override
storeCurrentWindowPositionAndDisplayModeback to summary
private void storeCurrentWindowPositionAndDisplayMode()
supportsCubeMapSeamlessback to summary
public boolean supportsCubeMapSeamless()
Returns:boolean

whether cubemap seamless feature is supported.

supportsDisplayModeChangeback to summary
public boolean supportsDisplayModeChange()

Implements com.badlogic.gdx.Graphics.supportsDisplayModeChange.

Doc from com.badlogic.gdx.Graphics.supportsDisplayModeChange.

Whether the given backend supports a display mode change via calling Graphics#setFullscreenMode(DisplayMode)

Annotations
@Override
supportsExtensionback to summary
public boolean supportsExtension(String extension)

Implements com.badlogic.gdx.Graphics.supportsExtension.

Annotations
@Override
updateback to summary
pack-priv void update()
updateFramebufferInfoback to summary
pack-priv void updateFramebufferInfo()
com.badlogic.gdx.backends.lwjgl3 back to summary

public Class Lwjgl3Graphics.Lwjgl3DisplayMode

extends DisplayMode
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final long
Inherited from com.badlogic.gdx.Graphics.DisplayMode:
bitsPerPixelheightrefreshRatewidth

Constructor Summary

AccessConstructor and Description
pack-priv
Lwjgl3DisplayMode(long monitor, int width, int height, int refreshRate, int bitsPerPixel)

Method Summary

Modifier and TypeMethod and Description
public long
Inherited from com.badlogic.gdx.Graphics.DisplayMode:
toString

Field Detail

monitorHandleback to summary
pack-priv final long monitorHandle

Constructor Detail

Lwjgl3DisplayModeback to summary
pack-priv Lwjgl3DisplayMode(long monitor, int width, int height, int refreshRate, int bitsPerPixel)

Method Detail

getMonitorback to summary
public long getMonitor()
com.badlogic.gdx.backends.lwjgl3 back to summary

public Class Lwjgl3Graphics.Lwjgl3Monitor

extends Monitor
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final long
Inherited from com.badlogic.gdx.Graphics.Monitor:
namevirtualXvirtualY

Constructor Summary

AccessConstructor and Description
pack-priv
Lwjgl3Monitor(long monitor, int virtualX, int virtualY, String name)

Method Summary

Modifier and TypeMethod and Description
public long

Field Detail

monitorHandleback to summary
pack-priv final long monitorHandle

Constructor Detail

Lwjgl3Monitorback to summary
pack-priv Lwjgl3Monitor(long monitor, int virtualX, int virtualY, String name)

Method Detail

getMonitorHandleback to summary
public long getMonitorHandle()