From 9ccb31416e0800fdd90c6b814cc079beb866b202 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 2 Jan 2006 13:49:36 +0000 Subject: [PATCH] Added Display.releaseContext() --- src/java/org/lwjgl/opengl/Display.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index 52892571..e7ece097 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -592,7 +592,20 @@ public final class Display { } /** - * Make the Display the current rendering context for GL calls. Also initialize native stubs. + * Release the Display context. + * + * @throws LWJGLException If the context could not be released + */ + public void releaseContext() throws LWJGLException { + if (!isCreated()) + throw new IllegalStateException("No window created to make current"); + if (context.isCurrent()) + Context.releaseCurrentContext(); + } + + /** + * Make the Display the current rendering context for GL calls. + * * @throws LWJGLException If the context could not be made current */ public static void makeCurrent() throws LWJGLException {