當前位置: 首頁>>代碼示例>>Java>>正文


Java GL10.glOrthof方法代碼示例

本文整理匯總了Java中javax.microedition.khronos.opengles.GL10.glOrthof方法的典型用法代碼示例。如果您正苦於以下問題:Java GL10.glOrthof方法的具體用法?Java GL10.glOrthof怎麽用?Java GL10.glOrthof使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.microedition.khronos.opengles.GL10的用法示例。


在下文中一共展示了GL10.glOrthof方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    mRenderListener.onSurfaceChanged(gl, width, height);

    mEngine.setUpScene();
    if (mEngine.isCameraActive() && mEngine.getCamera() != null)
        mEngine.getCamera().update(width, height);


    // Sets the current view port to the new size.
    gl.glViewport(0, 0, width, height);
    // Select the projection matrix
    gl.glMatrixMode(GL10.GL_PROJECTION);
    // Reset the projection matrix
    gl.glLoadIdentity();
    // Select the modelview matrix
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    // Reset the modelview matrix

    gl.glOrthof(0, width, height, 0, 0, 1f);
}
 
開發者ID:ondramisar,項目名稱:AdronEngine,代碼行數:22,代碼來源:AdrGlRenderer.java

示例2: drawFadeVeil

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
private void drawFadeVeil(GL10 gl, float alpha) {
       gl.glMatrixMode(GL10.GL_PROJECTION);
       gl.glPushMatrix();

       // orthographic projection is easier to place a 2D object where I want on the screen...
       gl.glLoadIdentity();
       gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

       // Allocate object if not done yet
       if (mFadeVeil==null) {
           mFadeVeil = new FadeOutVeil(mWidth,mHeight);
           mFadeVeil.setPosition(mWidth/2, -mHeight/2, 0f);
       }
       mFadeVeil.draw(gl, alpha);

       gl.glPopMatrix();
       gl.glMatrixMode(GL_MODELVIEW);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:19,代碼來源:CoverRollLayout.java

示例3: drawTopFadeOutBand

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
private void drawTopFadeOutBand(GL10 gl) {
       gl.glMatrixMode(GL10.GL_PROJECTION);
       gl.glPushMatrix();

       // orthographic projection is easier to place a 2D object where I want on the screen...
       gl.glLoadIdentity();
       gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

       // Allocate object if not done yet
       if (mFadeOutBand==null) {
           mFadeOutBand = new FadeOutBand(mWidth,FADEOUTBAND_HEIGHT);
           mFadeOutBand.setPosition(mWidth/2, -(mHeight-FADEOUTBAND_HEIGHT/2), 0f);
       }
       mFadeOutBand.draw(gl);

       gl.glPopMatrix();
       gl.glMatrixMode(GL_MODELVIEW);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:19,代碼來源:CoverRollLayout.java

示例4: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void draw(GL10 gl) {
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glOrthof(camLeft, camRight, camTop, camBottom, -1, 1);
}
 
開發者ID:ondramisar,項目名稱:AdronEngine,代碼行數:9,代碼來源:Camera.java

示例5: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    if (height == 0) height = 1;
    float aspect = (float) width / height;

    gl.glViewport(0, 0, width, height);
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glOrthof(-10.f, 10.f, 10.f / aspect, -10.f / aspect, 0.1f, 100.f);

    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();

}
 
開發者ID:PacktPublishing,項目名稱:Building-Android-UIs-with-Custom-Views,代碼行數:15,代碼來源:GLDrawerES1.java

示例6: drawMessageBox

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
protected void drawMessageBox(GL10 gl) {
	if (mMessageBox!=null) {

		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glPushMatrix();

		// orthographic projection is easier to place a 2D object where I want on the screen...
		gl.glLoadIdentity();
		gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

		// Center horizontally, bottom vertically (y sign is weird, linked to glOrthof above, but in a way I didn't figure out)
		mMessageBox.setPosition(mWidth/2, -mHeight/2, 0f);

		// Translation animation
		float[] labelTranslation = null;
		synchronized (mTranslationLock) {
			if (mTranslationXyz != null) {
				labelTranslation = new float[3];
				labelTranslation[0] = mTranslationXyz[0]*mWidth/2; // MAGICAL
				labelTranslation[1] = 0f; // don't slide label vertically
				labelTranslation[2] = 0f; // don't slide label in z
			}
		}
		//scrolling animation
		if (mGLobalLabelScroll!=0f) {
			if (labelTranslation == null) {
				labelTranslation = new float[] {mGLobalLabelScroll,0f,0f};
			} else {
				labelTranslation[0] += mGLobalLabelScroll;
			}
		}

		if (mDrawFocus) {
			mMessageBox.drawFocus(gl, labelTranslation);
		} else {
			mMessageBox.draw(gl, mMessageBoxAlpha, labelTranslation);
		}

		gl.glPopMatrix();
	}
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:42,代碼來源:CoverLayout.java


注:本文中的javax.microedition.khronos.opengles.GL10.glOrthof方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。