Code example for GL11

Methods: glLoadIdentityglScalefglTranslatef

0
            float sizeX = (float) width / (float) displayWidth * 2;
            float sizeY = (float) height / (float) displayHeight * 2;
            float sx = (float) x / (float) displayWidth * 2;
            float sy = (float) y / (float) displayHeight * 2;
 
            gl.glLoadIdentity();
            final float translateX = -1.0f + sizeX / 2.0f + sx;
            final float translateY = 1.0f - sizeY / 2.0f - sy;
            gl.glTranslatef(translateX, translateY, polyDepth);
            gl.glScalef(sizeX, sizeY, 1.0f);
        } 
 
        //! 描画する 
        quadPolygon.draw();
    } 
 
    /** 
     * ポリゴンの描画色を指定する。 
     *  
     * @param colorRGBA 
Contextual code suggestions in your IDE  Get Codota for Java