Package panamagl.platform.windows
Class WGLContext_windows
java.lang.Object
panamagl.opengl.AGLContext
panamagl.platform.windows.WGLContext_windows
- All Implemented Interfaces:
panamagl.opengl.GLContext
public class WGLContext_windows
extends panamagl.opengl.AGLContext
implements panamagl.opengl.GLContext
WIP Windows context
- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected MemorySegmentprotected booleanprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected int[]Fields inherited from class panamagl.opengl.AGLContext
arena, initialized, profile -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MemorySegmentCreate a minimal invisible 1x1 popup window whose sole purpose is to provide a valid HWND+DC for WGL pixel format selection and context creation.voiddestroy()intprotected panamagl.opengl.GLErrorRetrieve last error code while setting up the WGL context.voidinit()protected voidInit context the advanced wayprotected voidFunction pointers for advanced context initialization.protected voidinitHDC()Retrieve a handle to the device context required for initializing the WGL context.protected voidInit context the simpl wayvoidvoidsetWindowHandle(int handle) Methods inherited from class panamagl.opengl.AGLContext
getProfile, initArena, isInitialized, setProfileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface panamagl.opengl.GLContext
getProfile, isInitialized, setProfile
-
Field Details
-
windowHandle
protected int[] windowHandle -
hWnd
-
hdc
-
context
-
debug
protected boolean debug -
advanced
protected boolean advanced -
wglChoosePixelFormatARB
-
wglCreateContextAttribsARB
-
-
Constructor Details
-
WGLContext_windows
public WGLContext_windows() -
WGLContext_windows
public WGLContext_windows(boolean advanced)
-
-
Method Details
-
init
public void init()- Specified by:
initin interfacepanamagl.opengl.GLContext
-
destroy
public void destroy()- Specified by:
destroyin interfacepanamagl.opengl.GLContext
-
makeCurrent
public void makeCurrent() -
initSimple
protected void initSimple()Init context the simpl way -
initAdvanced
protected void initAdvanced()Init context the advanced way -
initFunctions
protected void initFunctions()Function pointers for advanced context initialization. -
initHDC
protected void initHDC()Retrieve a handle to the device context required for initializing the WGL context. When no window handle is provided, a small invisible dummy window is created to obtain a valid HWND-based DC. GetDC(NULL) (screen DC) must not be used: it is not valid for WGL context creation with modern drivers such as Mesa that require a real HWND to set up their rendering backend. -
createDummyWindow
Create a minimal invisible 1x1 popup window whose sole purpose is to provide a valid HWND+DC for WGL pixel format selection and context creation. CS_OWNDC ensures the DC is permanently associated with the window (required by WGL). -
getWindowsLastError
protected panamagl.opengl.GLError getWindowsLastError()Retrieve last error code while setting up the WGL context. Different from GL error. -
getWindowHandle
public int getWindowHandle() -
setWindowHandle
public void setWindowHandle(int handle)
-