aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-01-09 03:51:35 +0100
committerSven Gothel <[email protected]>2012-01-09 03:51:35 +0100
commitc49d29784986b1945343b9a90b5e0c9f3d95d937 (patch)
tree96f7b12b4e230555b199235a7981ff82e3203f37 /src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
parent9e61d4529143ff3f6de15ce55f8e8747f67a86c9 (diff)
Dispatch the '5' GDI/WGL functions and allow using their 'wgl' variants. GDI is the default.
The following 5 GDI functions have their 'wgl' counterparts which 'shall' being used in case the OpenGL DLL is being loaded dynamically. (So reads the documentation & FAQ). This seems to be required only in case the std. opengl32.dll is not being used. This use case is called GDI/ICD. If using a non std. OpenGL DLL, is called MCD. We dynamically load the OpenGL DLL and fetch the address pointer. Since we generally use the std. opengl32.dll, our use of the GDI callbacks seems to be legal. However, to test using the 'wgl' method WGLUtil is introduced. You can test using the 'wgl' variants by defining the property: 'jogl.windows.useWGLVersionOf5WGLGDIFuncSet'. In case you have troubles, ie crashes within pixelformat setup etc, it might be interesting if this may impact your behavior. - ChoosePixelFormat(long, PIXELFORMATDESCRIPTOR) - DescribePixelFormat(long, int, int, PIXELFORMATDESCRIPTOR) - GetPixelFormat(long) - SetPixelFormat(long, int, PIXELFORMATDESCRIPTOR) - SwapBuffers(long)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index edcaa4a24..f02520136 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -200,8 +200,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
// set PFD if not set yet
int pfdID = -1;
boolean set = false;
- if ( 1 > ( pfdID = GDI.GetPixelFormat(hdc) ) ) {
- if (!GDI.SetPixelFormat(hdc, config.getPixelFormatID(), config.getPixelFormat())) {
+ if ( 1 > ( pfdID = WGLUtil.GetPixelFormat(hdc) ) ) {
+ if (!WGLUtil.SetPixelFormat(hdc, config.getPixelFormatID(), config.getPixelFormat())) {
throw new GLException("Unable to set pixel format " + config.getPixelFormatID() +
" for device context " + toHexString(hdc) +
": error code " + GDI.GetLastError());
@@ -311,7 +311,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps
boolean pixelFormatSet = false; // indicates a preset PFD ID [caps]
- final int presetPFDID = extHDC ? -1 : GDI.GetPixelFormat(hdc) ;
+ final int presetPFDID = extHDC ? -1 : WGLUtil.GetPixelFormat(hdc) ;
if ( 1 <= presetPFDID ) {
// Pixelformat already set by either
// - a previous preselectGraphicsConfiguration() call on the same HDC,
@@ -433,7 +433,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps
boolean pixelFormatSet = false; // indicates a preset PFD ID [caps]
- if ( !extHDC && 1 <= ( pfdID = GDI.GetPixelFormat(hdc) ) ) {
+ if ( !extHDC && 1 <= ( pfdID = WGLUtil.GetPixelFormat(hdc) ) ) {
// Pixelformat already set by either
// - a previous preselectGraphicsConfiguration() call on the same HDC,
// - the graphics driver, copying the HDC's pixelformat to the new one,
@@ -457,7 +457,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
// 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(capsChosen, pfd);
- pfdID = GDI.ChoosePixelFormat(hdc, pfd);
+ pfdID = WGLUtil.ChoosePixelFormat(hdc, pfd);
int recommendedIndex = -1 ;
if( 1 <= pfdID ) {
// seek index ..