Package org.lwjgl.opengl
Class WGL
- java.lang.Object
-
- org.lwjgl.opengl.WGL
-
public class WGL extends java.lang.Object
Native bindings to WGL functionality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
WGL.Functions
Contains the function pointers loaded fromGL.getFunctionProvider()
.
-
Field Summary
Fields Modifier and Type Field and Description static int
WGL_FONT_LINES
WGL_FONT_POLYGONSUseFontOutlines format.static int
WGL_SWAP_MAIN_PLANE
WGL_SWAP_OVERLAY1
WGL_SWAP_OVERLAY10
WGL_SWAP_OVERLAY11
WGL_SWAP_OVERLAY12
WGL_SWAP_OVERLAY13
WGL_SWAP_OVERLAY14
WGL_SWAP_OVERLAY15
WGL_SWAP_OVERLAY2
WGL_SWAP_OVERLAY3
WGL_SWAP_OVERLAY4
WGL_SWAP_OVERLAY5
WGL_SWAP_OVERLAY6
WGL_SWAP_OVERLAY7
WGL_SWAP_OVERLAY8
WGL_SWAP_OVERLAY9
WGL_SWAP_UNDERLAY1
WGL_SWAP_UNDERLAY10
WGL_SWAP_UNDERLAY11
WGL_SWAP_UNDERLAY12
WGL_SWAP_UNDERLAY13
WGL_SWAP_UNDERLAY14
WGL_SWAP_UNDERLAY15
WGL_SWAP_UNDERLAY2
WGL_SWAP_UNDERLAY3
WGL_SWAP_UNDERLAY4
WGL_SWAP_UNDERLAY5
WGL_SWAP_UNDERLAY6
WGL_SWAP_UNDERLAY7
WGL_SWAP_UNDERLAY8
WGL_SWAP_UNDERLAY9SwapLayerBuffers flags.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static boolean
wglCopyContext(long src, long dst, int mask)
Copies selected groups of rendering states from one OpenGL rendering context to another.static long
wglCreateContext(long hdc)
Creates a new OpenGL rendering context, which is suitable for drawing on the device referenced by device.static long
wglCreateLayerContext(long hdc, int layerPlane)
Creates a new OpenGL rendering context for drawing to a specified layer plane on a device context.static boolean
wglDeleteContext(long context)
Deletes a specified OpenGL rendering context.static long
wglGetCurrentContext()
Obtains a handle to the current OpenGL rendering context of the calling thread.static long
wglGetCurrentDC()
Obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread.static long
wglGetProcAddress(java.nio.ByteBuffer proc)
Returns the address of an OpenGL extension function for use with the current OpenGL rendering context.static long
wglGetProcAddress(java.lang.CharSequence proc)
Returns the address of an OpenGL extension function for use with the current OpenGL rendering context.static boolean
wglMakeCurrent(long hdc, long hglrc)
Makes a specified OpenGL rendering context the calling thread's current rendering context.static boolean
wglShareLists(long hglrc1, long hglrc2)
Enables multiple OpenGL rendering contexts to share a single display-list space.static boolean
wglUseFontBitmaps(long hdc, int first, int count, int listBase)
Creates a set of bitmap display lists for use in the current OpenGL rendering context.static boolean
wglUseFontOutlines(long hdc, int first, int listBase, float deviation, float extrusion, int format, org.lwjgl.system.windows.GLYPHMETRICSFLOAT.Buffer glyphMetrics)
Creates a set of display lists, one for each glyph of the currently selected outline font of a device context, for use with the current rendering context.
-
-
-
Field Detail
-
WGL_FONT_LINES, WGL_FONT_POLYGONS
UseFontOutlines format.
-
WGL_SWAP_MAIN_PLANE, WGL_SWAP_OVERLAY1, WGL_SWAP_OVERLAY2, WGL_SWAP_OVERLAY3, WGL_SWAP_OVERLAY4, WGL_SWAP_OVERLAY5, WGL_SWAP_OVERLAY6, WGL_SWAP_OVERLAY7, WGL_SWAP_OVERLAY8, WGL_SWAP_OVERLAY9, WGL_SWAP_OVERLAY10, WGL_SWAP_OVERLAY11, WGL_SWAP_OVERLAY12, WGL_SWAP_OVERLAY13, WGL_SWAP_OVERLAY14, WGL_SWAP_OVERLAY15, WGL_SWAP_UNDERLAY1, WGL_SWAP_UNDERLAY2, WGL_SWAP_UNDERLAY3, WGL_SWAP_UNDERLAY4, WGL_SWAP_UNDERLAY5, WGL_SWAP_UNDERLAY6, WGL_SWAP_UNDERLAY7, WGL_SWAP_UNDERLAY8, WGL_SWAP_UNDERLAY9, WGL_SWAP_UNDERLAY10, WGL_SWAP_UNDERLAY11, WGL_SWAP_UNDERLAY12, WGL_SWAP_UNDERLAY13, WGL_SWAP_UNDERLAY14, WGL_SWAP_UNDERLAY15
SwapLayerBuffers flags.
-
-
Method Detail
-
wglCreateContext
public static long wglCreateContext(long hdc)
Creates a new OpenGL rendering context, which is suitable for drawing on the device referenced by device. The rendering context has the same pixel format as the device context.- Parameters:
hdc
- handle to a device context for which the function creates a suitable OpenGL rendering context
-
wglCreateLayerContext
public static long wglCreateLayerContext(long hdc, int layerPlane)
Creates a new OpenGL rendering context for drawing to a specified layer plane on a device context.- Parameters:
hdc
- the device context for a new rendering contextlayerPlane
- the layer plane to which you want to bind a rendering context. The value 0 identifies the main plane. Positive values oflayerPlace
identify overlay planes, where 1 is the first overlay plane over the main plane, 2 is the second overlay plane over the first overlay plane, and so on. Negative values identify underlay planes, where 1 is the first underlay plane under the main plane, 2 is the second underlay plane under the first underlay plane, and so on. The number of overlay and underlay planes is given in thereserved
member of thePIXELFORMATDESCRIPTOR
structure.
-
wglCopyContext
public static boolean wglCopyContext(long src, long dst, int mask)
Copies selected groups of rendering states from one OpenGL rendering context to another.- Parameters:
src
- the source OpenGL rendering context whose state information is to be copieddst
- the destination OpenGL rendering context to which state information is to be copiedmask
- which groups of thesrc
rendering state are to be copied todst
. It contains the bitwise-OR of the same symbolic names that are passed to thePushAttrib
function. You can useALL_ATTRIB_BITS
to copy all the rendering state information.
-
wglDeleteContext
public static boolean wglDeleteContext(long context)
Deletes a specified OpenGL rendering context.- Parameters:
context
- handle to an OpenGL rendering context that the function will delete
-
wglGetCurrentContext
public static long wglGetCurrentContext()
Obtains a handle to the current OpenGL rendering context of the calling thread.
-
wglGetCurrentDC
public static long wglGetCurrentDC()
Obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread.
-
wglGetProcAddress
public static long wglGetProcAddress(java.nio.ByteBuffer proc) public static long wglGetProcAddress(java.lang.CharSequence proc)
Returns the address of an OpenGL extension function for use with the current OpenGL rendering context.- Parameters:
proc
- points to a null-terminated string that is the name of the extension function. The name of the extension function must be identical to a corresponding function implemented by OpenGL.
-
wglMakeCurrent
public static boolean wglMakeCurrent(long hdc, long hglrc)
Makes a specified OpenGL rendering context the calling thread's current rendering context. All subsequent OpenGL calls made by the thread are drawn on the device identified by device. You can also use MakeCurrent to change the calling thread's current rendering context so it's no longer current.- Parameters:
hdc
- handle to a device context. Subsequent OpenGL calls made by the calling thread are drawn on the device identified bydc
.hglrc
- handle to an OpenGL rendering context that the function sets as the calling thread's rendering context. Ifcontext
isNULL
, the function makes the calling thread's current rendering context no longer current, and releases the device context that is used by the rendering context. In this case,hdc
is ignored.
-
wglShareLists
public static boolean wglShareLists(long hglrc1, long hglrc2)
Enables multiple OpenGL rendering contexts to share a single display-list space.- Parameters:
hglrc1
- the OpenGL rendering context with which to share display lists.hglrc2
- the OpenGL rendering context to share display lists withhglrc1
. Thehglrc2
parameter should not contain any existing display lists whenwglShareLists
is called.
-
wglUseFontBitmaps
public static boolean wglUseFontBitmaps(long hdc, int first, int count, int listBase)
Creates a set of bitmap display lists for use in the current OpenGL rendering context. The set of bitmap display lists is based on the glyphs in the currently selected font in the device context. You can then use bitmaps to draw characters in an OpenGL image.Creates count display lists, one for each of a run of count glyphs that begins with the first glyph in the device parameter's selected fonts.
- Parameters:
hdc
- the device context whose currently selected font will be used to form the glyph bitmap display lists in the current OpenGL rendering contextfirst
- the first glyph in the run of glyphs that will be used to form glyph bitmap display listscount
- the number of glyphs in the run of glyphs that will be used to form glyph bitmap display lists. The function creates count display lists, one for each glyph in the run.listBase
- the starting display list
-
wglUseFontOutlines
public static boolean wglUseFontOutlines(long hdc, int first, int listBase, float deviation, float extrusion, int format, org.lwjgl.system.windows.GLYPHMETRICSFLOAT.Buffer glyphMetrics)
Creates a set of display lists, one for each glyph of the currently selected outline font of a device context, for use with the current rendering context. The display lists are used to draw 3-D characters of TrueType fonts. Each display list describes a glyph outline in floating-point coordinates.The run of glyphs begins with thefirstglyph of the font of the specified device context. The em square size of the font, the notional grid size of the original font outline from which the font is fitted, is mapped to 1.0 in the x- and y-coordinates in the display lists. The extrusion parameter sets how much depth the font has in the z direction.
The glyphMetrics parameter returns a
GLYPHMETRICSFLOAT
structure that contains information about the placement and orientation of each glyph in a character cell.- Parameters:
hdc
- the device context with the desired outline font. The outline font ofdc
is used to create the display lists in the current rendering context.first
- the first of the set of glyphs that form the font outline display listslistBase
- the starting display listdeviation
- the maximum chordal deviation from the original outlines. When deviation is zero, the chordal deviation is equivalent to one design unit of the original font. The value of deviation must be equal to or greater than 0.extrusion
- how much a font is extruded in the negative z direction. The value must be equal to or greater than 0. When extrusion is 0, the display lists are not extruded.format
- the format to use in the display lists. When format isFONT_LINES
, thewglUseFontOutlines
function creates fonts with line segments. When format isFONT_POLYGONS
,wglUseFontOutlines
creates fonts with polygons. One of:FONT_LINES
FONT_POLYGONS
glyphMetrics
- an array ofcount
GLYPHMETRICSFLOAT
structures that is to receive the metrics of the glyphs. WhenglyphMetrics
isNULL
, no glyph metrics are returned.
-
-