Tabnine Logo
JCGLIndexBuffersType
Code IndexAdd Tabnine to your IDE (free)

How to use
JCGLIndexBuffersType
in
com.io7m.jcanephora.core.api

Best Java code snippets using com.io7m.jcanephora.core.api.JCGLIndexBuffersType (Showing top 20 results out of 315)

origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexUpdateNotBound()
{
 final Interfaces ii = this.getIndexBuffers("main");
 final JCGLIndexBuffersType gi = ii.getIndexBuffers();
 final JCGLIndexBufferType i = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLBufferUpdateType<JCGLIndexBufferType> u =
  JCGLBufferUpdates.newUpdateReplacingAll(i);
 gi.indexBufferUnbind();
 this.expected.expect(JCGLExceptionBufferNotBound.class);
 gi.indexBufferUpdate(u);
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexUpdateDeleted()
{
 final Interfaces ii = this.getIndexBuffers("main");
 final JCGLIndexBuffersType gi = ii.getIndexBuffers();
 final JCGLIndexBufferType i = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLBufferUpdateType<JCGLIndexBufferType> u =
  JCGLBufferUpdates.newUpdateReplacingAll(i);
 gi.indexBufferDelete(i);
 this.expected.expect(JCGLExceptionDeleted.class);
 gi.indexBufferUpdate(u);
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexReadDeleted()
{
 final Interfaces ii = this.getIndexBuffers("main");
 final JCGLIndexBuffersType gi = ii.getIndexBuffers();
 final JCGLIndexBufferType i =
  gi.indexBufferAllocate(
   100L,
   JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
   JCGLUsageHint.USAGE_STATIC_DRAW);
 gi.indexBufferDelete(i);
 this.expected.expect(JCGLExceptionDeleted.class);
 gi.indexBufferRead(i, size -> ByteBuffer.allocateDirect((int) size));
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexReallocateNotBound()
{
 final Interfaces ii = this.getIndexBuffers("main");
 final JCGLIndexBuffersType gi = ii.getIndexBuffers();
 final JCGLIndexBufferType i = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 gi.indexBufferUnbind();
 this.expected.expect(JCGLExceptionBufferNotBound.class);
 gi.indexBufferReallocate(i);
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

@Test
public final void testIndexReadNotBound()
{
 final Interfaces ii = this.getIndexBuffers("main");
 final JCGLIndexBuffersType gi = ii.getIndexBuffers();
 final JCGLIndexBufferType i =
  gi.indexBufferAllocate(
   100L,
   JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
   JCGLUsageHint.USAGE_STATIC_DRAW);
 gi.indexBufferUnbind();
 this.expected.expect(JCGLExceptionBufferNotBound.class);
 gi.indexBufferRead(i, size -> ByteBuffer.allocateDirect((int) size));
}
origin: com.io7m.jcanephora/io7m-jcanephora-async

 final long sz = size.longValue();
 final JCGLIndexBuffersType gi = g33.getIndexBuffers();
 gi.indexBufferUnbind();
 return gi.indexBufferAllocate(sz, index_type, index_usage);
}));
up -> this.g.evaluate((g33, unused) -> {
 final JCGLIndexBuffersType gi = g33.getIndexBuffers();
 gi.indexBufferBind(up.getBuffer());
 gi.indexBufferUpdate(up);
 gi.indexBufferUnbind();
 return up.getBuffer();
}));
origin: com.io7m.r2/io7m-r2-core

@Override
public void delete(final JCGLInterfaceGL33Type g)
 throws R2Exception
{
 if (!this.isDeleted()) {
  try {
   LOG.debug("delete");
   final JCGLArrayBuffersType g_ab = g.getArrayBuffers();
   final JCGLIndexBuffersType g_ib = g.getIndexBuffers();
   final JCGLArrayObjectsType g_ao = g.getArrayObjects();
   g_ao.arrayObjectDelete(this.array_object);
   g_ab.arrayBufferDelete(this.array);
   g_ib.indexBufferDelete(this.index);
  } finally {
   this.deleted = true;
  }
 }
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

@Test
public final void testDrawElementsOK()
{
 final Interfaces i = this.getInterfaces("main");
 final JCGLArrayObjectsType go = i.getArrayObjects();
 final JCGLIndexBuffersType gi = i.getIndexBuffers();
 final JCGLDrawType gd = i.getDraw();
 final JCGLIndexBufferType ib = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 gi.indexBufferUnbind();
 final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder();
 b.setIndexBuffer(ib);
 final JCGLArrayObjectType ao = go.arrayObjectAllocate(b);
 gd.drawElements(JCGLPrimitives.PRIMITIVE_POINTS);
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

@Test
public final void testIndexUpdateShared()
{
 final JCGLSharedContextPair<JCGLIndexBuffersType> p =
  this.getIndexBuffersSharedWith("main", "alt");
 final JCGLContextType ca = p.getMasterContext();
 final JCGLContextType cb = p.getSlaveContext();
 final JCGLIndexBuffersType gi = p.getMasterValue();
 final JCGLIndexBuffersType gb = p.getSlaveValue();
 Assert.assertTrue(ca.contextIsCurrent());
 Assert.assertFalse(cb.contextIsCurrent());
 final JCGLIndexBufferType i = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLBufferUpdateType<JCGLIndexBufferType> u =
  JCGLBufferUpdates.newUpdateReplacingAll(i);
 ca.contextReleaseCurrent();
 cb.contextMakeCurrent();
 gb.indexBufferBind(i);
 gb.indexBufferUpdate(u);
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

@Test
public final void testIndexRead()
{
 final Interfaces ii = this.getIndexBuffers("main");
 final JCGLIndexBuffersType gi = ii.getIndexBuffers();
 final JCGLIndexBufferType i =
  gi.indexBufferAllocate(
   100L,
   JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
   JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLBufferUpdateType<JCGLIndexBufferType> u =
  JCGLBufferUpdates.newUpdateReplacingAll(i);
 final ByteBuffer b = u.getData();
 for (int index = 0; index < 100; ++index) {
  b.put(index, (byte) 0x50);
 }
 gi.indexBufferUpdate(u);
 final ByteBuffer e =
  gi.indexBufferRead(i, size -> ByteBuffer.allocateDirect((int) size));
 for (int index = 0; index < 100; ++index) {
  Assert.assertEquals((long) b.get(index), (long) e.get(index));
 }
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testArrayBindIndexRebindDisallowed0()
{
 final Interfaces i = this.getInterfaces("main");
 final JCGLArrayBuffersType ga = i.getArrayBuffers();
 final JCGLArrayObjectsType go = i.getArrayObjects();
 final JCGLIndexBuffersType gi = i.getIndexBuffers();
 final JCGLIndexBufferType ib0 =
  gi.indexBufferAllocate(
  10L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLIndexBufferType ib1 =
  gi.indexBufferAllocate(
   10L,
   JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
   JCGLUsageHint.USAGE_STATIC_DRAW);
 gi.indexBufferUnbind();
 final JCGLArrayBufferType ab =
  ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder();
 Assert.assertTrue(b.getMaximumVertexAttributes() >= 16);
 b.setIndexBuffer(ib0);
 b.setAttributeFloatingPoint(
  0, ab, 4, JCGLScalarType.TYPE_FLOAT, 16, 0L, false);
 final JCGLArrayObjectType ao0 = go.arrayObjectAllocate(b);
 Assert.assertEquals(ao0, go.arrayObjectGetCurrentlyBound());
 this.expected.expect(JCGLExceptionIndexBufferAlreadyConfigured.class);
 gi.indexBufferBind(ib1);
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

final JCGLIndexBuffersType gi = i.getIndexBuffers();
final JCGLIndexBufferType ib = gi.indexBufferAllocate(
 100L,
 JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
Assert.assertEquals(Optional.of(ib), ai_1.indexBufferBound());
Assert.assertEquals(Optional.of(ib), ai_2.indexBufferBound());
Assert.assertEquals(Optional.of(ib), gi.indexBufferGetCurrentlyBound());
Assert.assertTrue(ai2_refs.contains(ib));
gi.indexBufferDelete(ib);
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexBufferBindIdentity()
{
 final Interfaces i = this.getIndexBuffers("name");
 final JCGLIndexBuffersType gi = i.getIndexBuffers();
 final JCGLArrayObjectsType ga = i.getArrayObjects();
 final JCGLArrayObjectUsableType a0 = ga.arrayObjectGetDefault();
 final Set<JCGLReferableType> a0_refs = a0.references();
 final JCGLIndexBufferType i0 = gi.indexBufferAllocate(
  1000L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final Set<JCGLReferenceContainerType> i0_refs = i0.referringContainers();
 Assert.assertEquals(Optional.of(i0), gi.indexBufferGetCurrentlyBound());
 Assert.assertEquals(Optional.of(i0), a0.indexBufferBound());
 Assert.assertEquals(1L, (long) a0_refs.size());
 Assert.assertTrue(a0_refs.contains(i0));
 Assert.assertEquals(1L, (long) i0_refs.size());
 Assert.assertTrue(i0_refs.contains(a0));
 gi.indexBufferUnbind();
 Assert.assertEquals(a0, ga.arrayObjectGetCurrentlyBound());
 Assert.assertEquals(Optional.empty(), gi.indexBufferGetCurrentlyBound());
 Assert.assertEquals(Optional.empty(), a0.indexBufferBound());
 Assert.assertEquals(0L, (long) a0_refs.size());
 Assert.assertEquals(0L, (long) a0_refs.size());
 Assert.assertEquals(0L, (long) i0_refs.size());
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

@Test
public final void testArrayAllocateIndexDeleted()
{
 final Interfaces is = this.getInterfaces("main");
 final JCGLArrayBuffersType ga = is.getArrayBuffers();
 final JCGLIndexBuffersType gi = is.getIndexBuffers();
 final JCGLArrayObjectsType go = is.getArrayObjects();
 final JCGLArrayBufferType a =
  ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLIndexBufferType i = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder();
 b.setIndexBuffer(i);
 gi.indexBufferDelete(i);
 this.expected.expect(JCGLExceptionDeleted.class);
 go.arrayObjectAllocate(b);
 Assert.fail();
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

@Test
public final void testIndexUpdateWrongContext()
{
 final JCGLUnsharedContextPair<JCGLIndexBuffersType> p =
  this.getIndexBuffersUnshared("main", "alt");
 final JCGLContextType ca = p.getContextA();
 final JCGLContextType cb = p.getContextB();
 final JCGLIndexBuffersType gi = p.getValueA();
 final JCGLIndexBuffersType gb = p.getValueB();
 Assert.assertFalse(ca.contextIsCurrent());
 Assert.assertTrue(cb.contextIsCurrent());
 cb.contextReleaseCurrent();
 ca.contextMakeCurrent();
 final JCGLIndexBufferType i = gi.indexBufferAllocate(
  100L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 final JCGLBufferUpdateType<JCGLIndexBufferType> u =
  JCGLBufferUpdates.newUpdateReplacingAll(i);
 ca.contextReleaseCurrent();
 cb.contextMakeCurrent();
 this.expected.expect(JCGLExceptionWrongContext.class);
 gb.indexBufferUpdate(u);
}
origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-core

@Override
public void onFinish()
{
 final JCGLArrayBuffersType g_ab = this.g.getArrayBuffers();
 final JCGLIndexBuffersType g_ib = this.g.getIndexBuffers();
 if (!this.errors.isEmpty()) {
  if (this.array_buffer != null) {
   g_ab.arrayBufferDelete(this.array_buffer);
   this.array_buffer = null;
  }
  if (this.index_buffer != null) {
   g_ib.indexBufferDelete(this.index_buffer);
   this.index_buffer = null;
  }
 }
 g_ab.arrayBufferUpdate(this.array_update);
 g_ib.indexBufferUpdate(this.index_update);
 this.array_object =
  this.g.getArrayObjects().arrayObjectAllocate(this.array_object_builder);
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexBufferBadSize()
{
 final Interfaces i = this.getIndexBuffers("name");
 final JCGLIndexBuffersType gi = i.getIndexBuffers();
 this.expected.expect(RangeCheckException.class);
 gi.indexBufferAllocate(
  -1L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
}
origin: com.io7m.jcanephora/com.io7m.jcanephora.tests

@Test
public final void testIndexBufferReallocateIdentity()
{
 final Interfaces i = this.getIndexBuffers("name");
 final JCGLIndexBuffersType gi = i.getIndexBuffers();
 final JCGLIndexBufferType i0 = gi.indexBufferAllocate(
  1000L,
  JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
  JCGLUsageHint.USAGE_STATIC_DRAW);
 Assert.assertEquals(1000L, i0.indices());
 Assert.assertEquals(JCGLUnsignedType.TYPE_UNSIGNED_BYTE, i0.type());
 Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, i0.usageHint());
 Assert.assertFalse(i0.isDeleted());
 gi.indexBufferReallocate(i0);
 Assert.assertEquals(1000L, i0.indices());
 Assert.assertEquals(JCGLUnsignedType.TYPE_UNSIGNED_BYTE, i0.type());
 Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, i0.usageHint());
 Assert.assertFalse(i0.isDeleted());
}
origin: com.io7m.jcanephora/io7m-jcanephora-tests

final JCGLIndexBufferType i = gi.indexBufferAllocate(
 100L,
 JCGLUnsignedType.TYPE_UNSIGNED_BYTE,
Assert.assertEquals(Optional.of(i), gi.indexBufferGetCurrentlyBound());
Assert.assertEquals(Optional.of(i), ai.getIndexBufferBound());
origin: com.io7m.r2/io7m-r2-tests

g_ao.arrayObjectBind(adapter.arrayObject());
final ByteBuffer data = g_ib.indexBufferRead(
 ib, size -> {
  final ByteBuffer b = ByteBuffer.allocateDirect((int) size);
com.io7m.jcanephora.core.apiJCGLIndexBuffersType

Javadoc

The interface to OpenGL index buffers.

Most used methods

  • indexBufferAllocate
    Allocate and bind an index buffer of indices values of type type, informing the implementation that
  • indexBufferDelete
    Deletes the buffer referenced by a. Calling this method will unbind a iff it is bound.
  • indexBufferUpdate
    Perform the index buffer update u.
  • indexBufferUnbind
    Unbind the current index buffer. If no buffer is bound, this call has no effect.
  • indexBufferBind
    Bind the given index buffer.
  • indexBufferRead
  • indexBufferGetCurrentlyBound
  • indexBufferReallocate
    Reallocate the storage associated with the index buffer i. This is intended to facilitate streaming

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Kernel (java.awt.image)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now