I like those makeContextCurrent/releaseContext...
This commit is contained in:
parent
bc33d3ff2b
commit
d58c8b767b
|
@ -170,4 +170,14 @@ public class BaseGL extends Window {
|
||||||
*/
|
*/
|
||||||
private native void nDestroyGL();
|
private native void nDestroyGL();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make the GL context current to the current thread
|
||||||
|
*/
|
||||||
|
public native void makeContextCurrent();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release the GL context
|
||||||
|
*/
|
||||||
|
public native void releaseContext();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,22 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroyGL
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroyGL
|
||||||
(JNIEnv *, jobject);
|
(JNIEnv *, jobject);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_lwjgl_opengl_BaseGL
|
||||||
|
* Method: makeContextCurrent
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_makeContextCurrent
|
||||||
|
(JNIEnv *, jobject);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_lwjgl_opengl_BaseGL
|
||||||
|
* Method: releaseContext
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_releaseContext
|
||||||
|
(JNIEnv *, jobject);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -190,7 +190,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers(JNIEnv * env, jo
|
||||||
* Method: nMakeCurrent
|
* Method: nMakeCurrent
|
||||||
* Signature: ()V
|
* Signature: ()V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nMakeCurrent
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_makeContextCurrent
|
||||||
(JNIEnv * env, jobject obj)
|
(JNIEnv * env, jobject obj)
|
||||||
{
|
{
|
||||||
makeCurrent();
|
makeCurrent();
|
||||||
|
@ -201,7 +201,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nMakeCurrent
|
||||||
* Method: nFreeContext
|
* Method: nFreeContext
|
||||||
* Signature: ()V
|
* Signature: ()V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nReleaseContext
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_releaseContext
|
||||||
(JNIEnv *, jobject)
|
(JNIEnv *, jobject)
|
||||||
{
|
{
|
||||||
releaseContext();
|
releaseContext();
|
||||||
|
|
|
@ -218,4 +218,25 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers
|
||||||
{
|
{
|
||||||
SwapBuffers(wglGetCurrentDC());
|
SwapBuffers(wglGetCurrentDC());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_lwjgl_opengl_BaseGL
|
||||||
|
* Method: nMakeCurrent
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_makeContextCurrent
|
||||||
|
(JNIEnv * env, jobject obj)
|
||||||
|
{
|
||||||
|
wglMakeCurrent(hdc, hglrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* * Class: org_lwjgl_opengl_BaseGL
|
||||||
|
* * Method: nFreeContext
|
||||||
|
* * Signature: ()V
|
||||||
|
* */
|
||||||
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_releaseContext
|
||||||
|
(JNIEnv *, jobject)
|
||||||
|
{
|
||||||
|
wglMakeCurrent(NULL, NULL);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue