mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-28 02:48:14 -05:00
Update #50 - Bug fixes and shader improvements
This commit is contained in:
@ -37,11 +37,11 @@ class OpenGLObjects {
|
||||
|
||||
}
|
||||
|
||||
static class BufferArrayGL implements IBufferArrayGL {
|
||||
static class VertexArrayGL implements IVertexArrayGL {
|
||||
|
||||
final int ptr;
|
||||
|
||||
BufferArrayGL(int ptr) {
|
||||
VertexArrayGL(int ptr) {
|
||||
this.ptr = ptr;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final List<String> dumpActiveExtensions() {
|
||||
public static List<String> dumpActiveExtensions() {
|
||||
List<String> exts = new ArrayList<>();
|
||||
if(hasANGLEInstancedArrays) exts.add("ANGLE_instanced_arrays");
|
||||
if(hasEXTColorBufferFloat) exts.add("EXT_color_buffer_float");
|
||||
@ -133,63 +133,63 @@ public class PlatformOpenGL {
|
||||
return exts;
|
||||
}
|
||||
|
||||
public static final void _wglEnable(int glEnum) {
|
||||
public static void _wglEnable(int glEnum) {
|
||||
glEnable(glEnum);
|
||||
}
|
||||
|
||||
public static final void _wglDisable(int glEnum) {
|
||||
public static void _wglDisable(int glEnum) {
|
||||
glDisable(glEnum);
|
||||
}
|
||||
|
||||
public static final void _wglClearColor(float r, float g, float b, float a) {
|
||||
public static void _wglClearColor(float r, float g, float b, float a) {
|
||||
glClearColor(r, g, b, a);
|
||||
}
|
||||
|
||||
public static final void _wglClearDepth(float f) {
|
||||
public static void _wglClearDepth(float f) {
|
||||
glClearDepthf(f);
|
||||
}
|
||||
|
||||
public static final void _wglClear(int bits) {
|
||||
public static void _wglClear(int bits) {
|
||||
glClear(bits);
|
||||
}
|
||||
|
||||
public static final void _wglDepthFunc(int glEnum) {
|
||||
public static void _wglDepthFunc(int glEnum) {
|
||||
glDepthFunc(glEnum);
|
||||
}
|
||||
|
||||
public static final void _wglDepthMask(boolean mask) {
|
||||
public static void _wglDepthMask(boolean mask) {
|
||||
glDepthMask(mask);
|
||||
}
|
||||
|
||||
public static final void _wglCullFace(int glEnum) {
|
||||
public static void _wglCullFace(int glEnum) {
|
||||
glCullFace(glEnum);
|
||||
}
|
||||
|
||||
public static final void _wglViewport(int x, int y, int w, int h) {
|
||||
public static void _wglViewport(int x, int y, int w, int h) {
|
||||
glViewport(x, y, w, h);
|
||||
}
|
||||
|
||||
public static final void _wglBlendFunc(int src, int dst) {
|
||||
public static void _wglBlendFunc(int src, int dst) {
|
||||
glBlendFunc(src, dst);
|
||||
}
|
||||
|
||||
public static final void _wglBlendFuncSeparate(int srcColor, int dstColor, int srcAlpha, int dstAlpha) {
|
||||
public static void _wglBlendFuncSeparate(int srcColor, int dstColor, int srcAlpha, int dstAlpha) {
|
||||
glBlendFuncSeparate(srcColor, dstColor, srcAlpha, dstAlpha);
|
||||
}
|
||||
|
||||
public static final void _wglBlendEquation(int glEnum) {
|
||||
public static void _wglBlendEquation(int glEnum) {
|
||||
glBlendEquation(glEnum);
|
||||
}
|
||||
|
||||
public static final void _wglBlendColor(float r, float g, float b, float a) {
|
||||
public static void _wglBlendColor(float r, float g, float b, float a) {
|
||||
glBlendColor(r, g, b, a);
|
||||
}
|
||||
|
||||
public static final void _wglColorMask(boolean r, boolean g, boolean b, boolean a) {
|
||||
public static void _wglColorMask(boolean r, boolean g, boolean b, boolean a) {
|
||||
glColorMask(r, g, b, a);
|
||||
}
|
||||
|
||||
public static final void _wglDrawBuffers(int buffer) {
|
||||
public static void _wglDrawBuffers(int buffer) {
|
||||
if(glesVers == 200) {
|
||||
if(buffer != 0x8CE0) { // GL_COLOR_ATTACHMENT0
|
||||
throw new UnsupportedOperationException();
|
||||
@ -199,7 +199,7 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglDrawBuffers(int[] buffers) {
|
||||
public static void _wglDrawBuffers(int[] buffers) {
|
||||
if(glesVers == 200) {
|
||||
if(buffers.length != 1 || buffers[0] != 0x8CE0) { // GL_COLOR_ATTACHMENT0
|
||||
throw new UnsupportedOperationException();
|
||||
@ -209,83 +209,83 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglReadBuffer(int buffer) {
|
||||
public static void _wglReadBuffer(int buffer) {
|
||||
glReadBuffer(buffer);
|
||||
}
|
||||
|
||||
public static final void _wglReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
|
||||
public static void _wglReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
|
||||
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglReadPixels_u16(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
|
||||
public static void _wglReadPixels_u16(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
|
||||
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer data) {
|
||||
public static void _wglReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer data) {
|
||||
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglReadPixels(int x, int y, int width, int height, int format, int type, FloatBuffer data) {
|
||||
public static void _wglReadPixels(int x, int y, int width, int height, int format, int type, FloatBuffer data) {
|
||||
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglPolygonOffset(float f1, float f2) {
|
||||
public static void _wglPolygonOffset(float f1, float f2) {
|
||||
glPolygonOffset(f1, f2);
|
||||
}
|
||||
|
||||
public static final void _wglLineWidth(float width) {
|
||||
public static void _wglLineWidth(float width) {
|
||||
glLineWidth(width);
|
||||
}
|
||||
|
||||
public static final IBufferGL _wglGenBuffers() {
|
||||
public static IBufferGL _wglGenBuffers() {
|
||||
return new OpenGLObjects.BufferGL(glGenBuffers());
|
||||
}
|
||||
|
||||
public static final ITextureGL _wglGenTextures() {
|
||||
public static ITextureGL _wglGenTextures() {
|
||||
return new OpenGLObjects.TextureGL(glGenTextures());
|
||||
}
|
||||
|
||||
public static final IBufferArrayGL _wglGenVertexArrays() {
|
||||
public static IVertexArrayGL _wglGenVertexArrays() {
|
||||
switch(vertexArrayImpl) {
|
||||
case VAO_IMPL_CORE:
|
||||
return new OpenGLObjects.BufferArrayGL(glGenVertexArrays());
|
||||
return new OpenGLObjects.VertexArrayGL(glGenVertexArrays());
|
||||
case VAO_IMPL_OES:
|
||||
return new OpenGLObjects.BufferArrayGL(glGenVertexArraysOES());
|
||||
return new OpenGLObjects.VertexArrayGL(glGenVertexArraysOES());
|
||||
default:
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public static final IProgramGL _wglCreateProgram() {
|
||||
public static IProgramGL _wglCreateProgram() {
|
||||
return new OpenGLObjects.ProgramGL(glCreateProgram());
|
||||
}
|
||||
|
||||
public static final IShaderGL _wglCreateShader(int type) {
|
||||
public static IShaderGL _wglCreateShader(int type) {
|
||||
return new OpenGLObjects.ShaderGL(glCreateShader(type));
|
||||
}
|
||||
|
||||
public static final IFramebufferGL _wglCreateFramebuffer() {
|
||||
public static IFramebufferGL _wglCreateFramebuffer() {
|
||||
return new OpenGLObjects.FramebufferGL(glGenFramebuffers());
|
||||
}
|
||||
|
||||
public static final IRenderbufferGL _wglCreateRenderbuffer() {
|
||||
public static IRenderbufferGL _wglCreateRenderbuffer() {
|
||||
return new OpenGLObjects.RenderbufferGL(glGenRenderbuffers());
|
||||
}
|
||||
|
||||
public static final IQueryGL _wglGenQueries() {
|
||||
public static IQueryGL _wglGenQueries() {
|
||||
return new OpenGLObjects.QueryGL(glGenQueries());
|
||||
}
|
||||
|
||||
public static final void _wglDeleteBuffers(IBufferGL obj) {
|
||||
public static void _wglDeleteBuffers(IBufferGL obj) {
|
||||
glDeleteBuffers(((OpenGLObjects.BufferGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDeleteTextures(ITextureGL obj) {
|
||||
public static void _wglDeleteTextures(ITextureGL obj) {
|
||||
glDeleteTextures(((OpenGLObjects.TextureGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDeleteVertexArrays(IBufferArrayGL obj) {
|
||||
int ptr = ((OpenGLObjects.BufferArrayGL) obj).ptr;
|
||||
public static void _wglDeleteVertexArrays(IVertexArrayGL obj) {
|
||||
int ptr = ((OpenGLObjects.VertexArrayGL) obj).ptr;
|
||||
switch(vertexArrayImpl) {
|
||||
case VAO_IMPL_CORE:
|
||||
glDeleteVertexArrays(ptr);
|
||||
@ -298,66 +298,66 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglDeleteProgram(IProgramGL obj) {
|
||||
public static void _wglDeleteProgram(IProgramGL obj) {
|
||||
glDeleteProgram(((OpenGLObjects.ProgramGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDeleteShader(IShaderGL obj) {
|
||||
public static void _wglDeleteShader(IShaderGL obj) {
|
||||
glDeleteShader(((OpenGLObjects.ShaderGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDeleteFramebuffer(IFramebufferGL obj) {
|
||||
public static void _wglDeleteFramebuffer(IFramebufferGL obj) {
|
||||
glDeleteFramebuffers(((OpenGLObjects.FramebufferGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDeleteRenderbuffer(IRenderbufferGL obj) {
|
||||
public static void _wglDeleteRenderbuffer(IRenderbufferGL obj) {
|
||||
glDeleteRenderbuffers(((OpenGLObjects.RenderbufferGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDeleteQueries(IQueryGL obj) {
|
||||
public static void _wglDeleteQueries(IQueryGL obj) {
|
||||
glDeleteQueries(((OpenGLObjects.QueryGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglBindBuffer(int target, IBufferGL obj) {
|
||||
public static void _wglBindBuffer(int target, IBufferGL obj) {
|
||||
glBindBuffer(target, obj == null ? 0 : ((OpenGLObjects.BufferGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglBufferData(int target, ByteBuffer data, int usage) {
|
||||
public static void _wglBufferData(int target, ByteBuffer data, int usage) {
|
||||
nglBufferData(target, data == null ? 0 : data.remaining(),
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data), usage);
|
||||
}
|
||||
|
||||
public static final void _wglBufferData(int target, IntBuffer data, int usage) {
|
||||
public static void _wglBufferData(int target, IntBuffer data, int usage) {
|
||||
nglBufferData(target, data == null ? 0 : (data.remaining() << 2),
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data), usage);
|
||||
}
|
||||
|
||||
public static final void _wglBufferData(int target, FloatBuffer data, int usage) {
|
||||
public static void _wglBufferData(int target, FloatBuffer data, int usage) {
|
||||
nglBufferData(target, data == null ? 0 : (data.remaining() << 2),
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data), usage);
|
||||
}
|
||||
|
||||
public static final void _wglBufferData(int target, int size, int usage) {
|
||||
public static void _wglBufferData(int target, int size, int usage) {
|
||||
glBufferData(target, size, usage);
|
||||
}
|
||||
|
||||
public static final void _wglBufferSubData(int target, int offset, ByteBuffer data) {
|
||||
public static void _wglBufferSubData(int target, int offset, ByteBuffer data) {
|
||||
nglBufferSubData(target, offset, data == null ? 0 : data.remaining(),
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglBufferSubData(int target, int offset, IntBuffer data) {
|
||||
public static void _wglBufferSubData(int target, int offset, IntBuffer data) {
|
||||
nglBufferSubData(target, offset, data == null ? 0 : (data.remaining() << 2),
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglBufferSubData(int target, int offset, FloatBuffer data) {
|
||||
public static void _wglBufferSubData(int target, int offset, FloatBuffer data) {
|
||||
nglBufferSubData(target, offset, data == null ? 0 : (data.remaining() << 2),
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglBindVertexArray(IBufferArrayGL obj) {
|
||||
int ptr = obj == null ? 0 : ((OpenGLObjects.BufferArrayGL) obj).ptr;
|
||||
public static void _wglBindVertexArray(IVertexArrayGL obj) {
|
||||
int ptr = obj == null ? 0 : ((OpenGLObjects.VertexArrayGL) obj).ptr;
|
||||
switch(vertexArrayImpl) {
|
||||
case VAO_IMPL_CORE:
|
||||
glBindVertexArray(ptr);
|
||||
@ -370,20 +370,20 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglEnableVertexAttribArray(int index) {
|
||||
public static void _wglEnableVertexAttribArray(int index) {
|
||||
glEnableVertexAttribArray(index);
|
||||
}
|
||||
|
||||
public static final void _wglDisableVertexAttribArray(int index) {
|
||||
public static void _wglDisableVertexAttribArray(int index) {
|
||||
glDisableVertexAttribArray(index);
|
||||
}
|
||||
|
||||
public static final void _wglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride,
|
||||
public static void _wglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride,
|
||||
int offset) {
|
||||
glVertexAttribPointer(index, size, type, normalized, stride, offset);
|
||||
}
|
||||
|
||||
public static final void _wglVertexAttribDivisor(int index, int divisor) {
|
||||
public static void _wglVertexAttribDivisor(int index, int divisor) {
|
||||
switch(instancingImpl) {
|
||||
case INSTANCE_IMPL_CORE:
|
||||
glVertexAttribDivisor(index, divisor);
|
||||
@ -399,88 +399,88 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglActiveTexture(int texture) {
|
||||
public static void _wglActiveTexture(int texture) {
|
||||
glActiveTexture(texture);
|
||||
}
|
||||
|
||||
public static final void _wglBindTexture(int target, ITextureGL obj) {
|
||||
public static void _wglBindTexture(int target, ITextureGL obj) {
|
||||
glBindTexture(target, obj == null ? 0 : ((OpenGLObjects.TextureGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglTexParameterf(int target, int param, float value) {
|
||||
public static void _wglTexParameterf(int target, int param, float value) {
|
||||
glTexParameterf(target, param, value);
|
||||
}
|
||||
|
||||
public static final void _wglTexParameteri(int target, int param, int value) {
|
||||
public static void _wglTexParameteri(int target, int param, int value) {
|
||||
glTexParameteri(target, param, value);
|
||||
}
|
||||
|
||||
public static final void _wglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
|
||||
public static void _wglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
|
||||
int border, int format, int type, ByteBuffer data) {
|
||||
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
|
||||
public static void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
|
||||
int border, int format, int type, ByteBuffer data) {
|
||||
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
|
||||
public static void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
|
||||
int border, int format, int type, IntBuffer data) {
|
||||
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
|
||||
public static void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
|
||||
int border, int format, int type, FloatBuffer data) {
|
||||
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2Du16(int target, int level, int internalFormat, int width, int height,
|
||||
public static void _wglTexImage2Du16(int target, int level, int internalFormat, int width, int height,
|
||||
int border, int format, int type, ByteBuffer data) {
|
||||
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
|
||||
public static void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
|
||||
int border, int format, int type, ByteBuffer data) {
|
||||
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
public static void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
int format, int type, ByteBuffer data) {
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
public static void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
int format, int type, IntBuffer data) {
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexSubImage2Df32(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
public static void _wglTexSubImage2Df32(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
int format, int type, FloatBuffer data) {
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexSubImage2Du16(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
public static void _wglTexSubImage2Du16(int target, int level, int xoffset, int yoffset, int width, int height,
|
||||
int format, int type, ByteBuffer data) {
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
|
||||
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
|
||||
}
|
||||
|
||||
public static final void _wglCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y,
|
||||
public static void _wglCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y,
|
||||
int width, int height) {
|
||||
glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
|
||||
}
|
||||
|
||||
public static final void _wglTexStorage2D(int target, int levels, int internalFormat, int w, int h) {
|
||||
public static void _wglTexStorage2D(int target, int levels, int internalFormat, int w, int h) {
|
||||
switch(texStorageImpl) {
|
||||
case TEX_STORAGE_IMPL_CORE:
|
||||
glTexStorage2D(target, levels, internalFormat, w, h);
|
||||
@ -493,67 +493,67 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglPixelStorei(int pname, int value) {
|
||||
public static void _wglPixelStorei(int pname, int value) {
|
||||
glPixelStorei(pname, value);
|
||||
}
|
||||
|
||||
public static final void _wglGenerateMipmap(int target) {
|
||||
public static void _wglGenerateMipmap(int target) {
|
||||
glGenerateMipmap(target);
|
||||
}
|
||||
|
||||
public static final void _wglShaderSource(IShaderGL obj, String source) {
|
||||
public static void _wglShaderSource(IShaderGL obj, String source) {
|
||||
glShaderSource(((OpenGLObjects.ShaderGL) obj).ptr, source);
|
||||
}
|
||||
|
||||
public static final void _wglCompileShader(IShaderGL obj) {
|
||||
public static void _wglCompileShader(IShaderGL obj) {
|
||||
glCompileShader(((OpenGLObjects.ShaderGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final int _wglGetShaderi(IShaderGL obj, int param) {
|
||||
public static int _wglGetShaderi(IShaderGL obj, int param) {
|
||||
return glGetShaderi(((OpenGLObjects.ShaderGL) obj).ptr, param);
|
||||
}
|
||||
|
||||
public static final String _wglGetShaderInfoLog(IShaderGL obj) {
|
||||
public static String _wglGetShaderInfoLog(IShaderGL obj) {
|
||||
return glGetShaderInfoLog(((OpenGLObjects.ShaderGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglUseProgram(IProgramGL obj) {
|
||||
public static void _wglUseProgram(IProgramGL obj) {
|
||||
glUseProgram(obj == null ? 0 : ((OpenGLObjects.ProgramGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglAttachShader(IProgramGL obj, IShaderGL shader) {
|
||||
public static void _wglAttachShader(IProgramGL obj, IShaderGL shader) {
|
||||
glAttachShader(((OpenGLObjects.ProgramGL) obj).ptr, ((OpenGLObjects.ShaderGL) shader).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglDetachShader(IProgramGL obj, IShaderGL shader) {
|
||||
public static void _wglDetachShader(IProgramGL obj, IShaderGL shader) {
|
||||
glDetachShader(((OpenGLObjects.ProgramGL) obj).ptr, ((OpenGLObjects.ShaderGL) shader).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglLinkProgram(IProgramGL obj) {
|
||||
public static void _wglLinkProgram(IProgramGL obj) {
|
||||
glLinkProgram(((OpenGLObjects.ProgramGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final int _wglGetProgrami(IProgramGL obj, int param) {
|
||||
public static int _wglGetProgrami(IProgramGL obj, int param) {
|
||||
return glGetProgrami(((OpenGLObjects.ProgramGL) obj).ptr, param);
|
||||
}
|
||||
|
||||
public static final String _wglGetProgramInfoLog(IProgramGL obj) {
|
||||
public static String _wglGetProgramInfoLog(IProgramGL obj) {
|
||||
return glGetProgramInfoLog(((OpenGLObjects.ProgramGL) obj).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglBindAttribLocation(IProgramGL obj, int index, String name) {
|
||||
public static void _wglBindAttribLocation(IProgramGL obj, int index, String name) {
|
||||
glBindAttribLocation(((OpenGLObjects.ProgramGL) obj).ptr, index, name);
|
||||
}
|
||||
|
||||
public static final int _wglGetAttribLocation(IProgramGL obj, String name) {
|
||||
public static int _wglGetAttribLocation(IProgramGL obj, String name) {
|
||||
return glGetAttribLocation(((OpenGLObjects.ProgramGL) obj).ptr, name);
|
||||
}
|
||||
|
||||
public static final void _wglDrawArrays(int mode, int first, int count) {
|
||||
public static void _wglDrawArrays(int mode, int first, int count) {
|
||||
glDrawArrays(mode, first, count);
|
||||
}
|
||||
|
||||
public static final void _wglDrawArraysInstanced(int mode, int first, int count, int instanced) {
|
||||
public static void _wglDrawArraysInstanced(int mode, int first, int count, int instanced) {
|
||||
switch(instancingImpl) {
|
||||
case INSTANCE_IMPL_CORE:
|
||||
glDrawArraysInstanced(mode, first, count, instanced);
|
||||
@ -569,11 +569,11 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void _wglDrawElements(int mode, int count, int type, int offset) {
|
||||
public static void _wglDrawElements(int mode, int count, int type, int offset) {
|
||||
glDrawElements(mode, count, type, offset);
|
||||
}
|
||||
|
||||
public static final void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instanced) {
|
||||
public static void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instanced) {
|
||||
switch(instancingImpl) {
|
||||
case INSTANCE_IMPL_CORE:
|
||||
glDrawElementsInstanced(mode, count, type, offset, instanced);
|
||||
@ -589,49 +589,49 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final IUniformGL _wglGetUniformLocation(IProgramGL obj, String name) {
|
||||
public static IUniformGL _wglGetUniformLocation(IProgramGL obj, String name) {
|
||||
int loc = glGetUniformLocation(((OpenGLObjects.ProgramGL) obj).ptr, name);
|
||||
return loc < 0 ? null : new OpenGLObjects.UniformGL(loc);
|
||||
}
|
||||
|
||||
public static final int _wglGetUniformBlockIndex(IProgramGL obj, String name) {
|
||||
public static int _wglGetUniformBlockIndex(IProgramGL obj, String name) {
|
||||
return glGetUniformBlockIndex(((OpenGLObjects.ProgramGL) obj).ptr, name);
|
||||
}
|
||||
|
||||
public static final void _wglBindBufferRange(int target, int index, IBufferGL buffer, int offset, int size) {
|
||||
public static void _wglBindBufferRange(int target, int index, IBufferGL buffer, int offset, int size) {
|
||||
glBindBufferRange(target, index, ((OpenGLObjects.BufferGL) buffer).ptr, offset, size);
|
||||
}
|
||||
|
||||
public static final void _wglUniformBlockBinding(IProgramGL obj, int blockIndex, int bufferIndex) {
|
||||
public static void _wglUniformBlockBinding(IProgramGL obj, int blockIndex, int bufferIndex) {
|
||||
glUniformBlockBinding(((OpenGLObjects.ProgramGL) obj).ptr, blockIndex, bufferIndex);
|
||||
}
|
||||
|
||||
public static final void _wglUniform1f(IUniformGL obj, float x) {
|
||||
public static void _wglUniform1f(IUniformGL obj, float x) {
|
||||
if (obj != null)
|
||||
glUniform1f(((OpenGLObjects.UniformGL) obj).ptr, x);
|
||||
}
|
||||
|
||||
public static final void _wglUniform2f(IUniformGL obj, float x, float y) {
|
||||
public static void _wglUniform2f(IUniformGL obj, float x, float y) {
|
||||
if (obj != null)
|
||||
glUniform2f(((OpenGLObjects.UniformGL) obj).ptr, x, y);
|
||||
}
|
||||
|
||||
public static final void _wglUniform3f(IUniformGL obj, float x, float y, float z) {
|
||||
public static void _wglUniform3f(IUniformGL obj, float x, float y, float z) {
|
||||
if (obj != null)
|
||||
glUniform3f(((OpenGLObjects.UniformGL) obj).ptr, x, y, z);
|
||||
}
|
||||
|
||||
public static final void _wglUniform4f(IUniformGL obj, float x, float y, float z, float w) {
|
||||
public static void _wglUniform4f(IUniformGL obj, float x, float y, float z, float w) {
|
||||
if (obj != null)
|
||||
glUniform4f(((OpenGLObjects.UniformGL) obj).ptr, x, y, z, w);
|
||||
}
|
||||
|
||||
public static final void _wglUniform1i(IUniformGL obj, int x) {
|
||||
public static void _wglUniform1i(IUniformGL obj, int x) {
|
||||
if (obj != null)
|
||||
glUniform1i(((OpenGLObjects.UniformGL) obj).ptr, x);
|
||||
}
|
||||
|
||||
public static final void _wglUniform2i(IUniformGL obj, int x, int y) {
|
||||
public static void _wglUniform2i(IUniformGL obj, int x, int y) {
|
||||
if (obj != null)
|
||||
glUniform2i(((OpenGLObjects.UniformGL) obj).ptr, x, y);
|
||||
}
|
||||
@ -641,48 +641,48 @@ public class PlatformOpenGL {
|
||||
glUniform3i(((OpenGLObjects.UniformGL) obj).ptr, x, y, z);
|
||||
}
|
||||
|
||||
public static final void _wglUniform4i(IUniformGL obj, int x, int y, int z, int w) {
|
||||
public static void _wglUniform4i(IUniformGL obj, int x, int y, int z, int w) {
|
||||
if (obj != null)
|
||||
glUniform4i(((OpenGLObjects.UniformGL) obj).ptr, x, y, z, w);
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
public static void _wglUniformMatrix2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if (obj != null)
|
||||
nglUniformMatrix2fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() >> 2, transpose,
|
||||
EaglerLWJGLAllocator.getAddress(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
public static void _wglUniformMatrix3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if (obj != null)
|
||||
nglUniformMatrix3fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() / 9, transpose,
|
||||
EaglerLWJGLAllocator.getAddress(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix3x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
public static void _wglUniformMatrix3x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if (obj != null)
|
||||
nglUniformMatrix3x2fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() / 6, transpose,
|
||||
EaglerLWJGLAllocator.getAddress(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix4fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
public static void _wglUniformMatrix4fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if (obj != null)
|
||||
nglUniformMatrix4fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() >> 4, transpose,
|
||||
EaglerLWJGLAllocator.getAddress(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix4x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
public static void _wglUniformMatrix4x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if (obj != null)
|
||||
nglUniformMatrix4x2fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() >> 3, transpose,
|
||||
EaglerLWJGLAllocator.getAddress(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix4x3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
public static void _wglUniformMatrix4x3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if (obj != null)
|
||||
nglUniformMatrix4x3fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() / 12, transpose,
|
||||
EaglerLWJGLAllocator.getAddress(mat));
|
||||
}
|
||||
|
||||
public static final void _wglBindFramebuffer(int target, IFramebufferGL framebuffer) {
|
||||
public static void _wglBindFramebuffer(int target, IFramebufferGL framebuffer) {
|
||||
if(framebuffer == null) {
|
||||
glBindFramebuffer(target, 0);
|
||||
}else {
|
||||
@ -690,87 +690,87 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final int _wglCheckFramebufferStatus(int target) {
|
||||
public static int _wglCheckFramebufferStatus(int target) {
|
||||
return glCheckFramebufferStatus(target);
|
||||
}
|
||||
|
||||
public static final void _wglFramebufferTexture2D(int target, int attachment, int texTarget, ITextureGL texture,
|
||||
public static void _wglFramebufferTexture2D(int target, int attachment, int texTarget, ITextureGL texture,
|
||||
int level) {
|
||||
glFramebufferTexture2D(target, attachment, texTarget, ((OpenGLObjects.TextureGL) texture).ptr, level);
|
||||
}
|
||||
|
||||
public static final void _wglFramebufferTextureLayer(int target, int attachment, ITextureGL texture, int level, int layer) {
|
||||
public static void _wglFramebufferTextureLayer(int target, int attachment, ITextureGL texture, int level, int layer) {
|
||||
glFramebufferTextureLayer(target, attachment, ((OpenGLObjects.TextureGL) texture).ptr, level, layer);
|
||||
}
|
||||
|
||||
public static final void _wglBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0,
|
||||
public static void _wglBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0,
|
||||
int dstX1, int dstY1, int bits, int filter) {
|
||||
glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, bits, filter);
|
||||
}
|
||||
|
||||
public static final void _wglBindRenderbuffer(int target, IRenderbufferGL renderbuffer) {
|
||||
public static void _wglBindRenderbuffer(int target, IRenderbufferGL renderbuffer) {
|
||||
glBindRenderbuffer(target, renderbuffer == null ? 0 : ((OpenGLObjects.RenderbufferGL) renderbuffer).ptr);
|
||||
}
|
||||
|
||||
public static final void _wglRenderbufferStorage(int target, int internalformat, int width, int height) {
|
||||
public static void _wglRenderbufferStorage(int target, int internalformat, int width, int height) {
|
||||
glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
|
||||
public static final void _wglFramebufferRenderbuffer(int target, int attachment, int renderbufferTarget,
|
||||
public static void _wglFramebufferRenderbuffer(int target, int attachment, int renderbufferTarget,
|
||||
IRenderbufferGL renderbuffer) {
|
||||
glFramebufferRenderbuffer(target, attachment, renderbufferTarget,
|
||||
((OpenGLObjects.RenderbufferGL) renderbuffer).ptr);
|
||||
}
|
||||
|
||||
public static final String _wglGetString(int param) {
|
||||
public static String _wglGetString(int param) {
|
||||
return glGetString(param);
|
||||
}
|
||||
|
||||
public static final int _wglGetInteger(int param) {
|
||||
public static int _wglGetInteger(int param) {
|
||||
return glGetInteger(param);
|
||||
}
|
||||
|
||||
public static final int _wglGetError() {
|
||||
public static int _wglGetError() {
|
||||
return glGetError();
|
||||
}
|
||||
|
||||
public static final int checkOpenGLESVersion() {
|
||||
public static int checkOpenGLESVersion() {
|
||||
return glesVers;
|
||||
}
|
||||
|
||||
public static final boolean checkEXTGPUShader5Capable() {
|
||||
public static boolean checkEXTGPUShader5Capable() {
|
||||
return hasEXTGPUShader5;
|
||||
}
|
||||
|
||||
public static final boolean checkOESGPUShader5Capable() {
|
||||
public static boolean checkOESGPUShader5Capable() {
|
||||
return hasOESGPUShader5;
|
||||
}
|
||||
|
||||
public static final boolean checkFBORenderMipmapCapable() {
|
||||
public static boolean checkFBORenderMipmapCapable() {
|
||||
return hasOESFBORenderMipmap;
|
||||
}
|
||||
|
||||
public static final boolean checkVAOCapable() {
|
||||
public static boolean checkVAOCapable() {
|
||||
return vertexArrayImpl != VAO_IMPL_NONE;
|
||||
}
|
||||
|
||||
public static final boolean checkInstancingCapable() {
|
||||
public static boolean checkInstancingCapable() {
|
||||
return instancingImpl != INSTANCE_IMPL_NONE;
|
||||
}
|
||||
|
||||
public static final boolean checkTexStorageCapable() {
|
||||
public static boolean checkTexStorageCapable() {
|
||||
return texStorageImpl != TEX_STORAGE_IMPL_NONE;
|
||||
}
|
||||
|
||||
public static final boolean checkTextureLODCapable() {
|
||||
public static boolean checkTextureLODCapable() {
|
||||
return glesVers >= 300 || hasEXTShaderTextureLOD;
|
||||
}
|
||||
|
||||
public static final boolean checkNPOTCapable() {
|
||||
public static boolean checkNPOTCapable() {
|
||||
return glesVers >= 300;
|
||||
}
|
||||
|
||||
public static final boolean checkHDRFramebufferSupport(int bits) {
|
||||
public static boolean checkHDRFramebufferSupport(int bits) {
|
||||
switch(bits) {
|
||||
case 16:
|
||||
return hasFBO16FSupport;
|
||||
@ -781,7 +781,7 @@ public class PlatformOpenGL {
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean checkLinearHDRFilteringSupport(int bits) {
|
||||
public static boolean checkLinearHDRFilteringSupport(int bits) {
|
||||
switch(bits) {
|
||||
case 16:
|
||||
return hasLinearHDR16FSupport;
|
||||
@ -793,19 +793,19 @@ public class PlatformOpenGL {
|
||||
}
|
||||
|
||||
// legacy
|
||||
public static final boolean checkLinearHDR32FSupport() {
|
||||
public static boolean checkLinearHDR32FSupport() {
|
||||
return hasLinearHDR32FSupport;
|
||||
}
|
||||
|
||||
public static final boolean checkAnisotropicFilteringSupport() {
|
||||
public static boolean checkAnisotropicFilteringSupport() {
|
||||
return hasEXTTextureFilterAnisotropic;
|
||||
}
|
||||
|
||||
public static final String[] getAllExtensions() {
|
||||
public static String[] getAllExtensions() {
|
||||
return glGetString(GL_EXTENSIONS).split(" ");
|
||||
}
|
||||
|
||||
public static final void enterVAOEmulationHook() {
|
||||
public static void enterVAOEmulationHook() {
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user