protected boolean createImpl(GLContextImpl shareWith) { long share = createImplPreset(shareWith); long ctx = Java2D.createOGLContextOnSurface(graphics, share); if (ctx == 0) { if (DEBUG) { System.err.println("Error creating current: " + this); } return false; } if (!Java2D.makeOGLContextCurrentOnSurface(graphics, contextHandle)) { Java2D.destroyOGLContext(ctx); if (DEBUG) { System.err.println("Error making created context current: " + this); } return false; } setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false); // use GL_VERSION contextHandle = ctx; return true; }
protected void makeCurrentImpl() throws GLException { if (!Java2D.makeOGLContextCurrentOnSurface(graphics, contextHandle)) { throw new GLException("Error making context current"); } }
protected void destroyImpl() throws GLException { Java2D.destroyOGLContext(contextHandle); }