public JmeBatchRenderBackend(final NiftyJmeDisplay display) { this.display = display; this.batchPool = new ObjectPool<Batch>(new Factory<Batch>() { @Override public Batch createNew() { return new Batch(); } }); }
public BatchRenderBackendInternal( @Nonnull final GL gl, @Nonnull final BufferFactory bufferFactory, @Nonnull final ImageFactory imageFactory, @Nonnull final MouseCursorFactory mouseCursorFactory) { this.gl = gl; this.bufferFactory = bufferFactory; this.imageFactory = imageFactory; this.mouseCursorFactory = mouseCursorFactory; viewportBuffer = bufferFactory.createNativeOrderedIntBuffer(16); singleTextureIdBuffer = bufferFactory.createNativeOrderedIntBuffer(1); batchPool = new ObjectPool<Batch>(new Factory<Batch>() { @Nonnull @Override public Batch createNew() { return new BatchInternal(gl, bufferFactory); } }); initializeOpenGL(); }
public BatchRenderBackendCoreProfileInternal( @Nonnull final CoreGL gl, @Nonnull final BufferFactory bufferFactory, @Nonnull final ImageFactory imageFactory, @Nonnull final MouseCursorFactory mouseCursorFactory) { this.gl = gl; this.bufferFactory = bufferFactory; this.imageFactory = imageFactory; this.mouseCursorFactory = mouseCursorFactory; this.saveGLState = new CoreProfileSaveGLState(gl, bufferFactory); viewportBuffer = bufferFactory.createNativeOrderedIntBuffer(16); shader = CoreShader.createShaderWithVertexAttributes(gl, bufferFactory, "aVertex", "aColor", "aTexture"); shader.fragmentShader("nifty.fs"); shader.vertexShader("nifty.vs"); shader.link(); shader.activate(); shader.setUniformi("uTex", 0); batchPool = new ObjectPool<CoreBatch>(new Factory<CoreBatch>() { @Nonnull @Override public CoreBatch createNew() { return new CoreBatchInternal(gl, shader, bufferFactory, PRIMITIVE_RESTART_INDEX); } }); }