private void checkOpenGL() { boolean[] requiredCapabilities = { GLContext.getCapabilities().OpenGL12, GLContext.getCapabilities().OpenGL14, GLContext.getCapabilities().OpenGL15, GLContext.getCapabilities().OpenGL20, GLContext.getCapabilities().OpenGL21, // needed as we use GLSL 1.20 GLContext.getCapabilities().GL_ARB_framebuffer_object, // Extensions eventually included in GLContext.getCapabilities().GL_ARB_texture_float, // OpenGl 3.0 according to GLContext.getCapabilities().GL_ARB_half_float_pixel}; // http://en.wikipedia.org/wiki/OpenGL#OpenGL_3.0
if (GLContext.getCapabilities().GL_ARB_framebuffer_object) { return GL11.glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES); } else if (GLContext.getCapabilities().GL_EXT_framebuffer_multisample) { return GL11.glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT); } else { pb.makeCurrent(); if (GLContext.getCapabilities().GL_ARB_framebuffer_object) { return GL11.glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES); } else if (GLContext.getCapabilities().GL_EXT_framebuffer_multisample) { return GL11.glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT);
protected void initContextFirstTime() { if (!GLContext.getCapabilities().OpenGL20) { throw new RendererException("OpenGL 2.0 or higher is " + "required for jMonkeyEngine"); GLFbo glfbo; if (GLContext.getCapabilities().OpenGL30) { glfbo = new LwjglGLFboGL3(); } else { throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer()); if (GLContext.getCapabilities().GL_ARB_debug_output && settings.getBoolean("GraphicsDebug")) { ARBDebugOutput.glDebugMessageCallbackARB(new ARBDebugOutputCallback(new LwjglGLDebugOutputHandler()));
&& GLContext.getCapabilities().GL_ARB_multisample){ GL11.glEnable(ARBMultisample.GL_MULTISAMPLE_ARB);
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));
@Override public boolean isQueryAvailable() { // glGenQueries is available only if the GL version is 1.5 or greater return GLContext.getCapabilities().OpenGL15; }
@Override public boolean isShaderAvailable() { // glCreateShader is available only if the GL version is 2.0 or greater return GLContext.getCapabilities().OpenGL20; }
@Override public boolean isTextureBarrierAvailable() { return GLContext.getCapabilities().GL_NV_texture_barrier; } }
@Override public boolean isFramebufferObjectAvailable() { return GLContext.getCapabilities().GL_ARB_framebuffer_object; }
@Override public boolean isVertexArrayAvailable() { return GLContext.getCapabilities().GL_ARB_vertex_array_object; }
public boolean canTextureMirrorClamp() { return GLContext.getCapabilities().GL_EXT_texture_mirror_clamp; }
public boolean canSecondaryColor() { return GLContext.getCapabilities().GL_EXT_secondary_color; }
private static void setup() { if (mode != null) return; ContextCapabilities contextcapabilities = GLContext.getCapabilities(); if (contextcapabilities.OpenGL30) { mode = FboMode.GL3; GL_DRAW_FRAMEBUFFER_BINDING = GL30.GL_DRAW_FRAMEBUFFER_BINDING; } else if (contextcapabilities.GL_ARB_framebuffer_object) { mode = FboMode.ARB; GL_DRAW_FRAMEBUFFER_BINDING = ARBFramebufferObject.GL_DRAW_FRAMEBUFFER_BINDING; } else if (contextcapabilities.GL_EXT_framebuffer_object) { mode = FboMode.EXT; } else { mode = FboMode.NONE; } }
@Override public String getShadingLanguageVersion() { if (GLContext.getCapabilities().OpenGL20) { return GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION); } return null; }
public static IRenderingEngine newInstance() { if (GLContext.getCapabilities().OpenGL31) { log.info("Using RenderingEngineLwjgl31"); return new RenderingEngineLwjgl31(); } else if (GLContext.getCapabilities().OpenGL15) { log.info("Using RenderingEngineLwjgl15"); return new RenderingEngineLwjgl15(); } else if (GLContext.getCapabilities().OpenGL12) { log.info("Using RenderingEngineLwjgl12"); return new RenderingEngineLwjgl12(); } log.info("Using RenderingEngineLwjgl"); return new RenderingEngineLwjgl(); }
@MainThread protected ContextCapabilities createContextCapabilities() { return new LwjglContextCapabilities(GLContext.getCapabilities()); }
static void initialize() { ContextCapabilities caps = GLContext.getCapabilities(); if (GL20ShaderMethods.isSupported(caps)) methods = new GL20ShaderMethods(); else if (ARBShaderMethods.isSupported(caps)) methods = new ARBShaderMethods(); }
static void initialize() { ContextCapabilities caps = GLContext.getCapabilities(); if (GLBufferMethods.isSupported(caps)) methods = new GLBufferMethods(); else if (ARBBufferMethods.isSupported(caps)) methods = new ARBBufferMethods(); }
static void initialize() { ContextCapabilities caps = GLContext.getCapabilities(); if (GLArrayMethods.isSupported(caps)) methods = new GLArrayMethods(); else if (ARBArrayMethods.isSupported(caps)) methods = new ARBArrayMethods(); }
/** * Create a new graphics context around an FBO * * @param image The image we're rendering to * @throws SlickException Indicates a failure to use pbuffers */ public FBOGraphics(Image image) throws SlickException { super(image.getTexture().getTextureWidth(), image.getTexture().getTextureHeight()); this.image = image; Log.debug("Creating FBO "+image.getWidth()+"x"+image.getHeight()); boolean FBOEnabled = GLContext.getCapabilities().GL_EXT_framebuffer_object; if (!FBOEnabled) { throw new SlickException("Your OpenGL card does not support FBO and hence can't handle the dynamic images required for this application."); } init(); }