mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 14:35:58 +00:00
Win32: Handle context-dependent wgl extensions
This commit is contained in:
parent
f9400843aa
commit
a5469e6ff3
8 changed files with 277 additions and 205 deletions
|
|
@ -94,9 +94,14 @@ final class Win32ContextImplementation implements ContextImplementation {
|
|||
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
|
||||
|
||||
public void setVSync(boolean enabled) {
|
||||
nSetVSync(enabled);
|
||||
Context current_context = Context.getCurrentContext();
|
||||
if (current_context == null)
|
||||
throw new IllegalStateException("No context is current");
|
||||
synchronized (current_context) {
|
||||
nSetVSync(current_context.getHandle(), enabled);
|
||||
}
|
||||
}
|
||||
private static native void nSetVSync(boolean enabled);
|
||||
private static native void nSetVSync(ByteBuffer context_handle, boolean enabled);
|
||||
|
||||
public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
|
||||
nDestroy(handle);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,17 @@ final class Win32Display implements DisplayImplementation {
|
|||
}
|
||||
|
||||
public native void destroyCursor(Object cursorHandle);
|
||||
public native int getPbufferCapabilities();
|
||||
public int getPbufferCapabilities() {
|
||||
try {
|
||||
// Return the capabilities of a minimum pixel format
|
||||
return nGetPbufferCapabilities(new PixelFormat(0, 0, 0, 0, 0, 0, 0, 0, false));
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred while determining pbuffer capabilities: " + e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
private native int nGetPbufferCapabilities(PixelFormat format) throws LWJGLException;
|
||||
|
||||
public boolean isBufferLost(PeerInfo handle) {
|
||||
return ((Win32PbufferPeerInfo)handle).isBufferLost();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue