Class MinecraftHelios

java.lang.Object
lol.trq.helios.minecraft.MinecraftHelios

public final class MinecraftHelios extends Object
The Minecraft 1.8.9 hook: every reference to Minecraft's own classes lives in this package, reached by reflection, so the rest of Helios compiles and tests without the game.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    System property naming a shader source directory; when set, create() turns on hot reload from it.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Helios
    Creates a Helios instance for the running game: the OpenGL 4.1 core backend (which checks the context), the GlStateManager cache and the window's framebuffer size.
    static boolean
    Gives the main Minecraft framebuffer a stencil buffer, through Forge's Framebuffer.enableStencil().
    Returns the game window's framebuffer size, read from Minecraft.displayWidth and displayHeight, which are framebuffer pixels (on LWJGL 3 through Lazarus, also on high-DPI screens).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SHADER_DIR_PROPERTY

      public static final String SHADER_DIR_PROPERTY
      System property naming a shader source directory; when set, create() turns on hot reload from it.
      See Also:
  • Method Details

    • create

      public static Helios create()
      Creates a Helios instance for the running game: the OpenGL 4.1 core backend (which checks the context), the GlStateManager cache and the window's framebuffer size. Call it on the render thread once the window exists.
      Returns:
      the instance
    • enableStencil

      public static boolean enableStencil()
      Gives the main Minecraft framebuffer a stencil buffer, through Forge's Framebuffer.enableStencil(). Call it once, on the render thread, before using Helios.stencil() on screen. The framebuffer is recreated, so what was drawn so far this frame is lost.
      Returns:
      whether the framebuffer now has a stencil buffer
    • surface

      public static SurfaceSize surface(ClassLoader loader)
      Returns the game window's framebuffer size, read from Minecraft.displayWidth and displayHeight, which are framebuffer pixels (on LWJGL 3 through Lazarus, also on high-DPI screens).
      Parameters:
      loader - the class loader Minecraft's classes load through
      Returns:
      the size source