@Test public final void testContextMakeCurrentAlreadyCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); this.expected.expect(JCGLExceptionContextIsCurrent.class); c0.contextMakeCurrent(); }
@Test public final void testContextMakeCurrentAlreadyCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); this.expected.expect(JCGLExceptionContextIsCurrent.class); c0.contextMakeCurrent(); }
@Test public final void testContextDestroyedMakeCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextMakeCurrent(); }
@Test public final void testContextDestroyedMakeCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextMakeCurrent(); }
@Test public final void testContextMakeCurrentIsCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); Assert.assertFalse(c0.contextIsCurrent()); c0.contextMakeCurrent(); Assert.assertTrue(c0.contextIsCurrent()); }
@Test public final void testContextMakeCurrentIsCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); Assert.assertFalse(c0.contextIsCurrent()); c0.contextMakeCurrent(); Assert.assertTrue(c0.contextIsCurrent()); }
@Test public final void testVertexShaderDeleteWrongContext() { final JCGLUnsharedContextPair<JCGLShadersType> cp = this.getShadersUnshared("main", "alt"); final JCGLContextType c0 = cp.getContextA(); final JCGLShadersType s0 = cp.getValueA(); final JCGLContextType c1 = cp.getContextB(); final JCGLShadersType s1 = cp.getValueB(); Assert.assertFalse(c0.contextIsCurrent()); Assert.assertTrue(c1.contextIsCurrent()); c1.contextReleaseCurrent(); c0.contextMakeCurrent(); final JCGLVertexShaderType v = s0.shaderCompileVertex("valid0", this.getShaderLines("valid0.vert")); c0.contextReleaseCurrent(); c1.contextMakeCurrent(); this.expected.expect(JCGLExceptionWrongContext.class); s1.shaderDeleteVertex(v); }
@Test public final void testArrayBindShared() { final JCGLSharedContextPair<JCGLArrayBuffersType> p = this.getArrayBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLArrayBuffersType ga = p.getMasterValue(); final JCGLArrayBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.arrayBufferBind(a); }
@Test public final void testFramebufferBuildWrongContextAllocate() { final Interfaces im = this.getInterfaces("main"); final Interfaces ia = this.getInterfaces("alt"); final JCGLFramebuffersType g_fb_main = im.getFramebuffers(); final JCGLFramebuffersType g_fb_alt = ia.getFramebuffers(); Assert.assertFalse(im.context.contextIsCurrent()); Assert.assertTrue(ia.context.contextIsCurrent()); final JCGLFramebufferBuilderType fbb = g_fb_alt.framebufferNewBuilder(); ia.context.contextReleaseCurrent(); im.context.contextMakeCurrent(); this.expected.expect(JCGLExceptionWrongContext.class); g_fb_main.framebufferAllocate(fbb); }
@Test public final void testFramebufferBuildWrongContextAllocate() { final Interfaces im = this.getInterfaces("main"); final Interfaces ia = this.getInterfaces("alt"); final JCGLFramebuffersType g_fb_main = im.getFramebuffers(); final JCGLFramebuffersType g_fb_alt = ia.getFramebuffers(); Assert.assertFalse(im.context.contextIsCurrent()); Assert.assertTrue(ia.context.contextIsCurrent()); final JCGLFramebufferBuilderType fbb = g_fb_alt.framebufferNewBuilder(); ia.context.contextReleaseCurrent(); im.context.contextMakeCurrent(); this.expected.expect(JCGLExceptionWrongContext.class); g_fb_main.framebufferAllocate(fbb); }
@Test public final void testArrayDeleteShared() { final JCGLSharedContextPair<JCGLArrayBuffersType> p = this.getArrayBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLArrayBuffersType ga = p.getMasterValue(); final JCGLArrayBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.arrayBufferDelete(a); }
@Test public final void testArrayBindShared() { final JCGLSharedContextPair<JCGLArrayBuffersType> p = this.getArrayBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLArrayBuffersType ga = p.getMasterValue(); final JCGLArrayBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.arrayBufferBind(a); }
@Test public final void testArrayDeleteShared() { final JCGLSharedContextPair<JCGLArrayBuffersType> p = this.getArrayBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLArrayBuffersType ga = p.getMasterValue(); final JCGLArrayBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.arrayBufferDelete(a); }
@Test public final void testArrayUpdateShared() { final JCGLSharedContextPair<JCGLArrayBuffersType> p = this.getArrayBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLArrayBuffersType ga = p.getMasterValue(); final JCGLArrayBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.arrayBufferBind(a); gb.arrayBufferUpdate(u); }
@Test public final void testArrayUpdateShared() { final JCGLSharedContextPair<JCGLArrayBuffersType> p = this.getArrayBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLArrayBuffersType ga = p.getMasterValue(); final JCGLArrayBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.arrayBufferBind(a); gb.arrayBufferUpdate(u); }
@Test public final void testFragmentShaderDeleteSharedContext() { final JCGLSharedContextPair<JCGLShadersType> cp = this.getShadersSharedWith("main", "alt"); final JCGLContextType c0 = cp.getMasterContext(); final JCGLShadersType s0 = cp.getMasterValue(); final JCGLContextType c1 = cp.getSlaveContext(); final JCGLShadersType s1 = cp.getSlaveValue(); Assert.assertTrue(c0.contextIsCurrent()); Assert.assertFalse(c1.contextIsCurrent()); final JCGLFragmentShaderType f = s0.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); c0.contextReleaseCurrent(); c1.contextMakeCurrent(); s1.shaderDeleteFragment(f); Assert.assertTrue(f.isDeleted()); }
@Test public final void testGeometryShaderDeleteSharedContext() { final JCGLSharedContextPair<JCGLShadersType> cp = this.getShadersSharedWith("main", "alt"); final JCGLContextType c0 = cp.getMasterContext(); final JCGLShadersType s0 = cp.getMasterValue(); final JCGLContextType c1 = cp.getSlaveContext(); final JCGLShadersType s1 = cp.getSlaveValue(); Assert.assertTrue(c0.contextIsCurrent()); Assert.assertFalse(c1.contextIsCurrent()); final JCGLGeometryShaderType g = s0.shaderCompileGeometry("valid0", this.getShaderLines("valid0.geom")); c0.contextReleaseCurrent(); c1.contextMakeCurrent(); s1.shaderDeleteGeometry(g); Assert.assertTrue(g.isDeleted()); }
@Test public final void testGeometryShaderDeleteSharedContext() { final JCGLSharedContextPair<JCGLShadersType> cp = this.getShadersSharedWith("main", "alt"); final JCGLContextType c0 = cp.getMasterContext(); final JCGLShadersType s0 = cp.getMasterValue(); final JCGLContextType c1 = cp.getSlaveContext(); final JCGLShadersType s1 = cp.getSlaveValue(); Assert.assertTrue(c0.contextIsCurrent()); Assert.assertFalse(c1.contextIsCurrent()); final JCGLGeometryShaderType g = s0.shaderCompileGeometry("valid0", this.getShaderLines("valid0.geom")); c0.contextReleaseCurrent(); c1.contextMakeCurrent(); s1.shaderDeleteGeometry(g); Assert.assertTrue(g.isDeleted()); }
@Test public final void testVertexShaderDeleteSharedContext() { final JCGLSharedContextPair<JCGLShadersType> cp = this.getShadersSharedWith("main", "alt"); final JCGLContextType c0 = cp.getMasterContext(); final JCGLShadersType s0 = cp.getMasterValue(); final JCGLContextType c1 = cp.getSlaveContext(); final JCGLShadersType s1 = cp.getSlaveValue(); Assert.assertTrue(c0.contextIsCurrent()); Assert.assertFalse(c1.contextIsCurrent()); final JCGLVertexShaderType v = s0.shaderCompileVertex("valid0", this.getShaderLines("valid0.vert")); c0.contextReleaseCurrent(); c1.contextMakeCurrent(); s1.shaderDeleteVertex(v); Assert.assertTrue(v.isDeleted()); }
@Test public final void testVertexShaderDeleteSharedContext() { final JCGLSharedContextPair<JCGLShadersType> cp = this.getShadersSharedWith("main", "alt"); final JCGLContextType c0 = cp.getMasterContext(); final JCGLShadersType s0 = cp.getMasterValue(); final JCGLContextType c1 = cp.getSlaveContext(); final JCGLShadersType s1 = cp.getSlaveValue(); Assert.assertTrue(c0.contextIsCurrent()); Assert.assertFalse(c1.contextIsCurrent()); final JCGLVertexShaderType v = s0.shaderCompileVertex("valid0", this.getShaderLines("valid0.vert")); c0.contextReleaseCurrent(); c1.contextMakeCurrent(); s1.shaderDeleteVertex(v); Assert.assertTrue(v.isDeleted()); }