Example usage for org.lwjgl.opengl GL11 glGetString

List of usage examples for org.lwjgl.opengl GL11 glGetString

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glGetString.

Prototype

@Nullable
@NativeType("GLubyte const *")
public static String glGetString(@NativeType("GLenum") int name) 

Source Link

Document

Return strings describing properties of the current GL context.

Usage

From source file:vazkii.botania.client.core.handler.DebugHandler.java

License:Open Source License

@SubscribeEvent
public static void onDrawDebugText(RenderGameOverlayEvent.Text event) {
    World world = Minecraft.getMinecraft().theWorld;
    if (Minecraft.getMinecraft().gameSettings.showDebugInfo) {
        event.getLeft().add("");
        String version = LibMisc.VERSION;
        if (version.contains("GRADLE"))
            version = "N/A";

        event.getLeft().add(PREFIX + "pS: " + ParticleRenderDispatcher.sparkleFxCount + ", pFS: "
                + ParticleRenderDispatcher.fakeSparkleFxCount + ", pW: " + ParticleRenderDispatcher.wispFxCount
                + ", pDIW: " + ParticleRenderDispatcher.depthIgnoringWispFxCount + ", pLB: "
                + ParticleRenderDispatcher.lightningCount);
        event.getLeft()//w  w  w. j a  v  a  2 s. co m
                .add(PREFIX + "(CLIENT) netColl: "
                        + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: "
                        + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version);

        if (Minecraft.getMinecraft().isSingleplayer()) {
            UUID id = Minecraft.getMinecraft().thePlayer.getUniqueID();
            Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id);
            if (ent != null) {
                World serverWorld = Minecraft.getMinecraft().getIntegratedServer()
                        .getEntityFromUuid(id).worldObj;
                event.getLeft()
                        .add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d",
                                serverWorld.provider.getDimension(),
                                ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(),
                                ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size()));
            }
        }

        if (GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown()) {
            event.getLeft().add(PREFIX + "Config Context");
            event.getLeft().add("  shaders.enabled: " + ConfigHandler.useShaders);
            event.getLeft().add("  shaders.secondaryUnit: " + ConfigHandler.glSecondaryTextureUnit);

            ContextCapabilities caps = GLContext.getCapabilities();
            event.getLeft().add(PREFIX + "OpenGL Context");
            event.getLeft().add("  GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
            event.getLeft().add("  GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
            event.getLeft().add(
                    "  GL_SHADING_LANGUAGE_VERSION: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION));
            event.getLeft().add("  GL_MAX_TEXTURE_IMAGE_UNITS_ARB: "
                    + GL11.glGetInteger(ARBFragmentShader.GL_MAX_TEXTURE_IMAGE_UNITS_ARB));
            event.getLeft().add("  GL_ARB_multitexture: " + caps.GL_ARB_multitexture);
            event.getLeft().add("  GL_ARB_texture_non_power_of_two: " + caps.GL_ARB_texture_non_power_of_two);
            event.getLeft().add("  OpenGL13: " + caps.OpenGL13);

            if (Minecraft.getMinecraft().objectMouseOver != null
                    && Minecraft.getMinecraft().objectMouseOver.getBlockPos() != null) {
                BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
                IBlockState state = world.getBlockState(pos);
                state = state.getActualState(world, pos);
                state = state.getBlock().getExtendedState(state, world, pos);
                if (state instanceof IExtendedBlockState) {
                    try {
                        for (Map.Entry<IUnlistedProperty<?>, Optional<?>> e : ((IExtendedBlockState) state)
                                .getUnlistedProperties().entrySet()) {
                            event.getRight().add(TextFormatting.LIGHT_PURPLE + e.getKey().getName() + ": "
                                    + TextFormatting.RESET + e.getValue().orNull());
                        }
                    } catch (Throwable t) {
                        event.getRight().add("Error getting extended state");
                    }
                }
            }
        } else if (Minecraft.IS_RUNNING_ON_MAC)
            event.getLeft().add(PREFIX + "SHIFT+CMD for context");
        else
            event.getLeft().add(PREFIX + "SHIFT+CTRL for context");
    }
}

From source file:yugecin.opsudance.core.DisplayContainer.java

License:Open Source License

public void setup() throws Exception {
    width = height = -1;//from   www.ja  va2 s .c o  m
    Input.disableControllers();
    Display.setTitle("opsu!dance");
    setupResolutionOptionlist(nativeDisplayMode.getWidth(), nativeDisplayMode.getHeight());
    updateDisplayMode(OPTION_SCREEN_RESOLUTION.getValueString());
    Display.create();
    GLHelper.setIcons(new String[] { "icon16.png", "icon32.png" });
    initGL();
    glVersion = GL11.glGetString(GL11.GL_VERSION);
    glVendor = GL11.glGetString(GL11.GL_VENDOR);
    GLHelper.hideNativeCursor();
}