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();
}
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();
}
Aggregations