@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(); }
glOrtho(0, width, height, 0, 1, -1); glMatrixMode(GL_MODELVIEW); glLoadIdentity();
glOrtho(0, width, height, 0, 1, -1); 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(); } }
@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()); }
@Override public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { GL11.glOrtho(left, right, bottom, top, zNear, zFar); }
@Override public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { GL11.glOrtho(left, right, bottom, top, zNear, zFar); }
@Override public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { GL11.glOrtho(left, right, bottom, top, zNear, zFar); }
@Override public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { GL11.glOrtho(left, right, bottom, top, zNear, zFar); }
/** * Method gluOrtho2D * @param left * @param right * @param bottom * @param top */ public static void gluOrtho2D( float left, float right, float bottom, float top) { glOrtho(left, right, bottom, top, -1.0, 1.0); }
/** * 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); }
/** * 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); }
/** * @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); }
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); } }
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(); }
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(); }
private void renderOverlay(int mx, int my) { Rectangle vp = camera.getViewport(); ScaledResolution scaledresolution = new ScaledResolution(mc); int vpx = vp.x / scaledresolution.getScaleFactor(); int vph = vp.height / scaledresolution.getScaleFactor(); int vpw = vp.width / scaledresolution.getScaleFactor(); int vpy = (int) ((float) (vp.y + vp.height - 4) / (float) scaledresolution.getScaleFactor()); 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(); GL11.glTranslatef(vpx, vpy, -2000.0F); GlStateManager.disableLighting(); }
public void setOrtho() { if (_inOrthoMode) { throw new Ardor3dException("Already in Orthographic mode."); } // set up ortho mode final RendererRecord matRecord = ContextManager.getCurrentContext().getRendererRecord(); LwjglRendererUtil.switchMode(matRecord, GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); final Camera camera = Camera.getCurrentCamera(); final double viewportWidth = camera.getWidth() * (camera.getViewPortRight() - camera.getViewPortLeft()); final double viewportHeight = camera.getHeight() * (camera.getViewPortTop() - camera.getViewPortBottom()); GL11.glOrtho(0, viewportWidth, 0, viewportHeight, -1, 1); LwjglRendererUtil.switchMode(matRecord, GL11.GL_MODELVIEW); GL11.glPushMatrix(); GL11.glLoadIdentity(); _inOrthoMode = true; }
private static void fillScreen() { int w = Minecraft.getMinecraft().displayWidth; int h = Minecraft.getMinecraft().displayHeight; GL11.glPushAttrib(GL11.GL_TEXTURE_BIT | GL11.GL_DEPTH_TEST | GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glOrtho(0, w, h, 0, -1, 1); //or whatever size you want GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix(); GL11.glLoadIdentity(); drawColoredRect(new GuiRectangle(0, 0, w, h), STENCIL_COLOR); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPopMatrix(); GL11.glPopAttrib(); }