Codota Logo
CLGLContext
Code IndexAdd Codota to your IDE (free)

How to use
CLGLContext
in
com.jogamp.opencl.gl

Best Java code snippets using com.jogamp.opencl.gl.CLGLContext (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: jMonkeyEngine/jmonkeyengine

  CLGLContext c = CLGLContext.create(GLContext.getCurrent(), devices.toArray(new CLDevice[devices.size()]));
  clContext = new com.jme3.opencl.jocl.JoclContext(c, (List<JoclDevice>) choosenDevices);
} catch (Exception ex) {
origin: org.jogamp.jocl/jocl

/**
 * Creates a shared context on the specified platform and with the specified
 * device types.
 * @see GLContext#makeCurrent()
 */
public static CLGLContext create(final GLContext glContext, CLPlatform platform, final CLDevice.Type... deviceTypes) {
  if(platform == null) {
    platform = CLPlatform.getDefault();
  }
  final long[] glID = new long[1];
  final PointerBuffer properties = setupContextProperties(platform, glContext, glID);
  final ErrorDispatcher dispatcher = createErrorHandler();
  final long clID = createContextFromType(platform, dispatcher, properties, toDeviceBitmap(deviceTypes));
  return new CLGLContext(platform, glContext, clID, glID[0], dispatcher);
}
origin: org.jogamp.jocl/jocl

/**
 * Creates a shared context on the specified platform and with the specified
 * devices.
 * @see GLContext#makeCurrent()
 */
public static CLGLContext create(final GLContext glContext, final CLDevice... devices) {
  if(devices == null) {
    throw new IllegalArgumentException("no devices specified");
  }else if(devices[0] == null) {
    throw new IllegalArgumentException("first device was null");
  }
  final CLPlatform platform = devices[0].getPlatform();
  final long[] glID = new long[1];
  final PointerBuffer properties = setupContextProperties(platform, glContext, glID);
  final ErrorDispatcher dispatcher = createErrorHandler();
  final long clID = createContext(platform, dispatcher, properties, devices);
  final CLGLContext context = new CLGLContext(platform, glContext, clID, glID[0], dispatcher);
  if(devices != null) {
    for (int i = 0; i < devices.length; i++) {
      context.overrideContext(devices[i]);
    }
  }
  return context;
}
origin: org.bytedeco/javacv

public GLContext getGLContext() {
  return context instanceof CLGLContext ? ((CLGLContext)context).getGLContext() : null;
}
origin: org.jogamp.jocl/jocl

public final CLGLImage2d<?> createFromGLRenderbuffer(final int glBuffer, final int flags) {
  return createFromGLRenderbuffer(null, glBuffer, flags);
}
origin: org.bytedeco/javacv

CLImageFormat f = new CLImageFormat(CLImageFormat.ChannelOrder.RGBA, CLImageFormat.ChannelType.FLOAT);
for (int i = minLevel; i <= maxLevel; i++) {
  templateCL   [i] = i == minLevel && template0 != null ? template0 : c.createImage2d(w, h, f);
  targetCL     [i] = i == minLevel && target0   != null ? target0   : c.createImage2d(w, h, f);
  transformedCL[i] = c.createImage2d(w, h, f);
  residualCL   [i] = c.createImage2d(w, h, f);
  gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, maskrb[i]);
  gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, maskfb[i]);
  gl.glFramebufferRenderbuffer(GL2.GL_FRAMEBUFFER, GL2.GL_COLOR_ATTACHMENT0, GL2.GL_RENDERBUFFER, maskrb[i]);
  assert gl.glCheckFramebufferStatus(GL2.GL_FRAMEBUFFER) == GL2.GL_FRAMEBUFFER_COMPLETE;
  maskCL[i] = c.createFromGLRenderbuffer(maskrb[i]);
  System.out.println(maskCL[i] + " " + maskCL[i].getElementSize() + " " + maskCL[i].getFormat());
  w /= 2;
origin: org.jogamp.jocl/jocl

/**
 * Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.
 * @param glBuffer The OpenGL buffer handle like a vertex buffer or pixel buffer object.
 * @param glBufferSize The size of the OpenGL buffer in bytes
 * @param flags optional flags.
 */
public final CLGLBuffer<?> createFromGLBuffer(final int glBuffer, final long glBufferSize, final int flags) {
  return createFromGLBuffer(null, glBuffer, glBufferSize, flags);
}
origin: org.jogamp.jocl/jocl

public final CLGLTexture2d<?> createFromGLTexture2d(final int target, final int texture, final int mipmap, final int flags) {
  return createFromGLTexture2d(null, target, texture, mipmap, flags);
}
origin: org.jogamp.jocl/jocl

@Override
public GLContext getGLContext() {
  return getContext().getGLContext();
}
origin: org.jogamp.jocl/jocl

public final <B extends Buffer> CLGLImage2d<B> createFromGLRenderbuffer(final B directBuffer, final int glBuffer, final Mem... flags) {
  return createFromGLRenderbuffer(directBuffer, glBuffer, Mem.flagsToInt(flags));
}
origin: org.jogamp.jocl/jocl

/**
 * Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.
 * @param glBuffer The OpenGL buffer handle like a vertex buffer or pixel buffer object.
 * @param glBufferSize The size of the OpenGL buffer in bytes
 * @param flags optional flags.
 */
public final CLGLBuffer<?> createFromGLBuffer(final int glBuffer, final long glBufferSize, final Mem... flags) {
  return createFromGLBuffer(null, glBuffer, glBufferSize, Mem.flagsToInt(flags));
}
origin: org.jogamp.jocl/jocl

public final CLGLTexture2d<?> createFromGLTexture2d(final int target, final int texture, final int mipmap, final Mem... flags) {
  return createFromGLTexture2d(null, target, texture, mipmap, Mem.flagsToInt(flags));
}
origin: org.jogamp.jocl/jocl

/**
 * Creates a shared context on the specified platform and with the specified
 * device types.
 * @see GLContext#makeCurrent()
 */
public static CLGLContext create(final GLContext glContext, final CLDevice.Type... deviceTypes) {
  return create(glContext, null, deviceTypes);
}
origin: org.jogamp.jocl/jocl

@Override
public GLContext getGLContext() {
  return getContext().getGLContext();
}
origin: org.jogamp.jocl/jocl

public final CLGLImage2d<?> createFromGLRenderbuffer(final int glBuffer, final Mem... flags) {
  return createFromGLRenderbuffer(null, glBuffer, Mem.flagsToInt(flags));
}
origin: org.jogamp.jocl/jocl

/**
 * Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.
 * @param directBuffer A direct allocated NIO buffer for data transfers between java and OpenCL.
 * @param glBuffer The OpenGL buffer handle like a vertex buffer or pixel buffer object.
 * @param glBufferSize The size of the OpenGL buffer in bytes
 * @param flags optional flags.
 */
public final <B extends Buffer> CLGLBuffer<B> createFromGLBuffer(final B directBuffer, final int glBuffer, final long glBufferSize, final Mem... flags) {
  return createFromGLBuffer(directBuffer, glBuffer, glBufferSize, Mem.flagsToInt(flags));
}
origin: org.jogamp.jocl/jocl

public final <B extends Buffer> CLGLTexture2d<B> createFromGLTexture2d(final B directBuffer, final int target, final int texture, final int mipmap, final Mem... flags) {
  return createFromGLTexture2d(directBuffer, target, texture, mipmap, Mem.flagsToInt(flags));
}
origin: org.jogamp.jocl/jocl

/**
 * Creates a shared context on all available devices (CL_DEVICE_TYPE_ALL).
 * @see GLContext#makeCurrent()
 */
public static CLGLContext create(final GLContext glContext) {
  return create(glContext, (CLPlatform)null, CLDevice.Type.ALL);
}
origin: org.jogamp.jocl/jocl

@Override
public GLContext getGLContext() {
  return getContext().getGLContext();
}
origin: org.bytedeco/javacv

gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, renderBuffer[0]);
gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER, format, width, height);
return getCLGLContext().createFromGLRenderbuffer(renderBuffer[0], flags);
com.jogamp.opencl.glCLGLContext

Javadoc

OpenCL Context supporting JOGL-JOCL interoperablity.

Most used methods

  • create
    Creates a shared context on the specified platform and with the specified devices.
  • createFromGLRenderbuffer
  • getGLContext
    Returns the OpenGL context this context was shared with.
  • <init>
  • createContext
  • createContextFromType
  • createErrorHandler
  • createFromGLBuffer
    Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.
  • createFromGLTexture2d
  • createFromGLTexture3d
  • createImage2d
  • overrideContext
  • createImage2d,
  • overrideContext,
  • setupContextProperties,
  • toDeviceBitmap

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now