Package org.lwjgl.system.windows
Class GDI32
- java.lang.Object
-
- org.lwjgl.system.windows.GDI32
-
public class GDI32 extends java.lang.Object
Native bindings to wingdi.h and gdi32.dll.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
GDI32.Functions
Contains the function pointers loaded from the gdi32SharedLibrary
.
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static int
ChoosePixelFormat(long hdc, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Attempts to match an appropriate pixel format supported by a device context to a given pixel format specification.static int
DescribePixelFormat(long hdc, int pixelFormat, int bytes, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Obtains information about the pixel format identified by pixelFormat of the device associated with dc.static int
DescribePixelFormat(long hdc, int pixelFormat, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Obtains information about the pixel format identified by pixelFormat of the device associated with dc.static SharedLibrary
getLibrary()
Returns the gdi32SharedLibrary
.static int
GetPixelFormat(long hdc)
Obtains the index of the currently selected pixel format of the specified device context.static boolean
SetPixelFormat(long hdc, int pixelFormat, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Sets the pixel format of the specified device context to the format specified by the pixelFormat index.static boolean
SwapBuffers(long dc)
Exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer.
-
-
-
Field Detail
-
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
public static final int DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_MULTI_DRIVER
public static final int DISPLAY_DEVICE_MULTI_DRIVER
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_PRIMARY_DEVICE
public static final int DISPLAY_DEVICE_PRIMARY_DEVICE
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_MIRRORING_DRIVER
public static final int DISPLAY_DEVICE_MIRRORING_DRIVER
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_VGA_COMPATIBLE
public static final int DISPLAY_DEVICE_VGA_COMPATIBLE
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_REMOVABLE
public static final int DISPLAY_DEVICE_REMOVABLE
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_MODESPRUNED
public static final int DISPLAY_DEVICE_MODESPRUNED
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_REMOTE
public static final int DISPLAY_DEVICE_REMOTE
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_DISCONNECT
public static final int DISPLAY_DEVICE_DISCONNECT
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_TS_COMPATIBLE
public static final int DISPLAY_DEVICE_TS_COMPATIBLE
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_UNSAFE_MODES_ON
public static final int DISPLAY_DEVICE_UNSAFE_MODES_ON
Display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_ACTIVE
public static final int DISPLAY_DEVICE_ACTIVE
Child display device state flags.- See Also:
- Constant Field Values
-
DISPLAY_DEVICE_ATTACHED
public static final int DISPLAY_DEVICE_ATTACHED
Child display device state flags.- See Also:
- Constant Field Values
-
DM_SPECVERSION
public static final int DM_SPECVERSION
DEVMODE
specification version.- See Also:
- Constant Field Values
-
DM_ORIENTATION
public static final int DM_ORIENTATION
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PAPERSIZE
public static final int DM_PAPERSIZE
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PAPERLENGTH
public static final int DM_PAPERLENGTH
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PAPERWIDTH
public static final int DM_PAPERWIDTH
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_SCALE
public static final int DM_SCALE
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_POSITION
public static final int DM_POSITION
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_NUP
public static final int DM_NUP
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DISPLAYORIENTATION
public static final int DM_DISPLAYORIENTATION
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_COPIES
public static final int DM_COPIES
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DEFAULTSOURCE
public static final int DM_DEFAULTSOURCE
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PRINTQUALITY
public static final int DM_PRINTQUALITY
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_COLOR
public static final int DM_COLOR
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DUPLEX
public static final int DM_DUPLEX
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_YRESOLUTION
public static final int DM_YRESOLUTION
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_TTOPTION
public static final int DM_TTOPTION
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_COLLATE
public static final int DM_COLLATE
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_FORMNAME
public static final int DM_FORMNAME
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_LOGPIXELS
public static final int DM_LOGPIXELS
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_BITSPERPEL
public static final int DM_BITSPERPEL
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PELSWIDTH
public static final int DM_PELSWIDTH
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PELSHEIGHT
public static final int DM_PELSHEIGHT
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DISPLAYFLAGS
public static final int DM_DISPLAYFLAGS
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DISPLAYFREQUENCY
public static final int DM_DISPLAYFREQUENCY
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_ICMMETHOD
public static final int DM_ICMMETHOD
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_ICMINTENT
public static final int DM_ICMINTENT
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_MEDIATYPE
public static final int DM_MEDIATYPE
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DITHERTYPE
public static final int DM_DITHERTYPE
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PANNINGWIDTH
public static final int DM_PANNINGWIDTH
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_PANNINGHEIGHT
public static final int DM_PANNINGHEIGHT
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DM_DISPLAYFIXEDOUTPUT
public static final int DM_DISPLAYFIXEDOUTPUT
DEVMODE
field selection bits.- See Also:
- Constant Field Values
-
DMDO_DEFAULT
public static final int DMDO_DEFAULT
DEVMODE
dmDisplayOrientation
specifications.- See Also:
- Constant Field Values
-
DMDO_90
public static final int DMDO_90
DEVMODE
dmDisplayOrientation
specifications.- See Also:
- Constant Field Values
-
DMDO_180
public static final int DMDO_180
DEVMODE
dmDisplayOrientation
specifications.- See Also:
- Constant Field Values
-
DMDO_270
public static final int DMDO_270
DEVMODE
dmDisplayOrientation
specifications.- See Also:
- Constant Field Values
-
DMDFO_DEFAULT
public static final int DMDFO_DEFAULT
DEVMODE
dmDisplayFixedOutput
specifications.- See Also:
- Constant Field Values
-
DMDFO_STRETCH
public static final int DMDFO_STRETCH
DEVMODE
dmDisplayFixedOutput
specifications.- See Also:
- Constant Field Values
-
DMDFO_CENTER
public static final int DMDFO_CENTER
DEVMODE
dmDisplayFixedOutput
specifications.- See Also:
- Constant Field Values
-
DM_INTERLACED
public static final int DM_INTERLACED
DEVMODE
dmDisplayFlags
flags.- See Also:
- Constant Field Values
-
DMDISPLAYFLAGS_TEXTMODE
public static final int DMDISPLAYFLAGS_TEXTMODE
DEVMODE
dmDisplayFlags
flags.- See Also:
- Constant Field Values
-
PFD_DOUBLEBUFFER
public static final int PFD_DOUBLEBUFFER
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_STEREO
public static final int PFD_STEREO
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_DRAW_TO_WINDOW
public static final int PFD_DRAW_TO_WINDOW
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_DRAW_TO_BITMAP
public static final int PFD_DRAW_TO_BITMAP
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SUPPORT_GDI
public static final int PFD_SUPPORT_GDI
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SUPPORT_OPENGL
public static final int PFD_SUPPORT_OPENGL
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_GENERIC_FORMAT
public static final int PFD_GENERIC_FORMAT
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_NEED_PALETTE
public static final int PFD_NEED_PALETTE
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_NEED_SYSTEM_PALETTE
public static final int PFD_NEED_SYSTEM_PALETTE
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SWAP_EXCHANGE
public static final int PFD_SWAP_EXCHANGE
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SWAP_COPY
public static final int PFD_SWAP_COPY
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SWAP_LAYER_BUFFERS
public static final int PFD_SWAP_LAYER_BUFFERS
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_GENERIC_ACCELERATED
public static final int PFD_GENERIC_ACCELERATED
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SUPPORT_DIRECTDRAW
public static final int PFD_SUPPORT_DIRECTDRAW
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_DIRECT3D_ACCELERATED
public static final int PFD_DIRECT3D_ACCELERATED
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_SUPPORT_COMPOSITION
public static final int PFD_SUPPORT_COMPOSITION
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_DEPTH_DONTCARE
public static final int PFD_DEPTH_DONTCARE
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_DOUBLEBUFFER_DONTCARE
public static final int PFD_DOUBLEBUFFER_DONTCARE
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_STEREO_DONTCARE
public static final int PFD_STEREO_DONTCARE
PIXELFORMATDESCRIPTOR
flags.- See Also:
- Constant Field Values
-
PFD_TYPE_RGBA
public static final byte PFD_TYPE_RGBA
PIXELFORMATDESCRIPTOR
pixel types.- See Also:
- Constant Field Values
-
PFD_TYPE_COLORINDEX
public static final byte PFD_TYPE_COLORINDEX
PIXELFORMATDESCRIPTOR
pixel types.- See Also:
- Constant Field Values
-
PFD_MAIN_PLANE
public static final byte PFD_MAIN_PLANE
PIXELFORMATDESCRIPTOR
layer types.- See Also:
- Constant Field Values
-
PFD_OVERLAY_PLANE
public static final byte PFD_OVERLAY_PLANE
PIXELFORMATDESCRIPTOR
layer types.- See Also:
- Constant Field Values
-
PFD_UNDERLAY_PLANE
public static final byte PFD_UNDERLAY_PLANE
PIXELFORMATDESCRIPTOR
layer types.- See Also:
- Constant Field Values
-
-
Method Detail
-
getLibrary
public static SharedLibrary getLibrary()
Returns the gdi32SharedLibrary
.
-
ChoosePixelFormat
public static int ChoosePixelFormat(long hdc, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Attempts to match an appropriate pixel format supported by a device context to a given pixel format specification.- Parameters:
hdc
- the device context that the function examines to determine the best match for the pixel format descriptor pointed to bypixelFormatDescriptor
pixelFormatDescriptor
- aPIXELFORMATDESCRIPTOR
structure that specifies the requested pixel format
-
DescribePixelFormat
public static int DescribePixelFormat(long hdc, int pixelFormat, int bytes, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Obtains information about the pixel format identified by pixelFormat of the device associated with dc. The function sets the members of thePIXELFORMATDESCRIPTOR
structure pointed to by pixelFormatDescriptor with that pixel format data. The return value is the maximum pixel format index of the device context.- Parameters:
hdc
- the device contextpixelFormat
- index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes.bytes
- the size, in bytes, of the structure pointed to bypixelFormatDescriptor
. ThewglDescribePixelFormat
function stores no more thanbytes
bytes of data to that structure. Set this value toPIXELFORMATDESCRIPTOR.SIZEOF
.pixelFormatDescriptor
- aPIXELFORMATDESCRIPTOR
structure whose members the function sets with pixel format data. The function stores the number of bytes copied to the structure in the structure'ssize
member. If, upon entry,pixelFormatDescriptor
isNULL
, the function writes no data to the structure. This is useful when you only want to obtain the maximum pixel format index of a device context.
-
DescribePixelFormat
public static int DescribePixelFormat(long hdc, int pixelFormat, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Obtains information about the pixel format identified by pixelFormat of the device associated with dc. The function sets the members of thePIXELFORMATDESCRIPTOR
structure pointed to by pixelFormatDescriptor with that pixel format data. The return value is the maximum pixel format index of the device context.- Parameters:
hdc
- the device contextpixelFormat
- index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes.pixelFormatDescriptor
- aPIXELFORMATDESCRIPTOR
structure whose members the function sets with pixel format data. The function stores the number of bytes copied to the structure in the structure'ssize
member. If, upon entry,pixelFormatDescriptor
isNULL
, the function writes no data to the structure. This is useful when you only want to obtain the maximum pixel format index of a device context.
-
GetPixelFormat
public static int GetPixelFormat(long hdc)
Obtains the index of the currently selected pixel format of the specified device context.- Parameters:
hdc
- the device context of the currently selected pixel format index returned by the function
-
SetPixelFormat
public static boolean SetPixelFormat(long hdc, int pixelFormat, PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
Sets the pixel format of the specified device context to the format specified by the pixelFormat index.- Parameters:
hdc
- the device context whose pixel format the function attempts to setpixelFormat
- index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes.pixelFormatDescriptor
- aPIXELFORMATDESCRIPTOR
structure that contains the logical pixel format specification. The system's metafile component uses this structure to record the logical pixel format specification. The structure has no other effect upon the behavior of the SetPixelFormat function.
-
SwapBuffers
public static boolean SwapBuffers(long dc)
Exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer.- Parameters:
dc
- a device context. If the current pixel format for the window referenced by this device context includes a back buffer, the function exchanges the front and back buffers.
-
-