/** * Disposes all textures / buffers that were allocated by this context. */ public void disposeAll() { cc.stop(); if (context != null) { context.disposeAll(); } context = null; }
public void wrapNewContext() { if(cc instanceof JAWTContextCreator) ((JAWTContextCreator)cc).makeCurrent(true); if(context != null) context.disposeAll(); GLCapabilities caps = GL.createCapabilities(); if(caps.OpenGL20) { context = new LWJGL20DrawContext(caps, debug); } else if(caps.OpenGL15 && caps.GL_ARB_texture_non_power_of_two) { context = new LWJGL15DrawContext(caps, debug); } else { context = null; errorGLVersion(); } }