mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #18 - Final release, added PBR shaders
This commit is contained in:
@ -22,7 +22,6 @@ import org.teavm.jso.typedarrays.ArrayBuffer;
|
||||
import org.teavm.jso.typedarrays.Int8Array;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.Base64;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
||||
@ -40,7 +39,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass;
|
||||
public class PlatformApplication {
|
||||
|
||||
public static void openLink(String url) {
|
||||
Window.current().open(url, "_blank");
|
||||
Window.current().open(url, "_blank", "noopener,noreferrer");
|
||||
}
|
||||
|
||||
public static void setClipboard(String text) {
|
||||
|
@ -227,6 +227,35 @@ public class PlatformAudio {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static interface IAudioCacheLoader {
|
||||
byte[] loadFile(String filename);
|
||||
}
|
||||
|
||||
public static IAudioResource loadAudioDataNew(String filename, boolean holdInCache, IAudioCacheLoader loader) {
|
||||
BrowserAudioResource buffer;
|
||||
synchronized(soundCache) {
|
||||
buffer = soundCache.get(filename);
|
||||
}
|
||||
if(buffer == null) {
|
||||
byte[] file = loader.loadFile(filename);
|
||||
if(file == null) return null;
|
||||
Uint8Array buf = Uint8Array.create(file.length);
|
||||
buf.set(file);
|
||||
buffer = new BrowserAudioResource(decodeAudioAsync(buf.getBuffer(), filename));
|
||||
if(holdInCache) {
|
||||
synchronized(soundCache) {
|
||||
soundCache.put(filename, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(buffer.buffer != null) {
|
||||
buffer.cacheHit = System.currentTimeMillis();
|
||||
return buffer;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
public static native AudioBuffer decodeAudioAsync(ArrayBuffer buffer, String errorFileName);
|
||||
@ -260,6 +289,12 @@ public class PlatformAudio {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void flushAudioCache() {
|
||||
synchronized(soundCache) {
|
||||
soundCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean available() {
|
||||
return true; // this is not used
|
||||
|
@ -1,10 +1,16 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||
|
||||
import org.teavm.jso.webgl.WebGLUniformLocation;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerArrayBufferAllocator;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Level;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
||||
@ -21,13 +27,19 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext;
|
||||
*/
|
||||
public class PlatformOpenGL {
|
||||
|
||||
static WebGL2RenderingContext ctx = null;
|
||||
private static final Logger logger = LogManager.getLogger("PlatformOpenGL");
|
||||
|
||||
static WebGL2RenderingContext ctx = null;
|
||||
|
||||
static boolean hasDebugRenderInfoExt = false;
|
||||
static boolean hasFramebufferHDR16FSupport = false;
|
||||
static boolean hasFramebufferHDR32FSupport = false;
|
||||
|
||||
static void setCurrentContext(WebGL2RenderingContext context) {
|
||||
ctx = context;
|
||||
hasDebugRenderInfoExt = ctx.getExtension("WEBGL_debug_renderer_info") != null;
|
||||
hasFramebufferHDR16FSupport = ctx.getExtension("EXT_color_buffer_half_float") != null;
|
||||
hasFramebufferHDR32FSupport = ctx.getExtension("EXT_color_buffer_float") != null;
|
||||
_wglClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
@ -80,6 +92,10 @@ public class PlatformOpenGL {
|
||||
ctx.blendEquation(glEnum);
|
||||
}
|
||||
|
||||
public static final void _wglBlendColor(float r, float g, float b, float a) {
|
||||
ctx.blendColor(r, g, b, a);
|
||||
}
|
||||
|
||||
public static final void _wglColorMask(boolean r, boolean g, boolean b, boolean a) {
|
||||
ctx.colorMask(r, g, b, a);
|
||||
}
|
||||
@ -236,6 +252,12 @@ public class PlatformOpenGL {
|
||||
public static final void _wglTexParameteri(int target, int param, int value) {
|
||||
ctx.texParameteri(target, param, value);
|
||||
}
|
||||
|
||||
public static final void _wglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
|
||||
int border, int format, int type, ByteBuffer data) {
|
||||
ctx.texImage3D(target, level, internalFormat, width, height, depth, border, format, type,
|
||||
data == null ? null : EaglerArrayBufferAllocator.getDataViewStupid(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width,
|
||||
int height, int border, int format, int type, ByteBuffer data) {
|
||||
@ -243,6 +265,12 @@ public class PlatformOpenGL {
|
||||
data == null ? null : EaglerArrayBufferAllocator.getDataViewStupid(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2Du16(int target, int level, int internalFormat, int width,
|
||||
int height, int border, int format, int type, ByteBuffer data) {
|
||||
ctx.texImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
data == null ? null : EaglerArrayBufferAllocator.getDataViewStupid16(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width,
|
||||
int height, int border, int format, int type, IntBuffer data) {
|
||||
ctx.texImage2D(target, level, internalFormat, width, height, border, format, type,
|
||||
@ -261,6 +289,12 @@ public class PlatformOpenGL {
|
||||
data == null ? null : EaglerArrayBufferAllocator.getDataViewStupid(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexSubImage2Du16(int target, int level, int xoffset, int yoffset,
|
||||
int width, int height, int format, int type, ByteBuffer data) {
|
||||
ctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
|
||||
data == null ? null : EaglerArrayBufferAllocator.getDataViewStupid16(data));
|
||||
}
|
||||
|
||||
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset,
|
||||
int width, int height, int format, int type, IntBuffer data) {
|
||||
ctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
|
||||
@ -277,7 +311,11 @@ public class PlatformOpenGL {
|
||||
int x, int y, int width, int height) {
|
||||
ctx.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
public static final void _wglTexStorage2D(int target, int levels, int internalFormat, int w, int h) {
|
||||
ctx.texStorage2D(target, levels, internalFormat, w, h);
|
||||
}
|
||||
|
||||
public static final void _wglPixelStorei(int pname, int value) {
|
||||
ctx.pixelStorei(pname, value);
|
||||
}
|
||||
@ -338,74 +376,118 @@ public class PlatformOpenGL {
|
||||
|
||||
public static final void _wglDrawArrays(int mode, int first, int count) {
|
||||
ctx.drawArrays(mode, first, count);
|
||||
//checkErr("_wglDrawArrays(" + mode + ", " + first + ", " + count + ");");
|
||||
}
|
||||
|
||||
public static final void _wglDrawArraysInstanced(int mode, int first, int count, int instanced) {
|
||||
ctx.drawArraysInstanced(mode, first, count, instanced);
|
||||
//checkErr("_wglDrawArraysInstanced(" + mode + ", " + first + ", " + count + ", " + instanced + ");");
|
||||
}
|
||||
|
||||
public static final void _wglDrawElements(int mode, int count, int type, int offset) {
|
||||
ctx.drawElements(mode, count, type, offset);
|
||||
//checkErr("_wglDrawElements(" + mode + ", " + count + ", " + type + ", " + offset + ");");
|
||||
}
|
||||
|
||||
public static final void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instanced) {
|
||||
ctx.drawElementsInstanced(mode, count, type, offset, instanced);
|
||||
//checkErr("_wglDrawElementsInstanced(" + mode + ", " + count + ", " + type + ", " + offset + ", " + instanced + ");");
|
||||
}
|
||||
|
||||
public static final IUniformGL _wglGetUniformLocation(IProgramGL obj, String name) {
|
||||
return new OpenGLObjects.UniformGL(ctx.getUniformLocation(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr, name));
|
||||
WebGLUniformLocation loc = ctx.getUniformLocation(((OpenGLObjects.ProgramGL)obj).ptr, name);
|
||||
if(loc != null) {
|
||||
return new OpenGLObjects.UniformGL(loc);
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int _wglGetUniformBlockIndex(IProgramGL obj, String name) {
|
||||
int i = ctx.getUniformBlockIndex(((OpenGLObjects.ProgramGL)obj).ptr, name);
|
||||
if(i == 0xFFFFFFFFl) {
|
||||
i = -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public static final void _wglBindBufferRange(int target, int index, IBufferGL buffer, int offset, int size) {
|
||||
ctx.bindBufferRange(target, index, ((OpenGLObjects.BufferGL)buffer).ptr, offset, size);
|
||||
}
|
||||
|
||||
public static final void _wglUniformBlockBinding(IProgramGL obj, int blockIndex, int bufferIndex) {
|
||||
ctx.uniformBlockBinding(((OpenGLObjects.ProgramGL)obj).ptr, blockIndex, bufferIndex);
|
||||
}
|
||||
|
||||
public static final void _wglUniform1f(IUniformGL obj, float x) {
|
||||
ctx.uniform1f(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x);
|
||||
if(obj != null) ctx.uniform1f(((OpenGLObjects.UniformGL)obj).ptr, x);
|
||||
}
|
||||
|
||||
public static final void _wglUniform2f(IUniformGL obj, float x, float y) {
|
||||
ctx.uniform2f(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x, y);
|
||||
if(obj != null) ctx.uniform2f(((OpenGLObjects.UniformGL)obj).ptr, x, y);
|
||||
}
|
||||
|
||||
public static final void _wglUniform3f(IUniformGL obj, float x, float y, float z) {
|
||||
ctx.uniform3f(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x, y, z);
|
||||
if(obj != null) ctx.uniform3f(((OpenGLObjects.UniformGL)obj).ptr, x, y, z);
|
||||
}
|
||||
|
||||
public static final void _wglUniform4f(IUniformGL obj, float x, float y, float z, float w) {
|
||||
ctx.uniform4f(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x, y, z, w);
|
||||
if(obj != null) ctx.uniform4f(((OpenGLObjects.UniformGL)obj).ptr, x, y, z, w);
|
||||
}
|
||||
|
||||
public static final void _wglUniform1i(IUniformGL obj, int x) {
|
||||
ctx.uniform1i(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x);
|
||||
if(obj != null) ctx.uniform1i(((OpenGLObjects.UniformGL)obj).ptr, x);
|
||||
}
|
||||
|
||||
public static final void _wglUniform2i(IUniformGL obj, int x, int y) {
|
||||
ctx.uniform2i(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x, y);
|
||||
if(obj != null) ctx.uniform2i(((OpenGLObjects.UniformGL)obj).ptr, x, y);
|
||||
}
|
||||
|
||||
public static final void _wglUniform3i(IUniformGL obj, int x, int y, int z) {
|
||||
ctx.uniform3i(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x, y, z);
|
||||
if(obj != null) ctx.uniform3i(((OpenGLObjects.UniformGL)obj).ptr, x, y, z);
|
||||
}
|
||||
|
||||
public static final void _wglUniform4i(IUniformGL obj, int x, int y, int z, int w) {
|
||||
ctx.uniform4i(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, x, y, z, w);
|
||||
if(obj != null) ctx.uniform4i(((OpenGLObjects.UniformGL)obj).ptr, x, y, z, w);
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
ctx.uniformMatrix2fv(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
if(obj != null) ctx.uniformMatrix2fv(((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
mat == null ? null : EaglerArrayBufferAllocator.getFloatArrayStupid(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
ctx.uniformMatrix3fv(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
if(obj != null) ctx.uniformMatrix3fv(((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
mat == null ? null : EaglerArrayBufferAllocator.getFloatArrayStupid(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix3x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if(obj != null) ctx.uniformMatrix3x2fv(((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
mat == null ? null : EaglerArrayBufferAllocator.getFloatArrayStupid(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix4fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
ctx.uniformMatrix4fv(obj == null ? null : ((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
if(obj != null) ctx.uniformMatrix4fv(((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
mat == null ? null : EaglerArrayBufferAllocator.getFloatArrayStupid(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix4x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if(obj != null) ctx.uniformMatrix4x2fv(((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
mat == null ? null : EaglerArrayBufferAllocator.getFloatArrayStupid(mat));
|
||||
}
|
||||
|
||||
public static final void _wglUniformMatrix4x3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
|
||||
if(obj != null) ctx.uniformMatrix4x3fv(((OpenGLObjects.UniformGL)obj).ptr, transpose,
|
||||
mat == null ? null : EaglerArrayBufferAllocator.getFloatArrayStupid(mat));
|
||||
}
|
||||
|
||||
public static final void _wglBindFramebuffer(int target, IFramebufferGL framebuffer) {
|
||||
ctx.bindFramebuffer(target, framebuffer == null ? PlatformRuntime.mainFramebuffer
|
||||
: ((OpenGLObjects.FramebufferGL) framebuffer).ptr);
|
||||
if(framebuffer == null) {
|
||||
ctx.bindFramebuffer(target, PlatformRuntime.mainFramebuffer);
|
||||
ctx.drawBuffers(new int[] { WebGL2RenderingContext.COLOR_ATTACHMENT0 });
|
||||
}else {
|
||||
ctx.bindFramebuffer(target, ((OpenGLObjects.FramebufferGL) framebuffer).ptr);
|
||||
}
|
||||
}
|
||||
|
||||
public static final int _wglCheckFramebufferStatus(int target) {
|
||||
@ -418,6 +500,11 @@ public class PlatformOpenGL {
|
||||
texture == null ? null : ((OpenGLObjects.TextureGL)texture).ptr, level);
|
||||
}
|
||||
|
||||
public static final void _wglFramebufferTextureLayer(int target, int attachment, ITextureGL texture, int level, int layer) {
|
||||
ctx.framebufferTextureLayer(target, attachment,
|
||||
texture == null ? null : ((OpenGLObjects.TextureGL) texture).ptr, level, layer);
|
||||
}
|
||||
|
||||
public static final void _wglBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1,
|
||||
int dstX0, int dstY0, int dstX1, int dstY1, int bits, int filter) {
|
||||
ctx.blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, bits, filter);
|
||||
@ -470,5 +557,32 @@ public class PlatformOpenGL {
|
||||
public static final int _wglGetError() {
|
||||
return ctx.getError();
|
||||
}
|
||||
|
||||
public static final boolean checkHDRFramebufferSupport(int bits) {
|
||||
switch(bits) {
|
||||
case 16:
|
||||
return hasFramebufferHDR16FSupport;
|
||||
case 32:
|
||||
return hasFramebufferHDR32FSupport;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static final void checkErr(String name) {
|
||||
int i = ctx.getError();
|
||||
if(i != 0) {
|
||||
logger.error("########## GL ERROR ##########");
|
||||
logger.error("@ {}", name);
|
||||
do {
|
||||
logger.error("#{} - {}", i, EaglercraftGPU.gluErrorString(i));
|
||||
}while((i = ctx.getError()) != 0);
|
||||
try {
|
||||
throw new RuntimeException("GL Error Detected!");
|
||||
}catch(Throwable t) {
|
||||
logger.log(Level.ERROR, t);
|
||||
}
|
||||
logger.error("##############################");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer;
|
||||
import org.teavm.jso.typedarrays.ArrayBuffer;
|
||||
import org.teavm.jso.typedarrays.DataView;
|
||||
import org.teavm.jso.typedarrays.Float32Array;
|
||||
import org.teavm.jso.typedarrays.Uint16Array;
|
||||
import org.teavm.jso.typedarrays.Uint8Array;
|
||||
|
||||
/**
|
||||
@ -68,6 +69,19 @@ public class EaglerArrayBufferAllocator {
|
||||
}
|
||||
}
|
||||
|
||||
public static Uint16Array getDataViewStupid16(ByteBuffer buffer) {
|
||||
if(buffer instanceof EaglerArrayByteBuffer) {
|
||||
EaglerArrayByteBuffer b = (EaglerArrayByteBuffer)buffer;
|
||||
DataView d = b.dataView;
|
||||
int p = b.position;
|
||||
int l = b.limit;
|
||||
int i = d.getByteOffset();
|
||||
return Uint16Array.create(d.getBuffer(), i + p, (l - p) >> 1);
|
||||
}else {
|
||||
throw notEagler(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public static DataView getDataView(IntBuffer buffer) {
|
||||
if(buffer instanceof EaglerArrayIntBuffer) {
|
||||
EaglerArrayIntBuffer b = (EaglerArrayIntBuffer)buffer;
|
||||
|
@ -187,7 +187,10 @@ public class EaglerArrayByteBuffer implements ByteBuffer {
|
||||
@Override
|
||||
public ByteBuffer put(byte[] src) {
|
||||
if(position + src.length > limit) throw new ArrayIndexOutOfBoundsException(position + src.length - 1);
|
||||
dataView.set(src, position);
|
||||
//dataView.set(src, position); // doesn't work
|
||||
for(int i = 0; i < src.length; ++i) {
|
||||
dataView.setInt8(position + i, src[i]);
|
||||
}
|
||||
position += src.length;
|
||||
return this;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -18,6 +18,7 @@ import org.teavm.jso.webgl.WebGLRenderingContext;
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile;
|
||||
import net.minecraft.client.main.Main;
|
||||
|
||||
@ -90,6 +91,8 @@ public class MainClass {
|
||||
configLocalesFolder = configLocalesFolder.substring(0, configLocalesFolder.length() - 1);
|
||||
}
|
||||
|
||||
DeferredStateManager.doCheckErrors = eaglercraftOpts.optBoolean("checkShaderGLErrors", false);
|
||||
|
||||
((TeaVMClientConfigAdapter)TeaVMClientConfigAdapter.instance).loadJSON(eaglercraftOpts);
|
||||
|
||||
systemOut.println("MainClass: [INFO] configuration was successful");
|
||||
@ -317,10 +320,13 @@ public class MainClass {
|
||||
ret.append("webgl.renderer = ").append(ctx.getParameterString(/* UNMASKED_RENDERER_WEBGL */ 0x9246)).append('\n');
|
||||
ret.append("webgl.vendor = ").append(ctx.getParameterString(/* UNMASKED_VENDOR_WEBGL */ 0x9245)).append('\n');
|
||||
}else {
|
||||
ret.append("webgl.renderer = ").append("" + ctx.getParameterString(WebGLRenderingContext.RENDERER) + " [masked]").append('\n');
|
||||
ret.append("webgl.vendor = ").append("" + ctx.getParameterString(WebGLRenderingContext.VENDOR) + " [masked]").append('\n');
|
||||
ret.append("webgl.renderer = ").append(ctx.getParameterString(WebGLRenderingContext.RENDERER) + " [masked]").append('\n');
|
||||
ret.append("webgl.vendor = ").append(ctx.getParameterString(WebGLRenderingContext.VENDOR) + " [masked]").append('\n');
|
||||
}
|
||||
//ret.append("\nwebgl.anisotropicGlitch = ").append(DetectAnisotropicGlitch.hasGlitch()).append('\n'); //TODO
|
||||
//ret.append('\n').append("\nwebgl.anisotropicGlitch = ").append(DetectAnisotropicGlitch.hasGlitch()).append('\n'); //TODO
|
||||
ret.append('\n').append("webgl.ext.HDR16f = ").append(ctx.getExtension("EXT_color_buffer_half_float") != null).append('\n');
|
||||
ret.append("webgl.ext.HDR32f = ").append(ctx.getExtension("EXT_color_buffer_float") != null).append('\n');
|
||||
|
||||
}else {
|
||||
ret.append("Failed to query GPU info!\n");
|
||||
}
|
||||
|
@ -1,6 +1,12 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.internal.teavm;
|
||||
|
||||
import org.teavm.jso.typedarrays.ArrayBufferView;
|
||||
import org.teavm.jso.typedarrays.Float32Array;
|
||||
import org.teavm.jso.webgl.WebGLBuffer;
|
||||
import org.teavm.jso.webgl.WebGLProgram;
|
||||
import org.teavm.jso.webgl.WebGLRenderingContext;
|
||||
import org.teavm.jso.webgl.WebGLTexture;
|
||||
import org.teavm.jso.webgl.WebGLUniformLocation;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
||||
@ -16,14 +22,15 @@ import org.teavm.jso.webgl.WebGLRenderingContext;
|
||||
*
|
||||
*/
|
||||
public interface WebGL2RenderingContext extends WebGLRenderingContext {
|
||||
|
||||
int TEXTURE_MAX_LEVEL = 0x0000813D;
|
||||
int TEXTURE_MAX_ANISOTROPY_EXT = 0x000084FE;
|
||||
int UNSIGNED_INT_24_8 = 0x000084FA;
|
||||
|
||||
int TEXTURE_MAX_LEVEL = 0x0000813D;
|
||||
int TEXTURE_MAX_ANISOTROPY_EXT = 0x000084FE;
|
||||
int UNSIGNED_INT_24_8 = 0x000084FA;
|
||||
int ANY_SAMPLES_PASSED = 0x00008D6A;
|
||||
int QUERY_RESULT = 0x00008866;
|
||||
int QUERY_RESULT_AVAILABLE = 0x00008867;
|
||||
int DEPTH24_STENCIL8 = 0x000088F0;
|
||||
int DEPTH_COMPONENT24 = 0x000081A6;
|
||||
int DEPTH_COMPONENT32F = 0x00008CAC;
|
||||
int READ_FRAMEBUFFER = 0x00008CA8;
|
||||
int DRAW_FRAMEBUFFER = 0x00008CA9;
|
||||
@ -61,5 +68,24 @@ public interface WebGL2RenderingContext extends WebGLRenderingContext {
|
||||
void drawArraysInstanced(int p1, int p2, int p3, int p4);
|
||||
|
||||
void drawElementsInstanced(int p1, int p2, int p3, int p4, int p5);
|
||||
|
||||
|
||||
int getUniformBlockIndex(WebGLProgram p1, String p2);
|
||||
|
||||
void bindBufferRange(int p1, int p2, WebGLBuffer p3, int p4, int p5);
|
||||
|
||||
void uniformBlockBinding(WebGLProgram p1, int p2, int p3);
|
||||
|
||||
void uniformMatrix3x2fv(WebGLUniformLocation location, boolean transpose, Float32Array value);
|
||||
|
||||
void uniformMatrix4x2fv(WebGLUniformLocation location, boolean transpose, Float32Array value);
|
||||
|
||||
void uniformMatrix4x3fv(WebGLUniformLocation location, boolean transpose, Float32Array value);
|
||||
|
||||
void texStorage2D(int target, int levels, int internalFormat, int width, int height);
|
||||
|
||||
void texImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format,
|
||||
int type, ArrayBufferView pixels);
|
||||
|
||||
void framebufferTextureLayer(int target, int attachment, WebGLTexture texture, int level, int layer);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user