public void setAlphaToCoverage(boolean value) { if (caps.contains(Caps.Multisample)) { if (value) { gl.glEnable(GLExt.GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); } else { gl.glDisable(GLExt.GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); } } }
public void glEnable(int cap) { gl.glEnable(cap); checkError(); }
public void setClipRect(int x, int y, int width, int height) { if (!context.clipRectEnabled) { gl.glEnable(GL.GL_SCISSOR_TEST); context.clipRectEnabled = true; } if (clipX != x || clipY != y || clipW != width || clipH != height) { gl.glScissor(x, y, width, height); clipX = x; clipY = y; clipW = width; clipH = height; } }
private void changeBlendMode(RenderState.BlendMode blendMode) { if (blendMode != context.blendMode) { if (blendMode == RenderState.BlendMode.Off) { gl.glDisable(GL.GL_BLEND); } else if (context.blendMode == RenderState.BlendMode.Off) { gl.glEnable(GL.GL_BLEND); } context.blendMode = blendMode; } }
public void setMainFrameBufferSrgb(boolean enableSrgb) { // Gamma correction if (!caps.contains(Caps.Srgb) && enableSrgb) { // Not supported, sorry. logger.warning("sRGB framebuffer is not supported " + "by video hardware, but was requested."); return; } setFrameBuffer(null); if (enableSrgb) { if (!getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT)) { logger.warning("Driver claims that default framebuffer " + "is not sRGB capable. Enabling anyway."); } gl.glEnable(GLExt.GL_FRAMEBUFFER_SRGB_EXT); logger.log(Level.FINER, "SRGB FrameBuffer enabled (Gamma Correction)"); } else { gl.glDisable(GLExt.GL_FRAMEBUFFER_SRGB_EXT); } }
@SuppressWarnings("fallthrough") public void initialize() { loadCapabilities(); // Initialize default state.. gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); if (caps.contains(Caps.SeamlessCubemap)) { // Enable this globally. Should be OK. gl.glEnable(GLExt.GL_TEXTURE_CUBE_MAP_SEAMLESS); } if (caps.contains(Caps.CoreProfile)) { // Core Profile requires VAO to be bound. gl3.glGenVertexArrays(intBuf16); int vaoId = intBuf16.get(0); gl3.glBindVertexArray(vaoId); } if (gl2 != null) { gl2.glEnable(GL2.GL_VERTEX_PROGRAM_POINT_SIZE); if (!caps.contains(Caps.CoreProfile)) { gl2.glEnable(GL2.GL_POINT_SPRITE); } } }
gl.glEnable(GLExt.GL_MULTISAMPLE_ARB);
gl.glEnable(GL.GL_DEPTH_TEST); context.depthTestEnabled = true; } else if (!state.isDepthTest() && context.depthTestEnabled) { gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(state.getPolyOffsetFactor(), state.getPolyOffsetUnits()); gl.glDisable(GL.GL_CULL_FACE); } else { gl.glEnable(GL.GL_CULL_FACE); gl.glEnable(GL.GL_STENCIL_TEST); gl.glStencilOpSeparate(GL.GL_FRONT, convertStencilOperation(state.getFrontStencilStencilFailOperation()),
public void glEnable(int cap) { gl.glEnable(cap); checkError(); }
public void setClipRect(int x, int y, int width, int height) { if (!context.clipRectEnabled) { gl.glEnable(GL.GL_SCISSOR_TEST); context.clipRectEnabled = true; } if (clipX != x || clipY != y || clipW != width || clipH != height) { gl.glScissor(x, y, width, height); clipX = x; clipY = y; clipW = width; clipH = height; } }
public void setAlphaToCoverage(boolean value) { if (caps.contains(Caps.Multisample)) { if (value) { gl.glEnable(GLExt.GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); } else { gl.glDisable(GLExt.GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); } } }
public void setMainFrameBufferSrgb(boolean enableSrgb) { // Gamma correction if (!caps.contains(Caps.Srgb) && enableSrgb) { // Not supported, sorry. logger.warning("sRGB framebuffer is not supported " + "by video hardware, but was requested."); return; } setFrameBuffer(null); if (enableSrgb) { if (!getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT)) { logger.warning("Driver claims that default framebuffer " + "is not sRGB capable. Enabling anyway."); } gl.glEnable(GLExt.GL_FRAMEBUFFER_SRGB_EXT); logger.log(Level.FINER, "SRGB FrameBuffer enabled (Gamma Correction)"); } else { gl.glDisable(GLExt.GL_FRAMEBUFFER_SRGB_EXT); } }
@SuppressWarnings("fallthrough") public void initialize() { loadCapabilities(); // Initialize default state.. gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); if (caps.contains(Caps.SeamlessCubemap)) { // Enable this globally. Should be OK. gl.glEnable(GLExt.GL_TEXTURE_CUBE_MAP_SEAMLESS); } if (caps.contains(Caps.CoreProfile)) { // Core Profile requires VAO to be bound. gl3.glGenVertexArrays(intBuf16); int vaoId = intBuf16.get(0); gl3.glBindVertexArray(vaoId); } if (gl2 != null) { gl2.glEnable(GL2.GL_VERTEX_PROGRAM_POINT_SIZE); if (!caps.contains(Caps.CoreProfile)) { gl2.glEnable(GL2.GL_POINT_SPRITE); } } }
gl.glEnable(GLExt.GL_MULTISAMPLE_ARB);
gl.glEnable(GL.GL_DEPTH_TEST); context.depthTestEnabled = true; } else if (!state.isDepthTest() && context.depthTestEnabled) { gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(state.getPolyOffsetFactor(), state.getPolyOffsetUnits()); gl.glDisable(GL.GL_CULL_FACE); } else { gl.glEnable(GL.GL_CULL_FACE); } else { if (context.blendMode == RenderState.BlendMode.Off) { gl.glEnable(GL.GL_BLEND); gl.glEnable(GL.GL_STENCIL_TEST); gl.glStencilOpSeparate(GL.GL_FRONT, convertStencilOperation(state.getFrontStencilStencilFailOperation()),