List of usage examples for org.lwjgl.opengl GL20 GL_CURRENT_PROGRAM
int GL_CURRENT_PROGRAM
To view the source code for org.lwjgl.opengl GL20 GL_CURRENT_PROGRAM.
Click Source Link
From source file:cn.lambdalib.util.client.shader.GLSLMesh.java
License:MIT License
@Override public void draw(Material mat) { //System.out.println("Current program: " + GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM)); mat.onRenderStage(RenderStage.START); mat.onRenderStage(RenderStage.TRANSFORM); mat.onRenderStage(RenderStage.BEFORE_TESSELLATE); draw(GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM)); mat.onRenderStage(RenderStage.END);/* w w w .j av a 2s. co m*/ }
From source file:cuchaz.jfxgl.prism.JFXGLContext.java
License:Open Source License
public int getShaderProgram() { return GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM); }
From source file:fr.ign.cogit.geoxygene.appli.gl.GLContext.java
License:Open Source License
/** * set the given program as the current program in use (glUse) If the * requested program is already the current one: do nothing * //from w w w . j a v a 2 s . co m * @param program * program instance * @return false on error */ public GLProgram setCurrentProgram(GLProgram program) throws GLException { if (program == null) { GL20.glUseProgram(0); RenderingStatistics.switchProgram(); this.currentProgram = null; return null; } // check if the current program is already the requested one if (program == this.getCurrentProgram()) { return program; } if (GL20.glIsProgram(program.getProgramId()) == false) { logger.error("Program Id " + program.getProgramId() + " (" + program.getName() + ") is not a valid GL program"); Thread.dumpStack(); GL20.glUseProgram(0); this.currentProgram = null; return null; } GL20.glUseProgram(program.getProgramId()); if (!GLTools.glCheckError("Use program '" + program.getName() + "' id = " + program.getProgramId())) { GL20.glUseProgram(0); this.currentProgram = null; return null; } RenderingStatistics.switchProgram(); this.currentProgram = program; // check correctness if (GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM) != this.getCurrentProgram().getProgramId() || program.getProgramId() != this.getCurrentProgram().getProgramId()) { logger.info("Set program id to " + program.getProgramId()); logger.info("Current program id to " + this.getCurrentProgram().getProgramId()); logger.info("GL Current program id " + GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM)); throw new GLException("Unable to set program id " + program.getProgramId() + " as current"); } return program; }
From source file:itdelatrisu.opsu.render.CurveRenderState.java
License:Open Source License
/** * Backup the current state of the relevant OpenGL state and change it to * what's needed to draw the curve./*from w w w .j a va2 s . c o m*/ */ private RenderState startRender() { RenderState state = new RenderState(); state.smoothedPoly = GL11.glGetBoolean(GL11.GL_POLYGON_SMOOTH); state.blendEnabled = GL11.glGetBoolean(GL11.GL_BLEND); state.depthEnabled = GL11.glGetBoolean(GL11.GL_DEPTH_TEST); state.depthWriteEnabled = GL11.glGetBoolean(GL11.GL_DEPTH_WRITEMASK); state.texEnabled = GL11.glGetBoolean(GL11.GL_TEXTURE_2D); state.texUnit = GL11.glGetInteger(GL13.GL_ACTIVE_TEXTURE); state.oldProgram = GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM); state.oldArrayBuffer = GL11.glGetInteger(GL15.GL_ARRAY_BUFFER_BINDING); GL11.glDisable(GL11.GL_POLYGON_SMOOTH); GL11.glEnable(GL11.GL_BLEND); GL14.glBlendEquation(GL14.GL_FUNC_ADD); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_1D); GL11.glBindTexture(GL11.GL_TEXTURE_1D, staticState.gradientTexture); GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); GL20.glUseProgram(0); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix(); GL11.glLoadIdentity(); return state; }
From source file:org.obsidianbox.obsidian.renderer.GuiRenderer.java
License:MIT License
@Override public void render() { // Snapshot Minecraft rendering final int mcProgId = GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM); final int mcVAID = GL11.glGetInteger(GL11.GL_VERTEX_ARRAY); updateScaledAttributes();// w ww.jav a 2 s . c o m LWJGLUtil.checkForGLError(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); pipeline.run(context); GL11.glDisable(GL11.GL_BLEND); LWJGLUtil.checkForGLError(); GL20.glUseProgram(mcProgId); GL30.glBindVertexArray(mcVAID); LWJGLUtil.checkForGLError(); }