public void glBindFragDataLocation(int param1, int param2, String param3) { gl3.glBindFragDataLocation(param1, param2, param3); checkError(); }
@SuppressWarnings("fallthrough") public void initialize() { loadCapabilities(); // Initialize default state.. gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); if (caps.contains(Caps.SeamlessCubemap)) { // Enable this globally. Should be OK. gl.glEnable(GLExt.GL_TEXTURE_CUBE_MAP_SEAMLESS); } if (caps.contains(Caps.CoreProfile)) { // Core Profile requires VAO to be bound. gl3.glGenVertexArrays(intBuf16); int vaoId = intBuf16.get(0); gl3.glBindVertexArray(vaoId); } if (gl2 != null) { gl2.glEnable(GL2.GL_VERTEX_PROGRAM_POINT_SIZE); if (!caps.contains(Caps.CoreProfile)) { gl2.glEnable(GL2.GL_POINT_SPRITE); } } }
@Override public void glDeleteVertexArrays(IntBuffer arrays) { gl3.glDeleteVertexArrays(arrays); checkError(); }
private HashSet<String> loadExtensions() { HashSet<String> extensionSet = new HashSet<String>(64); if (caps.contains(Caps.OpenGL30)) { // If OpenGL3+ is available, use the non-deprecated way // of getting supported extensions. gl3.glGetInteger(GL3.GL_NUM_EXTENSIONS, intBuf16); int extensionCount = intBuf16.get(0); for (int i = 0; i < extensionCount; i++) { String extension = gl3.glGetString(GL.GL_EXTENSIONS, i); extensionSet.add(extension); } } else { extensionSet.addAll(Arrays.asList(gl.glGetString(GL.GL_EXTENSIONS).split(" "))); } return extensionSet; }
public void glBindVertexArray(int param1) { gl3.glBindVertexArray(param1); checkError(); }
private void bindBuffer(final ShaderBufferBlock bufferBlock, final BufferObject bufferObject, final int shaderId, final BufferObject.BufferType bufferType) { switch (bufferType) { case UniformBufferObject: { final int blockIndex = gl3.glGetUniformBlockIndex(shaderId, bufferBlock.getName()); gl3.glBindBufferBase(GL3.GL_UNIFORM_BUFFER, bufferObject.getBinding(), bufferObject.getId()); gl3.glUniformBlockBinding(GL3.GL_UNIFORM_BUFFER, blockIndex, bufferObject.getBinding()); break; } case ShaderStorageBufferObject: { final int blockIndex = gl4.glGetProgramResourceIndex(shaderId, GL4.GL_SHADER_STORAGE_BLOCK, bufferBlock.getName()); gl4.glShaderStorageBlockBinding(shaderId, blockIndex, bufferObject.getBinding()); gl4.glBindBufferBase(GL4.GL_SHADER_STORAGE_BUFFER, bufferObject.getBinding(), bufferObject.getId()); break; } default: { throw new IllegalArgumentException("Doesn't support binding of " + bufferType); } } }
@Override public String glGetString(int param1, int param2) { String result = gl3.glGetString(param1, param2); checkError(); return result; }
public void glGenVertexArrays(IntBuffer param1) { gl3.glGenVertexArrays(param1); checkError(); }
gl3.glBindBuffer(GL3.GL_UNIFORM_BUFFER, bufferId); gl3.glBufferData(GL4.GL_UNIFORM_BUFFER, data, GL3.GL_DYNAMIC_DRAW); gl3.glBindBuffer(GL4.GL_UNIFORM_BUFFER, 0); break;
@Override public int glGetUniformBlockIndex(final int program, final String uniformBlockName) { final int result = gl3.glGetUniformBlockIndex(program, uniformBlockName); checkError(); return result; }
@Override public void glBindBufferBase(final int target, final int index, final int buffer) { gl3.glBindBufferBase(target, index, buffer); checkError(); }
private HashSet<String> loadExtensions() { HashSet<String> extensionSet = new HashSet<String>(64); if (caps.contains(Caps.OpenGL30)) { // If OpenGL3+ is available, use the non-deprecated way // of getting supported extensions. gl3.glGetInteger(GL3.GL_NUM_EXTENSIONS, intBuf16); int extensionCount = intBuf16.get(0); for (int i = 0; i < extensionCount; i++) { String extension = gl3.glGetString(GL.GL_EXTENSIONS, i); extensionSet.add(extension); } } else { extensionSet.addAll(Arrays.asList(gl.glGetString(GL.GL_EXTENSIONS).split(" "))); } return extensionSet; }
private void renderMeshVertexArray(Mesh mesh, int lod, int count, VertexBuffer instanceData) { if (mesh.getId() == -1) { updateVertexArray(mesh, instanceData); } else { // TODO: Check if it was updated } if (context.boundVertexArray != mesh.getId()) { gl3.glBindVertexArray(mesh.getId()); context.boundVertexArray = mesh.getId(); } // IntMap<VertexBuffer> buffers = mesh.getBuffers(); VertexBuffer indices; if (mesh.getNumLodLevels() > 0) { indices = mesh.getLodLevel(lod); } else { indices = mesh.getBuffer(Type.Index); } if (indices != null) { drawTriangleList(indices, mesh, count); } else { drawTriangleArray(mesh.getMode(), count, mesh.getVertexCount()); } clearVertexAttribs(); }
@Override public String glGetString(int param1, int param2) { String result = gl3.glGetString(param1, param2); checkError(); return result; }
public void glGenVertexArrays(IntBuffer param1) { gl3.glGenVertexArrays(param1); checkError(); }
if (id == -1) { IntBuffer temp = intBuf1; gl3.glGenVertexArrays(temp); id = temp.get(0); mesh.setId(id); gl3.glBindVertexArray(id); context.boundVertexArray = id;
gl3.glBindFragDataLocation(id, 0, "outFragColor"); gl3.glBindFragDataLocation(id, i, "outFragData[" + i + "]");
public void glBindVertexArray(int param1) { gl3.glBindVertexArray(param1); checkError(); }
@Override public void glDeleteVertexArrays(IntBuffer arrays) { gl3.glDeleteVertexArrays(arrays); checkError(); }
@SuppressWarnings("fallthrough") public void initialize() { loadCapabilities(); // Initialize default state.. gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); if (caps.contains(Caps.SeamlessCubemap)) { // Enable this globally. Should be OK. gl.glEnable(GLExt.GL_TEXTURE_CUBE_MAP_SEAMLESS); } if (caps.contains(Caps.CoreProfile)) { // Core Profile requires VAO to be bound. gl3.glGenVertexArrays(intBuf16); int vaoId = intBuf16.get(0); gl3.glBindVertexArray(vaoId); } if (gl2 != null) { gl2.glEnable(GL2.GL_VERTEX_PROGRAM_POINT_SIZE); if (!caps.contains(Caps.CoreProfile)) { gl2.glEnable(GL2.GL_POINT_SPRITE); } } }