@Override @Deprecated public void loadNormalizedModelViewMatrix() { glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(normViewMatrix)); }
@Override public void loadNormalizedModelViewMatrix() { glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(normViewMatrix)); }
@Override public void loadModelViewMatrix() { glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(viewMatrix)); }
/** * Removes the rotation and scale part of the current OpenGL matrix. * Can be used to render billboards like particles. */ public static void applyBillboardOrientation() { // Fetch the current modelview matrix final FloatBuffer model = BufferUtils.createFloatBuffer(16); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, model); // And undo all rotations and scaling for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (i == j) { model.put(i * 4 + j, 1.0f); } else { model.put(i * 4 + j, 0.0f); } } } GL11.glLoadMatrix(model); }
@Override @Deprecated public void loadModelViewMatrix() { glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(getViewMatrix())); }
@Override @Deprecated public void loadProjectionMatrix() { glMatrixMode(GL_PROJECTION); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(getProjectionMatrix())); glMatrixMode(GL11.GL_MODELVIEW); }
@Override public void loadModelViewMatrix() { glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(getViewMatrix())); }
@Override public void loadProjectionMatrix() { glMatrixMode(GL_PROJECTION); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(projectionMatrix)); glMatrixMode(GL11.GL_MODELVIEW); }
@Override public void loadNormalizedModelViewMatrix() { glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(getNormViewMatrix())); }
@Override public void loadProjectionMatrix() { glMatrixMode(GL_PROJECTION); GL11.glLoadMatrix(MatrixUtils.matrixToFloatBuffer(getProjectionMatrix())); glMatrixMode(GL11.GL_MODELVIEW); }
glMatrixMode(GL11.GL_MODELVIEW); glPushMatrix(); glLoadMatrix(matrixBuffer);
@Override public void preRender() { glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0, Display.getWidth(), Display.getHeight(), 0, 0, 2048f); glMatrixMode(GL_MODELVIEW); glPushMatrix(); modelView = new Matrix4f(); modelView.setIdentity(); modelView.setTranslation(new Vector3f(0, 0, -1024f)); MatrixUtils.matrixToFloatBuffer(modelView, matrixBuffer); glLoadMatrix(matrixBuffer); matrixBuffer.rewind(); glScalef(uiScale, uiScale, uiScale); requestedCropRegion = Rect2i.createFromMinAndSize(0, 0, Display.getWidth(), Display.getHeight()); currentTextureCropRegion = requestedCropRegion; textureMat.setFloat4(CROPPING_BOUNDARIES_PARAM, requestedCropRegion.minX(), requestedCropRegion.maxX(), requestedCropRegion.minY(), requestedCropRegion.maxY()); }
/** * @see org.newdawn.slick.opengl.renderer.SGL#glLoadMatrix(java.nio.FloatBuffer) */ public void glLoadMatrix(FloatBuffer buffer) { GL11.glLoadMatrix(buffer); }
private void loadMatrix(final FloatBuffer matrix) { GL11.glLoadMatrix(matrix); }
public void restore() { GlStateManager.matrixMode(GL11.GL_PROJECTION); GL11.glLoadMatrix(projection); GlStateManager.matrixMode(GL11.GL_MODELVIEW); GL11.glLoadMatrix(modelView); OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, buffer); GL11.glViewport(viewport.get(0), viewport.get(1), viewport.get(2), viewport.get(3)); available.add(this); }
public static void loadMatrix(Matrix4d mat) { MATRIX_BUFFER.rewind(); MATRIX_BUFFER.put((float) mat.m00); MATRIX_BUFFER.put((float) mat.m01); MATRIX_BUFFER.put((float) mat.m02); MATRIX_BUFFER.put((float) mat.m03); MATRIX_BUFFER.put((float) mat.m10); MATRIX_BUFFER.put((float) mat.m11); MATRIX_BUFFER.put((float) mat.m12); MATRIX_BUFFER.put((float) mat.m13); MATRIX_BUFFER.put((float) mat.m20); MATRIX_BUFFER.put((float) mat.m21); MATRIX_BUFFER.put((float) mat.m22); MATRIX_BUFFER.put((float) mat.m23); MATRIX_BUFFER.put((float) mat.m30); MATRIX_BUFFER.put((float) mat.m31); MATRIX_BUFFER.put((float) mat.m32); MATRIX_BUFFER.put((float) mat.m33); MATRIX_BUFFER.rewind(); GL11.glLoadMatrix(MATRIX_BUFFER); }
public static void loadMatrix(@Nonnull Matrix4d mat) { MATRIX_BUFFER.rewind(); MATRIX_BUFFER.put((float) mat.m00); MATRIX_BUFFER.put((float) mat.m01); MATRIX_BUFFER.put((float) mat.m02); MATRIX_BUFFER.put((float) mat.m03); MATRIX_BUFFER.put((float) mat.m10); MATRIX_BUFFER.put((float) mat.m11); MATRIX_BUFFER.put((float) mat.m12); MATRIX_BUFFER.put((float) mat.m13); MATRIX_BUFFER.put((float) mat.m20); MATRIX_BUFFER.put((float) mat.m21); MATRIX_BUFFER.put((float) mat.m22); MATRIX_BUFFER.put((float) mat.m23); MATRIX_BUFFER.put((float) mat.m30); MATRIX_BUFFER.put((float) mat.m31); MATRIX_BUFFER.put((float) mat.m32); MATRIX_BUFFER.put((float) mat.m33); MATRIX_BUFFER.rewind(); GL11.glLoadMatrix(MATRIX_BUFFER); }
@Override public void setMatrix(float[] values) { if (values != null) { GL11.glLoadMatrix(getDirectBuffer(values)); } else { GL11.glLoadIdentity(); } }
public final void JITB$renderDisplayObject() { if(!visible()) { return; } GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix(); transform().matrix().JITB$toDoubleBuffer(modelViewMatrix); GL11.glLoadMatrix(modelViewMatrix); //GL11.glTranslated(x(), y(), 0.0); //GL11.glRotatef(_rotationRad, 0.0f, 0.0f, 1.0f); //GL11.glScaled(_scaleX, _scaleY, 1.0); GL11.glColor4d(_transform.colorTransform().redMultiplier, _transform.colorTransform().greenMultiplier, _transform.colorTransform().blueMultiplier, _transform.colorTransform().alphaMultiplier); final String blendMode = blendMode(); boolean disableDepthTest = false; if(blendMode.equals(BlendMode.ADD)) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); disableDepthTest = true; } try { JITB$render(); } finally { if(disableDepthTest) { GL11.glDisable(GL11.GL_BLEND); } GL11.glPopMatrix(); } }
public static void applyTextureTransforms(final Texture texture, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { final boolean needsReset = !record.units[unit].identityMatrix; // Should we apply the transform? final boolean doTrans = !texture.getTextureMatrix().isIdentity(); // Now do them. final RendererRecord matRecord = ContextManager.getCurrentContext().getRendererRecord(); if (doTrans) { checkAndSetUnit(unit, record, caps); LwjglRendererUtil.switchMode(matRecord, GL11.GL_TEXTURE); record.tmp_matrixBuffer.rewind(); texture.getTextureMatrix().toDoubleBuffer(record.tmp_matrixBuffer, true); record.tmp_matrixBuffer.rewind(); GL11.glLoadMatrix(record.tmp_matrixBuffer); record.units[unit].identityMatrix = false; } else if (needsReset) { checkAndSetUnit(unit, record, caps); LwjglRendererUtil.switchMode(matRecord, GL11.GL_TEXTURE); GL11.glLoadIdentity(); record.units[unit].identityMatrix = true; } // Switch back to the modelview matrix for further operations LwjglRendererUtil.switchMode(matRecord, GL11.GL_MODELVIEW); }