Search in sources :

Example 1 with ContextCapabilities

use of org.lwjgl.opengl.ContextCapabilities in project lwjgl by LWJGL.

the class LWJGLInfoView method gatherInformation.

/**
	 * @param i_canvas 
	 * @return
	 */
private static String gatherInformation() {
    StringBuffer strb = new StringBuffer();
    try {
        infoNL(strb, "LWJGL feature version", getFeatureVersion("org.lwjgl"));
    } catch (Exception ex) {
        warnNL(strb, "Error retrieving feature version: " + ex.getMessage());
    }
    infoNL(strb, "LWJGL version", Sys.getVersion() + (Sys.is64Bit() ? " (64bit)" : ""));
    infoNL(strb, "Java", System.getProperty("java.version"), System.getProperty("java.vendor"));
    infoNL(strb, "Platform", LWJGLUtil.getPlatformName());
    infoNL(strb, "Graphics card", Display.getAdapter());
    infoNL(strb, "Driver version", Display.getVersion());
    infoNL(strb, "OpenGL driver version", GL11.glGetString(GL11.GL_VERSION));
    infoNL(strb, "GLU version", Registry.gluGetString(GLU.GLU_VERSION));
    infoNL(strb, "GLU extensions", Registry.gluGetString(GLU.GLU_EXTENSIONS));
    ContextCapabilities caps = GLContext.getCapabilities();
    openGLVersions(strb, caps);
    strb.append(NL).append("Capabilities").append(NL);
    TreeMap<String, Boolean> capInfos = new TreeMap<String, Boolean>();
    gatherCapabilities(caps, capInfos);
    infoGroupedCaps(strb, capInfos);
    Display.destroy();
    return strb.toString();
}
Also used : ContextCapabilities(org.lwjgl.opengl.ContextCapabilities) TreeMap(java.util.TreeMap) LWJGLException(org.lwjgl.LWJGLException)

Example 2 with ContextCapabilities

use of org.lwjgl.opengl.ContextCapabilities in project lwjgl by LWJGL.

the class SpriteShootoutCL method initGL.

private void initGL() throws LWJGLException {
    Display.setLocation((Display.getDisplayMode().getWidth() - SCREEN_WIDTH) / 2, (Display.getDisplayMode().getHeight() - SCREEN_HEIGHT) / 2);
    Display.setDisplayMode(new DisplayMode(SCREEN_WIDTH, SCREEN_HEIGHT));
    Display.setTitle("Sprite Shootout - CL");
    Display.create();
    final ContextCapabilities caps = GLContext.getCapabilities();
    if (!caps.OpenGL20)
        throw new RuntimeException("OpenGL 2.0 is required for this demo.");
    // Setup viewport
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT, -1.0, 1.0);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
    try {
        texSmallID = createTexture("res/ball_sm.png");
        texBigID = createTexture("res/ball.png");
    } catch (IOException e) {
        e.printStackTrace();
        System.exit(-1);
    }
    texID = texBigID;
    // Setup rendering state
    glEnable(GL_BLEND);
    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_ALPHA_TEST);
    glAlphaFunc(GL_GREATER, 0.0f);
    glColorMask(colorMask, colorMask, colorMask, false);
    glDepthMask(false);
    glDisable(GL_DEPTH_TEST);
    if (caps.GL_ARB_compatibility || !caps.OpenGL31)
        glEnable(GL_POINT_SPRITE);
    // Setup geometry
    org.lwjgl.opengl.Util.checkGLError();
}
Also used : DisplayMode(org.lwjgl.opengl.DisplayMode) ContextCapabilities(org.lwjgl.opengl.ContextCapabilities) IOException(java.io.IOException)

Aggregations

ContextCapabilities (org.lwjgl.opengl.ContextCapabilities)2 IOException (java.io.IOException)1 TreeMap (java.util.TreeMap)1 LWJGLException (org.lwjgl.LWJGLException)1 DisplayMode (org.lwjgl.opengl.DisplayMode)1