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:eu.over9000.veya.Veya.java

License:Open Source License

private static void init() throws LWJGLException {
    final Canvas canvas = new Canvas();
    frame = new Frame();
    frame.add(canvas);//from w  w w  .  j a  v  a 2  s .c o  m
    frame.setSize(1280, 720);
    frame.setLocationByPlatform(true);
    frame.setVisible(true);
    frame.setExtendedState(Frame.MAXIMIZED_BOTH);
    frame.setIconImage(loadIcon());

    Display.setParent(canvas);
    Display.create(new PixelFormat().withSamples(4).withDepthBits(24), new ContextAttribs(3, 3));

    System.out.println("OpenGL version: " + GL11.glGetString(GL11.GL_VERSION));
    System.out.println("Java version: " + System.getProperty("java.version"));
    System.out.println("graphics adapter: " + Display.getAdapter());

    Veya.program_normal = new Program("normal",
            new String[] { "modelMatrix", "viewMatrix", "projectionMatrix", "lightPosition", "lightColor",
                    "lightFactors", "colorSwitch", "aoSwitch", "cameraPosition", "lightSpaceMatrix",
                    "textureData", "shadowMap" });
    Veya.program_shadow = new Program("shadow", new String[] { "modelMatrix", "lightSpaceMatrix" });
    Veya.program_debug = new Program("debug", new String[] { "near_plane", "far_plane" });

    Util.checkGLError();

    Veya.camera = new Camera(-40, 120, -40);
    Veya.scene = new Scene(1337);

    Util.checkGLError();

    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glLineWidth(2.5f);

    Util.checkGLError();

    GL11.glEnable(GL31.GL_PRIMITIVE_RESTART);
    GL31.glPrimitiveRestartIndex(Veya.RESTART);
    GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight());
    GL11.glClearColor(124f / 255f, 169f / 255f, 255f / 255f, 1.0f);

    Mouse.setGrabbed(true);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    Console.start();
}

From source file:fr.veridiangames.client.rendering.renderers.Renderer.java

License:Open Source License

public static boolean setDX11() {
    String glVersionString = GL11.glGetString(GL11.GL_VERSION).split(" ")[0].trim();
    float glVersion = Float.parseFloat(glVersionString.substring(0, 3));
    System.out.println("Available GL Version " + glVersion);
    if (glVersion < 3.3) {
        System.err.println("Not GL33 compatible !");
        return GL33 = false;
    }// w  w w. ja va 2  s. com
    return GL33 = true;
}

From source file:io.flob.blackheart.Core.java

License:Open Source License

private void tick() {
    if (Debug.info) {
        _display.mode_2D();//from  w  w  w.  ja va  2 s.c om
        int right_offset = 180;
        int KB = 1024;

        _font.debug.render(4, 5, About.title + " " + About.version);

        _font.debug.render(4, 25, "OS_NAME: " + System.getProperty("os.name"));
        _font.debug.render(4, 35, "OS_ARCH: " + System.getProperty("os.arch"));
        _font.debug.render(4, 45, "OS_VERSION: " + System.getProperty("os.version"));
        _font.debug.render(4, 55,
                "LWJGL_VERSION: " + Sys.getVersion() + " (" + org.lwjgl.LWJGLUtil.getPlatformName() + ")");
        _font.debug.render(4, 65, "JRE_VENDOR: " + System.getProperty("java.vendor"));
        _font.debug.render(4, 75, "JRE_VERSION: " + System.getProperty("java.version"));
        _font.debug.render(4, 85, "GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
        _font.debug.render(4, 95, "GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
        _font.debug.render(4, 105, "GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));

        _font.debug.render(4, 125, ("RUNNING_IN_IDE: " + Misc.running_in_IDE()).toUpperCase());

        _font.debug.render(4, 145, "STATE: " + state.id());
        _font.debug.render(4, 155, "STATE_PREVIOUS: " + state_previous.id());

        if (state.equals(_game)) {
            _font.debug.render(4, 175, "PLAYER_POSITION: " + _game._level._barry.position());
            _font.debug.render(4, 185, "PLAYER_YAW: " + _game._level._barry.yaw());
            _font.debug.render(4, 195, "PLAYER_PITCH: " + _game._level._barry.pitch());
            _font.debug.render(4, 205, "PLAYER_RAYPICK_OBJECT: " + _game._level._barry.ray_picker().object());
            _font.debug.render(4, 215,
                    "PLAYER_RAYPICK_DISTANCE: " + _game._level._barry.ray_picker().distance());
            _font.debug.render(4, 225, "PLAYER_HEALTH: " + _game._level._barry.health());

            _font.debug.render(4, 245, "LEVEL_POINTS: " + _game._level._statistics.points());
            _font.debug.render(4, 255, "LEVEL_MOBS_KILLED: " + _game._level._statistics.mobs_killed());
            _font.debug.render(4, 265, "LEVEL_SHOTS_FIRED: " + _game._level._statistics.shots_fired());
            _font.debug.render(4, 275, "LEVEL_SECRETS_FOUND: " + _game._level._statistics.secrets_found());
            _font.debug.render(4, 285,
                    "LEVEL_PRISONERS_KILLED: " + _game._level._statistics.prisoners_killed());

            _font.debug.render(4, 305, "WEAPON_USAGES: " + _game._level._barry._armoury.weapon().usages());

            _font.debug.render(4, 325, "LEVEL_OBJECTS: " + _game._level.objects_static.size()
                    + _game._level.objects_dynamic.size());
        }

        _font.debug.render(_display.width() - right_offset, 5, "TIME: " + Misc.time());
        _font.debug.render(_display.width() - right_offset, 15, "DELTA: " + _display.delta());
        _font.debug.render(_display.width() - right_offset, 25, "FPS: " + _display.fps());
        _font.debug.render(_display.width() - right_offset, 45,
                "JVM_MAX_MEMORY: " + (Runtime.getRuntime().maxMemory() / KB) + " KB");
        _font.debug.render(_display.width() - right_offset, 55,
                "JVM_TOTAL_MEMORY: " + (Runtime.getRuntime().totalMemory() / KB) + " KB");
        _font.debug.render(_display.width() - right_offset, 65,
                "JVM_FREE_MEMORY: " + (Runtime.getRuntime().freeMemory() / KB) + " KB");
        _font.debug.render(_display.width() - right_offset, 75, "JVM_INUSE_MEMORY: "
                + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / KB) + " KB");
        _display.mode_3D();
    }
}

From source file:io.flob.blackheart.DisplayDriver.java

License:Open Source License

public DisplayDriver() throws Exception {
    init_display();//from  w w w . j  av a 2  s  .co  m
    init_GL();
    System.out.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
    System.out.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
    System.out.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
    System.out.println("#####################################");

    texture_flush = BufferedImageUtil.getTexture("", new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB),
            -1985);
}

From source file:io.flob.clicker.Core.java

License:Open Source License

private void tick() {
    if (DEBUG) {//  w ww .  j  a v  a  2  s.  c o m
        int right_offset = 180;
        int KB = 1024;

        _font.debug.render(4, 25, "OS_NAME: " + System.getProperty("os.name"));
        _font.debug.render(4, 35, "OS_ARCH: " + System.getProperty("os.arch"));
        _font.debug.render(4, 45, "OS_VERSION: " + System.getProperty("os.version"));
        _font.debug.render(4, 55,
                "LWJGL_VERSION: " + Sys.getVersion() + " (" + org.lwjgl.LWJGLUtil.getPlatformName() + ")");
        _font.debug.render(4, 65, "JRE_VENDOR: " + System.getProperty("java.vendor"));
        _font.debug.render(4, 75, "JRE_VERSION: " + System.getProperty("java.version"));
        _font.debug.render(4, 85, "GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
        _font.debug.render(4, 95, "GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
        _font.debug.render(4, 105, "GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));

        _font.debug.render(4, 125, "STATE: " + state.id());
        _font.debug.render(4, 135, "STATE_PREVIOUS: " + state_previous.id());

        if (state.equals(_game)) {
            _font.debug.render(4, 155, "LEVEL: " + _game.level);
            _font.debug.render(4, 165, "TIME: " + _game.time());
            _font.debug.render(4, 175, "OVERTIME: " + _game.over_time);
        }

        _font.debug.render(Display.getWidth() - right_offset, 5, "TIME: " + Misc.time());
        _font.debug.render(Display.getWidth() - right_offset, 15, "DELTA: " + _display.delta());
        _font.debug.render(Display.getWidth() - right_offset, 25, "FPS: " + _display.fps());
        _font.debug.render(Display.getWidth() - right_offset, 45,
                "JVM_MAX_MEMORY: " + (Runtime.getRuntime().maxMemory() / KB) + " KB");
        _font.debug.render(Display.getWidth() - right_offset, 55,
                "JVM_TOTAL_MEMORY: " + (Runtime.getRuntime().totalMemory() / KB) + " KB");
        _font.debug.render(Display.getWidth() - right_offset, 65,
                "JVM_FREE_MEMORY: " + (Runtime.getRuntime().freeMemory() / KB) + " KB");
        _font.debug.render(Display.getWidth() - right_offset, 75, "JVM_INUSE_MEMORY: "
                + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / KB) + " KB");
    }
}

From source file:io.flob.clicker.DisplayDriver.java

License:Open Source License

public DisplayDriver() throws Exception {
    init_display();//ww  w.j  ava2  s  . c om
    init_GL();
    System.out.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
    System.out.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
    System.out.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
    System.out.println("#####################################");
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static String glGetString(int name) {
    return GL11.glGetString(name);
}

From source file:ivorius.ivtoolkit.rendering.IvShaderInstance.java

License:Apache License

public static void outputShaderInfo(Logger logger) {
    String renderer = GL11.glGetString(GL11.GL_RENDERER);
    String vendor = GL11.glGetString(GL11.GL_VENDOR);
    String version = GL11.glGetString(GL11.GL_VERSION);
    boolean fboSupported = OpenGlHelper.framebufferSupported;

    String majorVersion;/*w  w w  .  java2 s.  com*/
    String minorVersion;

    String glslVersion;

    try {
        glslVersion = GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION);
    } catch (Exception ex) {
        glslVersion = "? (No GL20)";
    }

    try {
        minorVersion = "" + GL11.glGetInteger(GL30.GL_MINOR_VERSION);
        majorVersion = "" + GL11.glGetInteger(GL30.GL_MAJOR_VERSION);
    } catch (Exception ex) {
        minorVersion = "?";
        majorVersion = "? (No GL 30)";
    }

    printAlignedInfo("Vendor", vendor, logger);
    printAlignedInfo("Renderer", renderer, logger);
    printAlignedInfo("Version", version, logger);
    printAlignedInfo("Versions", getGLVersions(GLContext.getCapabilities()), logger);
    printAlignedInfo("Version Range", String.format("%s - %s", minorVersion, majorVersion), logger);
    printAlignedInfo("GLSL Version", glslVersion, logger);
    printAlignedInfo("Frame buffer object", fboSupported ? "Supported" : "Unsupported", logger);
}

From source file:jake2.desktop.LWJGLAdapter.java

License:Open Source License

@Override
public String glGetString(int name) {
    return GL11.glGetString(name);
}

From source file:jpcsp.graphics.RE.RenderingEngineLwjgl.java

License:Open Source License

public static String getVersion() {
    return GL11.glGetString(GL11.GL_VERSION);
}