Top Fields Constructors Methods
org.lwjgl.opengl

pack-priv final Class MacOSXDisplay

extends Object
implements DisplayImplementation
Class Inheritance
All Implemented Interfaces
org.lwjgl.opengl.DisplayImplementation, org.lwjgl.opengl.InputImplementation
Imports
java.awt.Canvas, .Robot, java.nio.ByteBuffer, .FloatBuffer, .IntBuffer, java.security.AccessController, .PrivilegedAction, .PrivilegedExceptionAction, java.util.ArrayList, .List, org.lwjgl.input.Cursor, org.lwjgl.opengl.Display, .DisplayMode, org.lwjgl.BufferUtils, .MemoryUtil, .LWJGLException, .LWJGLUtil

Field Summary

Modifier and TypeField and Description
private Canvas
private boolean
private ByteBuffer
private static final IntBuffer
private long
private boolean
private static final int
private MacOSXNativeKeyboard
private KeyboardEventQueue
private MacOSXNativeMouse
private MacOSXMouseEventQueue
private boolean
private boolean
private static final int
private DisplayMode
private Robot
private float
private boolean
private boolean
private ByteBuffer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addDisplayMode(Object modesList, int width, int height, int bitsPerPixel, int refreshRate)

public void
public Object
createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays)

Implements org.lwjgl.opengl.InputImplementation.createCursor.

Native cursor handles
public Object
createDisplayMode(int width, int height, int bitsPerPixel, int refreshRate)

public void
createKeyboard()

Implements org.lwjgl.opengl.InputImplementation.createKeyboard.

Method to create the keyboard
public void
createMouse()

Implements org.lwjgl.opengl.InputImplementation.createMouse.

Method to create the mouse.
public PeerInfo
createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs)

Implements org.lwjgl.opengl.DisplayImplementation.createPbuffer.

Method to create a Pbuffer
public PeerInfo
createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs)

Implements org.lwjgl.opengl.DisplayImplementation.createPeerInfo.

Create the native PeerInfo.
public void
public void
public void
destroyKeyboard()

Implements org.lwjgl.opengl.InputImplementation.destroyKeyboard.

Method to destroy the keyboard
public void
destroyMouse()

Implements org.lwjgl.opengl.InputImplementation.destroyMouse.

Method the destroy the mouse
public void
public void
private static boolean
public String
getAdapter()

Implements org.lwjgl.opengl.DisplayImplementation.getAdapter.

Get the driver adapter string.
public DisplayMode[]
public int
public Canvas
private static long
getCursorHandle(Object cursor_handle)

public int
getGammaRampLength()

Implements org.lwjgl.opengl.DisplayImplementation.getGammaRampLength.

Return the length of the gamma ramp arrays.
public int
public int
getMaxCursorSize()

Implements org.lwjgl.opengl.InputImplementation.getMaxCursorSize.

Method returning the maximum cursor size
public int
getMinCursorSize()

Implements org.lwjgl.opengl.InputImplementation.getMinCursorSize.

Method returning the minimum cursor size
public int
public int
public float
public String
public int
public int
public int
public void
public boolean
hasWheel()

Implements org.lwjgl.opengl.InputImplementation.hasWheel.

Query of wheel support
public DisplayMode
init()

Implements org.lwjgl.opengl.DisplayImplementation.init.

Initialize and return the current display mode.
public boolean
public boolean
isBufferLost(PeerInfo handle)

Implements org.lwjgl.opengl.DisplayImplementation.isBufferLost.

Method to test for buffer integrity
public boolean
public boolean
public boolean
private static boolean
public boolean
public void
mouseInsideWindow(boolean inside)

private native ByteBuffer
nCreateWindow(int x, int y, int width, int height, boolean fullscreen, boolean undecorated, boolean resizable, boolean parented, boolean enableFullscreenModeAPI, boolean enableHighDPI, ByteBuffer peer_info_handle, ByteBuffer window_handle)

public native void
nDestroyCALayer(ByteBuffer peer_info_handle)

public native void
nDestroyWindow(ByteBuffer window_handle)

private native Object
private native void
private native int
nGetHeight(ByteBuffer window_handle)

private native int
nGetWidth(ByteBuffer window_handle)

private native int
nGetX(ByteBuffer window_handle)

private native int
nGetY(ByteBuffer window_handle)

private native boolean
nIsFocused(ByteBuffer window_handle)

private native boolean
nIsMiniaturized(ByteBuffer window_handle)

private native boolean
nIsNativeMode(ByteBuffer peer_info_handle)

private native void
nResizeWindow(ByteBuffer window_handle, int x, int y, int width, int height)

private native void
nSetResizable(ByteBuffer window_handle, boolean resizable)

private native void
nSetTitle(ByteBuffer window_handle, ByteBuffer title_buffer)

private native boolean
nWasResized(ByteBuffer window_handle)

public void
pollKeyboard(ByteBuffer
the address of a 256-byte buffer to place key states in.
keyDownBuffer
)

Implements org.lwjgl.opengl.InputImplementation.pollKeyboard.

Method to poll the keyboard.
public void
pollMouse(IntBuffer coord_buffer, ByteBuffer buttons_buffer)

Implements org.lwjgl.opengl.InputImplementation.pollMouse.

Method to poll the mouse
public void
readKeyboard(ByteBuffer buffer)

Implements org.lwjgl.opengl.InputImplementation.readKeyboard.

Method to read the keyboard buffer
public void
readMouse(ByteBuffer buffer)

Implements org.lwjgl.opengl.InputImplementation.readMouse.

Method to read the mouse buffer
public void
public void
resetDisplayMode()

Implements org.lwjgl.opengl.DisplayImplementation.resetDisplayMode.

Reset the display mode to whatever it was when LWJGL was initialized.
public void
reshape(int x, int y, int width, int height)

Implements org.lwjgl.opengl.DisplayImplementation.reshape.

private native void
public void
setCursorPosition(int x, int y)

Implements org.lwjgl.opengl.InputImplementation.setCursorPosition.

Method to set the native cursor position
public native void
setGammaRamp(FloatBuffer gammaRamp)

Implements org.lwjgl.opengl.DisplayImplementation.setGammaRamp.

Method to set the gamma ramp.
public int

Returns:

number of icons used.
setIcon
(ByteBuffer[]
Array of icons in RGBA mode
icons
)

Implements org.lwjgl.opengl.DisplayImplementation.setIcon.

Sets one or more icons for the Display.
public void
setNativeCursor(Object handle)

Implements org.lwjgl.opengl.InputImplementation.setNativeCursor.

Method to set the native cursor
public void
public void
setResizable(boolean
set to true to make the Display window resizable; false to disable resizing on the Display window.
resizable
)

Implements org.lwjgl.opengl.DisplayImplementation.setResizable.

Enable or disable the Display window to be resized.
public void
setScaleFactor(float scale)

public void
setTitle(String title)

Implements org.lwjgl.opengl.DisplayImplementation.setTitle.

Implementation of setTitle().
public void
public void
update()

Implements org.lwjgl.opengl.DisplayImplementation.update.

Updates the windows internal state.
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

canvasback to summary
private Canvas canvas
close_requestedback to summary
private boolean close_requested
contextback to summary
private ByteBuffer context
current_viewportback to summary
private static final IntBuffer current_viewport
currentNativeCursorback to summary
private long currentNativeCursor
enableHighDPIback to summary
private boolean enableHighDPI
GAMMA_LENGTHback to summary
private static final int GAMMA_LENGTH
keyboardback to summary
private MacOSXNativeKeyboard keyboard
keyboard_queueback to summary
private KeyboardEventQueue keyboard_queue
mouseback to summary
private MacOSXNativeMouse mouse
mouse_queueback to summary
private MacOSXMouseEventQueue mouse_queue
mouseInsideWindowback to summary
private boolean mouseInsideWindow
native_modeback to summary
private boolean native_mode
PBUFFER_HANDLE_SIZEback to summary
private static final int PBUFFER_HANDLE_SIZE
requested_modeback to summary
private DisplayMode requested_mode
robotback to summary
private Robot robot
scaleFactorback to summary
private float scaleFactor
skipViewportValueback to summary
private boolean skipViewportValue
updateNativeCursorback to summary
private boolean updateNativeCursor
windowback to summary
private ByteBuffer window

Constructor Detail

MacOSXDisplayback to summary
pack-priv MacOSXDisplay()

Method Detail

addDisplayModeback to summary
public void addDisplayMode(Object modesList, int width, int height, int bitsPerPixel, int refreshRate)
bindTexImageToPbufferback to summary
public void bindTexImageToPbuffer(PeerInfo handle, int buffer)

Implements org.lwjgl.opengl.DisplayImplementation.bindTexImageToPbuffer.

createCursorback to summary
public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException

Implements org.lwjgl.opengl.InputImplementation.createCursor.

Native cursor handles

createDisplayModeback to summary
public Object createDisplayMode(int width, int height, int bitsPerPixel, int refreshRate)
createKeyboardback to summary
public void createKeyboard() throws LWJGLException

Implements org.lwjgl.opengl.InputImplementation.createKeyboard.

Doc from org.lwjgl.opengl.InputImplementation.createKeyboard.

Method to create the keyboard

createMouseback to summary
public void createMouse() throws LWJGLException

Implements org.lwjgl.opengl.InputImplementation.createMouse.

Doc from org.lwjgl.opengl.InputImplementation.createMouse.

Method to create the mouse.

createPbufferback to summary
public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.createPbuffer.

Doc from org.lwjgl.opengl.DisplayImplementation.createPbuffer.

Method to create a Pbuffer

createPeerInfoback to summary
public PeerInfo createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.createPeerInfo.

Doc from org.lwjgl.opengl.DisplayImplementation.createPeerInfo.

Create the native PeerInfo.

createWindowback to summary
public void createWindow(final DrawableLWJGL drawable, DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.createWindow.

destroyCursorback to summary
public void destroyCursor(Object cursor_handle)

Implements org.lwjgl.opengl.InputImplementation.destroyCursor.

destroyKeyboardback to summary
public void destroyKeyboard()

Implements org.lwjgl.opengl.InputImplementation.destroyKeyboard.

Doc from org.lwjgl.opengl.InputImplementation.destroyKeyboard.

Method to destroy the keyboard

destroyMouseback to summary
public void destroyMouse()

Implements org.lwjgl.opengl.InputImplementation.destroyMouse.

Doc from org.lwjgl.opengl.InputImplementation.destroyMouse.

Method the destroy the mouse

destroyWindowback to summary
public void destroyWindow()

Implements org.lwjgl.opengl.DisplayImplementation.destroyWindow.

doHandleQuitback to summary
public void doHandleQuit()
equalsback to summary
private static boolean equals(DisplayMode mode1, DisplayMode mode2)
getAdapterback to summary
public String getAdapter()

Implements org.lwjgl.opengl.DisplayImplementation.getAdapter.

Doc from org.lwjgl.opengl.DisplayImplementation.getAdapter.

Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2", "Radeon9700". If the adapter cannot be determined, this function returns null.

Returns:String

a String

getAvailableDisplayModesback to summary
public DisplayMode[] getAvailableDisplayModes() throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.getAvailableDisplayModes.

Doc from org.lwjgl.opengl.DisplayImplementation.getAvailableDisplayModes.

Method for getting displaymodes

getButtonCountback to summary
public int getButtonCount()

Implements org.lwjgl.opengl.InputImplementation.getButtonCount.

Doc from org.lwjgl.opengl.InputImplementation.getButtonCount.

Query of button count

getCanvasback to summary
public Canvas getCanvas()
getCursorHandleback to summary
private static long getCursorHandle(Object cursor_handle)
getGammaRampLengthback to summary
public int getGammaRampLength()

Implements org.lwjgl.opengl.DisplayImplementation.getGammaRampLength.

Doc from org.lwjgl.opengl.DisplayImplementation.getGammaRampLength.

Return the length of the gamma ramp arrays. Returns 0 if gamma settings are unsupported.

Returns:int

the length of each gamma ramp array, or 0 if gamma settings are unsupported.

getHeightback to summary
public int getHeight()

Implements org.lwjgl.opengl.DisplayImplementation.getHeight.

Returns:int

Doc from org.lwjgl.opengl.DisplayImplementation.getHeight.

this method will return the height of the Display window.

getMaxCursorSizeback to summary
public int getMaxCursorSize()

Implements org.lwjgl.opengl.InputImplementation.getMaxCursorSize.

Doc from org.lwjgl.opengl.InputImplementation.getMaxCursorSize.

Method returning the maximum cursor size

getMinCursorSizeback to summary
public int getMinCursorSize()

Implements org.lwjgl.opengl.InputImplementation.getMinCursorSize.

Doc from org.lwjgl.opengl.InputImplementation.getMinCursorSize.

Method returning the minimum cursor size

getNativeCursorCapabilitiesback to summary
public int getNativeCursorCapabilities()

Implements org.lwjgl.opengl.InputImplementation.getNativeCursorCapabilities.

Doc from org.lwjgl.opengl.InputImplementation.getNativeCursorCapabilities.

Function to determine native cursor support

getPbufferCapabilitiesback to summary
public int getPbufferCapabilities()

Implements org.lwjgl.opengl.DisplayImplementation.getPbufferCapabilities.

getPixelScaleFactorback to summary
public float getPixelScaleFactor()

Implements org.lwjgl.opengl.DisplayImplementation.getPixelScaleFactor.

Returns:float

Doc from org.lwjgl.opengl.DisplayImplementation.getPixelScaleFactor.

this method will return the pixel scale factor of the Display window useful for high resolution modes.

getVersionback to summary
public String getVersion()

Implements org.lwjgl.opengl.DisplayImplementation.getVersion.

Doc from org.lwjgl.opengl.DisplayImplementation.getVersion.

Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined, this function returns null.

Returns:String

a String

getWidthback to summary
public int getWidth()

Implements org.lwjgl.opengl.DisplayImplementation.getWidth.

Returns:int

Doc from org.lwjgl.opengl.DisplayImplementation.getWidth.

this method will return the width of the Display window.

getXback to summary
public int getX()

Implements org.lwjgl.opengl.DisplayImplementation.getX.

Returns:int

Doc from org.lwjgl.opengl.DisplayImplementation.getX.

this method will return the top-left x position of the Display window.

getYback to summary
public int getY()

Implements org.lwjgl.opengl.DisplayImplementation.getY.

Returns:int

Doc from org.lwjgl.opengl.DisplayImplementation.getY.

this method will return the top-left y position of the Display window.

grabMouseback to summary
public void grabMouse(boolean grab)

Implements org.lwjgl.opengl.InputImplementation.grabMouse.

hasWheelback to summary
public boolean hasWheel()

Implements org.lwjgl.opengl.InputImplementation.hasWheel.

Doc from org.lwjgl.opengl.InputImplementation.hasWheel.

Query of wheel support

initback to summary
public DisplayMode init() throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.init.

Doc from org.lwjgl.opengl.DisplayImplementation.init.

Initialize and return the current display mode.

isActiveback to summary
public boolean isActive()

Implements org.lwjgl.opengl.DisplayImplementation.isActive.

isBufferLostback to summary
public boolean isBufferLost(PeerInfo handle)

Implements org.lwjgl.opengl.DisplayImplementation.isBufferLost.

Doc from org.lwjgl.opengl.DisplayImplementation.isBufferLost.

Method to test for buffer integrity

isCloseRequestedback to summary
public boolean isCloseRequested()

Implements org.lwjgl.opengl.DisplayImplementation.isCloseRequested.

isDirtyback to summary
public boolean isDirty()

Implements org.lwjgl.opengl.DisplayImplementation.isDirty.

isInsideWindowback to summary
public boolean isInsideWindow()

Implements org.lwjgl.opengl.InputImplementation.isInsideWindow.

isUndecoratedback to summary
private static boolean isUndecorated()
isVisibleback to summary
public boolean isVisible()

Implements org.lwjgl.opengl.DisplayImplementation.isVisible.

mouseInsideWindowback to summary
public void mouseInsideWindow(boolean inside)
nCreateWindowback to summary
private native ByteBuffer nCreateWindow(int x, int y, int width, int height, boolean fullscreen, boolean undecorated, boolean resizable, boolean parented, boolean enableFullscreenModeAPI, boolean enableHighDPI, ByteBuffer peer_info_handle, ByteBuffer window_handle) throws LWJGLException
nDestroyCALayerback to summary
public native void nDestroyCALayer(ByteBuffer peer_info_handle)
nDestroyWindowback to summary
public native void nDestroyWindow(ByteBuffer window_handle)
nGetCurrentDisplayModeback to summary
private native Object nGetCurrentDisplayMode()
nGetDisplayModesback to summary
private native void nGetDisplayModes(Object modesList)
nGetHeightback to summary
private native int nGetHeight(ByteBuffer window_handle)
nGetWidthback to summary
private native int nGetWidth(ByteBuffer window_handle)
nGetXback to summary
private native int nGetX(ByteBuffer window_handle)
nGetYback to summary
private native int nGetY(ByteBuffer window_handle)
nIsFocusedback to summary
private native boolean nIsFocused(ByteBuffer window_handle)
nIsMiniaturizedback to summary
private native boolean nIsMiniaturized(ByteBuffer window_handle)
nIsNativeModeback to summary
private native boolean nIsNativeMode(ByteBuffer peer_info_handle)
nResizeWindowback to summary
private native void nResizeWindow(ByteBuffer window_handle, int x, int y, int width, int height)
nSetResizableback to summary
private native void nSetResizable(ByteBuffer window_handle, boolean resizable)
nSetTitleback to summary
private native void nSetTitle(ByteBuffer window_handle, ByteBuffer title_buffer)
nWasResizedback to summary
private native boolean nWasResized(ByteBuffer window_handle)
pollKeyboardback to summary
public void pollKeyboard(ByteBuffer keyDownBuffer)

Implements org.lwjgl.opengl.InputImplementation.pollKeyboard.

Doc from org.lwjgl.opengl.InputImplementation.pollKeyboard.

Method to poll the keyboard.

Parameters
keyDownBuffer:ByteBuffer

the address of a 256-byte buffer to place key states in.

pollMouseback to summary
public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons_buffer)

Implements org.lwjgl.opengl.InputImplementation.pollMouse.

Doc from org.lwjgl.opengl.InputImplementation.pollMouse.

Method to poll the mouse

readKeyboardback to summary
public void readKeyboard(ByteBuffer buffer)

Implements org.lwjgl.opengl.InputImplementation.readKeyboard.

Doc from org.lwjgl.opengl.InputImplementation.readKeyboard.

Method to read the keyboard buffer

readMouseback to summary
public void readMouse(ByteBuffer buffer)

Implements org.lwjgl.opengl.InputImplementation.readMouse.

Doc from org.lwjgl.opengl.InputImplementation.readMouse.

Method to read the mouse buffer

releaseTexImageFromPbufferback to summary
public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer)

Implements org.lwjgl.opengl.DisplayImplementation.releaseTexImageFromPbuffer.

resetDisplayModeback to summary
public void resetDisplayMode()

Implements org.lwjgl.opengl.DisplayImplementation.resetDisplayMode.

Doc from org.lwjgl.opengl.DisplayImplementation.resetDisplayMode.

Reset the display mode to whatever it was when LWJGL was initialized. Fails silently.

reshapeback to summary
public void reshape(int x, int y, int width, int height)

Implements org.lwjgl.opengl.DisplayImplementation.reshape.

restoreGammaback to summary
private native void restoreGamma()
setCursorPositionback to summary
public void setCursorPosition(int x, int y)

Implements org.lwjgl.opengl.InputImplementation.setCursorPosition.

Doc from org.lwjgl.opengl.InputImplementation.setCursorPosition.

Method to set the native cursor position

setGammaRampback to summary
public native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.setGammaRamp.

Doc from org.lwjgl.opengl.DisplayImplementation.setGammaRamp.

Method to set the gamma ramp.

setIconback to summary
public int setIcon(ByteBuffer[] icons)

Implements org.lwjgl.opengl.DisplayImplementation.setIcon.

Sets one or more icons for the Display.

  • On Windows you should supply at least one 16x16 icon and one 32x32.
  • Linux (and similar platforms) expect one 32x32 icon.
  • Mac OS X should be supplied one 128x128 icon
The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform.
Parameters
icons:ByteBuffer[]

Array of icons in RGBA mode

Returns:int

number of icons used.

setNativeCursorback to summary
public void setNativeCursor(Object handle) throws LWJGLException

Implements org.lwjgl.opengl.InputImplementation.setNativeCursor.

Doc from org.lwjgl.opengl.InputImplementation.setNativeCursor.

Method to set the native cursor

setPbufferAttribback to summary
public void setPbufferAttrib(PeerInfo handle, int attrib, int value)

Implements org.lwjgl.opengl.DisplayImplementation.setPbufferAttrib.

setResizableback to summary
public void setResizable(boolean resizable)

Implements org.lwjgl.opengl.DisplayImplementation.setResizable.

Doc from org.lwjgl.opengl.DisplayImplementation.setResizable.

Enable or disable the Display window to be resized.

Parameters
resizable:boolean

set to true to make the Display window resizable; false to disable resizing on the Display window.

setScaleFactorback to summary
public void setScaleFactor(float scale)
setTitleback to summary
public void setTitle(String title)

Implements org.lwjgl.opengl.DisplayImplementation.setTitle.

Doc from org.lwjgl.opengl.DisplayImplementation.setTitle.

Implementation of setTitle(). This will read the window's title member and stash it in the native title of the window.

switchDisplayModeback to summary
public void switchDisplayMode(DisplayMode mode) throws LWJGLException

Implements org.lwjgl.opengl.DisplayImplementation.switchDisplayMode.

updateback to summary
public void update()

Implements org.lwjgl.opengl.DisplayImplementation.update.

Doc from org.lwjgl.opengl.DisplayImplementation.update.

Updates the windows internal state. This must be called at least once per video frame to handle window close requests, moves, paints, etc.

wasResizedback to summary
public boolean wasResized()

Implements org.lwjgl.opengl.DisplayImplementation.wasResized.

Returns:boolean

Doc from org.lwjgl.opengl.DisplayImplementation.wasResized.

true if the Display window has been resized since this method was last called.