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