Sorry this comes two days late, had lots of work to do. Here some code:
glInit (Display)
private void glInitContext() {
DisplayMode displayMode = new DisplayMode(main.getWidth(), main.getHeight());
windowDimensions = new int[] { 0, 0, main.getWidth(), main.getHeight() };
PixelFormat pixelFormat = new PixelFormat().withSamples(8);
try {
Display.setDisplayMode(displayMode);
Display.create(pixelFormat);
Display.setTitle(title);
Display.setResizable(resizable);
} catch (LWJGLException e) {
e.printStackTrace();
}
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glDepthMask(true);
glDepthRange(0.0f, 1.0f);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_MULTISAMPLE);
glEnable(GL_SCISSOR_TEST);
glViewport(0, 0, Display.getWidth(), Display.getHeight());
glScissor(0, 0, Display.getWidth(), Display.getHeight());
EPHVertexArrayObject.glInitShaderProgramPool(shaderParentPath);
glInitialized = true;
synchronized (glInitMonitor) {
glInitMonitor.notifyAll();
}
}
glDraw (VAO)
public synchronized void glRender() {
if (handle < 0 || !updated) glInit();
if (size > 0 && hasVisibleEntries()) {
glBindVertexArray(handle);
glViewport(viewPortRect[0], viewPortRect[1], viewPortRect[2], viewPortRect[3]); // viewportRect is set correctly
glScissor(scissorRect[0], scissorRect[1], scissorRect[2], scissorRect[3]); // scissorRect is also set correctly
// Binding the Program
// upload the uniforms
// glDrawElements(...)
// unbind the Program
glBindVertexArray(0);
}
}
I’m not too sure what kind of code you’d like to see … I thought this are the parts where the viewport is important .