Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ShortByte

Members
  • Joined

  • Last visited

  1. Hello guys, I'm currently trying around with rendering the ingame screen into a UI. For this I use the FrameBuffer of the game and render it over a new FrameBuffer. So far so good. It also works, only as soon as I want to move it, the whole image distorts. I tried a few things, but everything didn't really work. My current code: Framebuffer framebuffer = new Framebuffer(mc.displayWidth, mc.displayHeight, true); Framebuffer framebufferMC = Minecraft.getMinecraft().getFramebuffer(); framebuffer.bindFramebuffer(true); if(framebufferMC != null) { framebufferMC.bindFramebuffer(true); } else { OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0); } framebuffer.bindFramebufferTexture(); int width = mc.displayWidth / 5 * 4; int height = mc.displayHeight / 5 * 4; if (OpenGlHelper.isFramebufferEnabled()) { GlStateManager.colorMask(true, true, true, false); GlStateManager.disableDepth(); GlStateManager.depthMask(false); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); GlStateManager.ortho(0, (double) width, (double) height, 0.0D, 1000.0D, 3000.0D); GlStateManager.matrixMode(5888); GlStateManager.loadIdentity(); GlStateManager.translate(0, 0, -2000.0F); GlStateManager.viewport(0, 0, width, height); GlStateManager.enableTexture2D(); GlStateManager.disableLighting(); GlStateManager.disableAlpha(); GlStateManager.disableBlend(); GlStateManager.enableColorMaterial(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); framebufferMC.bindFramebufferTexture(); float f2 = (float) framebufferMC.framebufferWidth / (float) framebufferMC.framebufferTextureWidth; float f3 = (float) framebufferMC.framebufferHeight / (float) framebufferMC.framebufferTextureHeight; Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); bufferbuilder .pos(0, (double) height, 0.0D) .tex(0.0D, 0.0D) .color(255, 255, 255, 255) .endVertex(); bufferbuilder .pos((double) width, (double) height, 0.0D) .tex((double) f2, 0.0D) .color(255, 255, 255, 255) .endVertex(); bufferbuilder .pos((double) width, 0.0D, 0.0D) .tex((double) f2, (double) f3) .color(255, 255, 255, 255) .endVertex(); bufferbuilder .pos(0, 0.0D, 0.0D) .tex(0.0D, (double) f3) .color(255, 255, 255, 255) .endVertex(); tessellator.draw(); framebufferMC.unbindFramebufferTexture(); GlStateManager.depthMask(true); GlStateManager.colorMask(true, true, true, true); }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.