@Override public void prepareToRender() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); }
@Override public void process() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } }
@Override public void unbindFrame() { GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0); GL11.glViewport(vp.get(0), vp.get(1), vp.get(2), vp.get(3)); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, Display.getWidth(), Display.getHeight(), 0, 0, 2048f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }
@Override public void bindFrame() { vp = BufferUtils.createIntBuffer(16); GL11.glGetInteger(GL11.GL_VIEWPORT, vp); GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, frame); GL11.glViewport(0, 0, size.x(), size.y()); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, size.x(), size.y(), 0, 0, 2048f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } }
/** * Renders a quad filling the whole currently set viewport. */ public static void renderFullscreenQuad() { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); renderQuad(); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); }
glLoadIdentity(); glOrtho(0, width, height, 0, 1, -1); glMatrixMode(GL_MODELVIEW); glLoadIdentity();
glLoadIdentity(); glOrtho(0, width, height, 0, 1, -1); glMatrixMode(GL_MODELVIEW); glLoadIdentity();
@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#glLoadIdentity() */ public void glLoadIdentity() { GL11.glLoadIdentity(); }
public void resize(int width, int height) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); // coordinate system origin at lower left with width and height same as // the window GL11.glOrtho(0, width, 0, height, -1, 1); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glViewport(0, 0, width, height); } }
@Override public void setMatrix(float[] values) { if (values != null) { GL11.glLoadMatrix(getDirectBuffer(values)); } else { GL11.glLoadIdentity(); } }
private void setup2D(int width, int height) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, width, height, 0, -10, 10); glViewport(0, 0, width, height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }
/** * Enter the orthographic mode */ protected void enterOrtho() { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, screenWidth, 0, screenHeight, 1, -1); GL11.glMatrixMode(GL11.GL_MODELVIEW); }
public void setGlobalAttributes(float x, float y, float z, float sx, float sy, float sz) { // reset matrix stack if(lsz != -1) GL11.glPopMatrix(); lsz = -1; GL11.glLoadIdentity(); GL11.glTranslatef(x, y, z); GL11.glScalef(sx, sy, sz); }
/** * Enter the orthographic mode */ protected void enterOrtho() { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, screenWidth, 0, screenHeight, 1, -1); GL11.glMatrixMode(GL11.GL_MODELVIEW); }
/** * Enter the orthographic mode */ protected void enterOrtho() { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, screenWidth, 0, screenHeight, 1, -1); GL11.glMatrixMode(GL11.GL_MODELVIEW); }
protected void resetCamera() { ScaledResolution scaledresolution = new ScaledResolution(mc); GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); }
/** * @see org.newdawn.slick.opengl.renderer.SGL#enterOrtho(int, int) */ public void enterOrtho(int xsize, int ysize) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, width, height, 0, 1, -1); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glTranslatef((width-xsize)/2, (height-ysize)/2,0); }
private void initProjection() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(fov, aspect, near, far); glMatrixMode(GL_MODELVIEW); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glEnable(GL_DEPTH_TEST); }
private void setCamera (float x, float y, float z, float h, float p, float r) { GL11.glMatrixMode (GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glRotatef (90, 0,0,1); GL11.glRotatef (90, 0,1,0); GL11.glRotatef (r, 1,0,0); GL11.glRotatef (p, 0,1,0); GL11.glRotatef (-h, 0,0,1); GL11.glTranslatef (-x,-y,-z); }