예제 #1
0
  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;
  }
예제 #2
0
 protected void makeCurrentImpl() throws GLException {
   if (!Java2D.makeOGLContextCurrentOnSurface(graphics, contextHandle)) {
     throw new GLException("Error making context current");
   }
 }
예제 #3
0
 protected void destroyImpl() throws GLException {
   Java2D.destroyOGLContext(contextHandle);
 }