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, DISPLAY_DEVICE_MULTI_DRIVER, DISPLAY_DEVICE_PRIMARY_DEVICE, DISPLAY_DEVICE_MIRRORING_DRIVER, DISPLAY_DEVICE_VGA_COMPATIBLE, DISPLAY_DEVICE_REMOVABLE, DISPLAY_DEVICE_MODESPRUNED, DISPLAY_DEVICE_REMOTE, DISPLAY_DEVICE_DISCONNECT, DISPLAY_DEVICE_TS_COMPATIBLE, DISPLAY_DEVICE_UNSAFE_MODES_ON
Display device state flags.
-
DISPLAY_DEVICE_ACTIVE, DISPLAY_DEVICE_ATTACHED
Child display device state flags.
-
DM_SPECVERSION
DEVMODE
specification version.
-
DM_ORIENTATION, DM_PAPERSIZE, DM_PAPERLENGTH, DM_PAPERWIDTH, DM_SCALE, DM_POSITION, DM_NUP, DM_DISPLAYORIENTATION, DM_COPIES, DM_DEFAULTSOURCE, DM_PRINTQUALITY, DM_COLOR, DM_DUPLEX, DM_YRESOLUTION, DM_TTOPTION, DM_COLLATE, DM_FORMNAME, DM_LOGPIXELS, DM_BITSPERPEL, DM_PELSWIDTH, DM_PELSHEIGHT, DM_DISPLAYFLAGS, DM_DISPLAYFREQUENCY, DM_ICMMETHOD, DM_ICMINTENT, DM_MEDIATYPE, DM_DITHERTYPE, DM_PANNINGWIDTH, DM_PANNINGHEIGHT, DM_DISPLAYFIXEDOUTPUT
DEVMODE
field selection bits.
-
DMDO_DEFAULT, DMDO_90, DMDO_180, DMDO_270
DEVMODE
dmDisplayOrientation
specifications.
-
DMDFO_DEFAULT, DMDFO_STRETCH, DMDFO_CENTER
DEVMODE
dmDisplayFixedOutput
specifications.
-
DM_INTERLACED, DMDISPLAYFLAGS_TEXTMODE
DEVMODE
dmDisplayFlags
flags.
-
PFD_DOUBLEBUFFER, PFD_STEREO, PFD_DRAW_TO_WINDOW, PFD_DRAW_TO_BITMAP, PFD_SUPPORT_GDI, PFD_SUPPORT_OPENGL, PFD_GENERIC_FORMAT, PFD_NEED_PALETTE, PFD_NEED_SYSTEM_PALETTE, PFD_SWAP_EXCHANGE, PFD_SWAP_COPY, PFD_SWAP_LAYER_BUFFERS, PFD_GENERIC_ACCELERATED, PFD_SUPPORT_DIRECTDRAW, PFD_DIRECT3D_ACCELERATED, PFD_SUPPORT_COMPOSITION, PFD_DEPTH_DONTCARE, PFD_DOUBLEBUFFER_DONTCARE, PFD_STEREO_DONTCARE
PIXELFORMATDESCRIPTOR
flags.
-
PFD_TYPE_RGBA, PFD_TYPE_COLORINDEX
PIXELFORMATDESCRIPTOR
pixel types.
-
PFD_MAIN_PLANE, PFD_OVERLAY_PLANE, PFD_UNDERLAY_PLANE
PIXELFORMATDESCRIPTOR
layer types.
-
-
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.
-
-