亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? glview.java

?? google android code package
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (C) 2006-2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package com.android.globaltime;import java.util.ArrayList;import java.util.Collections;import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.HashMap;import javax.microedition.khronos.opengles.GL10;import android.graphics.Canvas;import android.graphics.Paint;import android.view.KeyEvent;class Message {    private String mText;    private long mExpirationTime;    public Message(String text, long expirationTime) {        this.mText = text;        this.mExpirationTime = expirationTime;    }    public String getText() {        return mText;    }    public long getExpirationTime() {        return mExpirationTime;    }}/** * A helper class to simplify writing an Activity that renders using * OpenGL ES. * * <p> A GLView object stores common elements of GL state and allows * them to be modified interactively.  This is particularly useful for * determining the proper settings of parameters such as the view * frustum and light intensities during application development. * * <p> A GLView is not an actual View; instead, it is meant to be * called from within a View to perform event processing on behalf of the * actual View. * * <p> By passing key events to the GLView object from the View, * the application can automatically allow certain parameters to * be user-controlled from the keyboard.  Key events may be passed as * shown below: * * <pre> * GLView mGlView = new GLView(); * * public boolean onKeyDown(int keyCode, KeyEvent event) { *     // Hand the key to the GLView object first *     if (mGlView.processKey(keyCode)) { *         return; *     } *   *     switch (keyCode) { *     case KeyEvent.KEY_CODE_X: *         // perform app processing *         break; *      *     default: *         super.onKeyDown(keyCode, event); *         break; *     } * } * </pre> * * <p> During drawing of a frame, the GLView object should be given the * opportunity to manage GL parameters as shown below: *  * OpenGLContext mGLContext; // initialization not shown * int mNumTrianglesDrawn = 0; *  * protected void onDraw(Canvas canvas) { *     int w = getWidth(); *     int h = getHeight(); *          *     float ratio = (float) w / h; *     mGLView.setAspectRatio(ratio); * *     GL10 gl = (GL10) mGLContext.getGL(); *     mGLContext.waitNative(canvas, this); *      *     // Enable a light for the GLView to manipulate *     gl.glEnable(GL10.GL_LIGHTING); *     gl.glEnable(GL10.GL_LIGHT0); *          *     // Allow the GLView to set GL parameters *     mGLView.setTextureParameters(gl); *     mGLView.setProjection(gl); *     mGLView.setView(gl); *     mGLView.setLights(gl, GL10.GL_LIGHT0); *          *     // Draw some stuff (not shown) *     mNumTrianglesDrawn += <num triangles just drawn>; *      *     // Wait for GL drawing to complete *     mGLContext.waitGL(); *      *     // Inform the GLView of what was drawn, and ask it to display statistics *     mGLView.setNumTriangles(mNumTrianglesDrawn); *     mGLView.showMessages(canvas); *     mGLView.showStatistics(canvas, w); * }       * </pre> * * <p> At the end of each frame, following the call to * GLContext.waitGL, the showStatistics and showMessages methods * will cause additional information to be displayed. * * <p> To enter the interactive command mode, the 'tab' key must be * pressed twice in succession.  A subsequent press of the 'tab' key * exits the interactive command mode.  Entering a multi-letter code * sets the parameter to be modified. The 'newline' key erases the * current code, and the 'del' key deletes the last letter of * the code. The parameter value may be modified by pressing the * keypad left or up to decrement the value and right or down to * increment the value.  The current value will be displayed as an * overlay above the GL rendered content. *  * <p> The supported keyboard commands are as follows: * * <ul> * <li>     h - display a list of commands * <li>    fn - near frustum  * <li>    ff - far frustum  * <li>    tx - translate x * <li>    ty - translate y * <li>    tz - translate z * <li>     z - zoom (frustum size) * <li>    la - ambient light (all RGB channels) * <li>   lar - ambient light red channel * <li>   lag - ambient light green channel * <li>   lab - ambient light blue channel * <li>    ld - diffuse light (all RGB channels) * <li>   ldr - diffuse light red channel * <li>   ldg - diffuse light green channel * <li>   ldb - diffuse light blue channel * <li>    ls - specular light (all RGB channels) * <li>   lsr - specular light red channel * <li>   lsg - specular light green channel * <li>   lsb - specular light blue channel * <li>   lma - light model ambient (all RGB channels) * <li>  lmar - light model ambient light red channel * <li>  lmag - light model ambient green channel * <li>  lmab - light model ambient blue channel * <li>  tmin - texture min filter * <li>  tmag - texture mag filter * <li>  tper - texture perspective correction * </ul> *  * {@hide} */public class GLView {    private static final int DEFAULT_DURATION_MILLIS = 1000;    private static final int STATE_KEY = KeyEvent.KEYCODE_TAB;    private static final int HAVE_NONE = 0;    private static final int HAVE_ONE = 1;    private static final int HAVE_TWO = 2;    private static final float MESSAGE_Y_SPACING = 12.0f;    private int mState = HAVE_NONE;    private static final int NEAR_FRUSTUM  = 0;    private static final int FAR_FRUSTUM   = 1;    private static final int TRANSLATE_X   = 2;    private static final int TRANSLATE_Y   = 3;    private static final int TRANSLATE_Z   = 4;    private static final int ZOOM_EXPONENT = 5;    private static final int AMBIENT_INTENSITY = 6;    private static final int AMBIENT_RED = 7;    private static final int AMBIENT_GREEN = 8;    private static final int AMBIENT_BLUE = 9;    private static final int DIFFUSE_INTENSITY = 10;    private static final int DIFFUSE_RED = 11;    private static final int DIFFUSE_GREEN = 12;    private static final int DIFFUSE_BLUE = 13;    private static final int SPECULAR_INTENSITY = 14;    private static final int SPECULAR_RED = 15;    private static final int SPECULAR_GREEN = 16;    private static final int SPECULAR_BLUE = 17;    private static final int LIGHT_MODEL_AMBIENT_INTENSITY = 18;    private static final int LIGHT_MODEL_AMBIENT_RED = 19;    private static final int LIGHT_MODEL_AMBIENT_GREEN = 20;    private static final int LIGHT_MODEL_AMBIENT_BLUE = 21;    private static final int TEXTURE_MIN_FILTER = 22;    private static final int TEXTURE_MAG_FILTER = 23;    private static final int TEXTURE_PERSPECTIVE_CORRECTION = 24;    private static final String[] commands = {         "fn",        "ff",        "tx",        "ty",        "tz",        "z",        "la", "lar", "lag", "lab",        "ld", "ldr", "ldg", "ldb",        "ls", "lsr", "lsg", "lsb",        "lma", "lmar", "lmag", "lmab",        "tmin", "tmag", "tper"   };    private static final String[] labels = {        "Near Frustum",        "Far Frustum",        "Translate X",        "Translate Y",        "Translate Z",        "Zoom",        "Ambient Intensity",        "Ambient Red",        "Ambient Green",        "Ambient Blue",        "Diffuse Intensity",        "Diffuse Red",        "Diffuse Green",        "Diffuse Blue",        "Specular Intenstity",        "Specular Red",        "Specular Green",        "Specular Blue",        "Light Model Ambient Intensity",        "Light Model Ambient Red",        "Light Model Ambient Green",        "Light Model Ambient Blue",        "Texture Min Filter",        "Texture Mag Filter",        "Texture Perspective Correction",    };    private static final float[] defaults = {        5.0f, 100.0f,        0.0f, 0.0f, -50.0f,        0,        0.125f,	1.0f, 1.0f, 1.0f,        0.125f,	1.0f, 1.0f, 1.0f,        0.125f,	1.0f, 1.0f, 1.0f,        0.125f,	1.0f, 1.0f, 1.0f,        GL10.GL_NEAREST, GL10.GL_NEAREST,        GL10.GL_FASTEST    };    private static final float[] increments = {        0.01f, 0.5f,        0.125f, 0.125f, 0.125f,        1.0f,        0.03125f, 0.1f, 0.1f, 0.1f,        0.03125f, 0.1f, 0.1f, 0.1f,        0.03125f, 0.1f, 0.1f, 0.1f,        0.03125f, 0.1f, 0.1f, 0.1f,        0, 0, 0    };    private float[] params = new float[commands.length];    private static final float mZoomScale = 0.109f;    private static final float mZoomBase  = 1.01f;    private int             mParam = -1;    private float           mIncr = 0;    private Paint           mPaint = new Paint();    private float           mAspectRatio = 1.0f;    private float           mZoom;    // private boolean         mPerspectiveCorrection = false;    // private int             mTextureMinFilter = GL10.GL_NEAREST;    // private int             mTextureMagFilter = GL10.GL_NEAREST;    // Counters for FPS calculation    private boolean         mDisplayFPS = false;    private boolean         mDisplayCounts = false;    private int             mFramesFPS = 10;    private long[]          mTimes = new long[mFramesFPS];    private int             mTimesIdx = 0;    private Map<String,Message> mMessages = new HashMap<String,Message>();    /**     * Constructs a new GLView.     */    public GLView() {        mPaint.setColor(0xffffffff);        reset();    }    /**     * Sets the aspect ratio (width/height) of the screen.     *     * @param aspectRatio the screen width divided by the screen height     */    public void setAspectRatio(float aspectRatio) {        this.mAspectRatio = aspectRatio;    }        /**     * Sets the overall ambient light intensity.  This intensity will     * be used to modify the ambient light value for each of the red,     * green, and blue channels passed to glLightfv(...GL_AMBIENT...).     * The default value is 0.125f.     *     * @param intensity a floating-point value controlling the overall     * ambient light intensity.     */    public void setAmbientIntensity(float intensity) {        params[AMBIENT_INTENSITY] = intensity;    }    /**     * Sets the light model ambient intensity.  This intensity will be     * used to modify the ambient light value for each of the red,     * green, and blue channels passed to     * glLightModelfv(GL_LIGHT_MODEL_AMBIENT...).  The default value     * is 0.125f.     *     * @param intensity a floating-point value controlling the overall     * light model ambient intensity.     */    public void setLightModelAmbientIntensity(float intensity) {        params[LIGHT_MODEL_AMBIENT_INTENSITY] = intensity;    }    /**     * Sets the ambient color for the red, green, and blue channels     * that will be multiplied by the value of setAmbientIntensity and     * passed to glLightfv(...GL_AMBIENT...).  The default values are     * {1, 1, 1}.     *     * @param ambient an arry of three floats containing ambient     * red, green, and blue intensity values.     */    public void setAmbientColor(float[] ambient) {        params[AMBIENT_RED]   = ambient[0];        params[AMBIENT_GREEN] = ambient[1];        params[AMBIENT_BLUE]  = ambient[2];    }    /**     * Sets the overall diffuse light intensity.  This intensity will     * be used to modify the diffuse light value for each of the red,     * green, and blue channels passed to glLightfv(...GL_DIFFUSE...).     * The default value is 0.125f.     *     * @param intensity a floating-point value controlling the overall     * ambient light intensity.     */    public void setDiffuseIntensity(float intensity) {        params[DIFFUSE_INTENSITY] = intensity;    }    /**     * Sets the diffuse color for the red, green, and blue channels     * that will be multiplied by the value of setDiffuseIntensity and     * passed to glLightfv(...GL_DIFFUSE...).  The default values are     * {1, 1, 1}.     *     * @param diffuse an array of three floats containing diffuse     * red, green, and blue intensity values.     */    public void setDiffuseColor(float[] diffuse) {        params[DIFFUSE_RED]   = diffuse[0];        params[DIFFUSE_GREEN] = diffuse[1];        params[DIFFUSE_BLUE]  = diffuse[2];    }    /**     * Sets the overall specular light intensity.  This intensity will     * be used to modify the diffuse light value for each of the red,     * green, and blue channels passed to glLightfv(...GL_SPECULAR...).     * The default value is 0.125f.     *     * @param intensity a floating-point value controlling the overall     * ambient light intensity.     */    public void setSpecularIntensity(float intensity) {        params[SPECULAR_INTENSITY] = intensity;    }    /**     * Sets the specular color for the red, green, and blue channels     * that will be multiplied by the value of setSpecularIntensity and     * passed to glLightfv(...GL_SPECULAR...).  The default values are     * {1, 1, 1}.     *     * @param specular an array of three floats containing specular     * red, green, and blue intensity values.     */    public void setSpecularColor(float[] specular) {        params[SPECULAR_RED]   = specular[0];        params[SPECULAR_GREEN] = specular[1];        params[SPECULAR_BLUE]  = specular[2];    }    /**     * Returns the current X translation of the modelview     * transformation as passed to glTranslatef.  The default value is     * 0.0f.     *     * @return the X modelview translation as a float.     */    public float getTranslateX() {        return params[TRANSLATE_X];    }    /**     * Returns the current Y translation of the modelview     * transformation as passed to glTranslatef.  The default value is     * 0.0f.     *     * @return the Y modelview translation as a float.     */    public float getTranslateY() {        return params[TRANSLATE_Y];    }    /**     * Returns the current Z translation of the modelview     * transformation as passed to glTranslatef.  The default value is     * -50.0f.     *     * @return the Z modelview translation as a float.     */    public float getTranslateZ() {        return params[TRANSLATE_Z];    }    /**     * Sets the position of the near frustum clipping plane as passed     * to glFrustumf.  The default value is 5.0f;     *     * @param nearFrustum the near frustum clipping plane distance as     * a float.     */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费高清在线视频一区·| 蜜臀av性久久久久蜜臀aⅴ流畅 | 欧美精品色综合| 国产精品一区二区你懂的| 亚洲综合一区二区三区| 久久久久久久久岛国免费| 欧美日韩在线播放一区| 不卡电影一区二区三区| 国产在线麻豆精品观看| 亚洲大片一区二区三区| 国产精品免费免费| 欧美精品一区二区三区高清aⅴ| 色素色在线综合| 国产+成+人+亚洲欧洲自线| 手机精品视频在线观看| 亚洲视频每日更新| 国产亚洲制服色| 欧美一区二区免费| 欧美日韩在线一区二区| 91美女片黄在线观看91美女| 国产一区二区日韩精品| 日本不卡的三区四区五区| 亚洲电影一区二区三区| 亚洲男人的天堂在线观看| 国产片一区二区| 精品不卡在线视频| 日韩午夜在线观看| 欧美精品丝袜久久久中文字幕| 91久久精品日日躁夜夜躁欧美| 懂色av中文字幕一区二区三区 | 中文字幕一区二区三区在线不卡 | 欧美亚洲尤物久久| 色噜噜狠狠一区二区三区果冻| 成人av综合在线| 国产二区国产一区在线观看| 韩国理伦片一区二区三区在线播放| 青青青爽久久午夜综合久久午夜| 亚洲午夜影视影院在线观看| 一区二区三区成人| 尤物视频一区二区| 亚洲国产精品天堂| 亚洲sss视频在线视频| 亚洲国产成人av网| 亚洲成人高清在线| 日韩精品一二三区| 免费成人你懂的| 久久91精品久久久久久秒播| 精品一区二区久久| 国产精品一级二级三级| 国产91精品久久久久久久网曝门| 国产成人综合精品三级| 成人精品一区二区三区四区| 成人性生交大合| 色久优优欧美色久优优| 欧美丝袜第三区| 777欧美精品| 精品久久久久av影院| 久久久久99精品国产片| 欧美国产97人人爽人人喊| 亚洲色欲色欲www| 亚洲超碰精品一区二区| 久久狠狠亚洲综合| 国产91精品久久久久久久网曝门| 91在线免费看| 91麻豆精品国产自产在线观看一区| 制服丝袜亚洲网站| 久久综合久久鬼色中文字| 欧美韩日一区二区三区四区| 亚洲伦在线观看| 日韩影院免费视频| 国产福利精品导航| 91久久一区二区| 日韩色视频在线观看| 国产亚洲福利社区一区| 亚洲欧洲综合另类| 久久精品国产亚洲aⅴ | 欧美一区在线视频| 国产三级精品在线| 亚洲成人自拍偷拍| 狠狠v欧美v日韩v亚洲ⅴ| 成人精品小蝌蚪| 7799精品视频| 中文字幕一区二区三区乱码在线| 亚洲成人av一区二区三区| 精品一区二区综合| 91福利小视频| 久久精品日韩一区二区三区| 亚洲一区二区精品久久av| 久久99蜜桃精品| 91国偷自产一区二区开放时间| 日韩一级大片在线观看| 综合分类小说区另类春色亚洲小说欧美| 调教+趴+乳夹+国产+精品| 成人综合婷婷国产精品久久蜜臀| 欧美精品久久99| 中文字幕在线观看一区| 免费精品视频在线| 色狠狠一区二区三区香蕉| 久久久久久久久97黄色工厂| 亚洲电影激情视频网站| 成人一道本在线| 欧美videossexotv100| 一区二区三区成人在线视频| 国产xxx精品视频大全| 91精品欧美综合在线观看最新 | 天天综合色天天综合| 成人av免费在线| 欧美tickle裸体挠脚心vk| 亚洲一区二区中文在线| 国产福利一区二区三区在线视频| 4hu四虎永久在线影院成人| 亚洲欧美自拍偷拍色图| 国产麻豆9l精品三级站| 欧美视频一区二区三区四区 | 日韩欧美二区三区| 亚洲一区日韩精品中文字幕| 99国产精品一区| 国产午夜精品久久久久久久 | 日韩欧美国产1| 视频一区二区欧美| 色婷婷av一区二区三区软件| 国产精品亲子乱子伦xxxx裸| 美女被吸乳得到大胸91| 欧美区一区二区三区| 亚洲综合小说图片| 色呦呦一区二区三区| 国产精品家庭影院| yourporn久久国产精品| 亚洲国产精品av| 国产成人精品1024| 久久免费午夜影院| 国产麻豆精品久久一二三| 久久久久久久免费视频了| 九九精品一区二区| 久久五月婷婷丁香社区| 蜜臀va亚洲va欧美va天堂| 91麻豆精品国产91| 免播放器亚洲一区| 欧美精品一区二区在线观看| 精品亚洲aⅴ乱码一区二区三区| 日韩欧美国产精品一区| 狠狠v欧美v日韩v亚洲ⅴ| 久久久久久久网| 成人免费电影视频| 亚洲欧洲精品一区二区三区不卡| 成人美女视频在线看| 国产精品久久网站| 91官网在线观看| 亚洲午夜一区二区三区| 91精品久久久久久蜜臀| 久久成人综合网| 久久一区二区三区四区| 国产成人午夜片在线观看高清观看| 久久久国产精华| av中文字幕一区| 亚洲午夜精品17c| 欧美一区二区免费观在线| 国产一区二区三区精品欧美日韩一区二区三区 | 青娱乐精品视频在线| 精品国产一区二区三区四区四| 国产在线精品免费| 自拍偷自拍亚洲精品播放| 欧美午夜精品久久久久久超碰| 日韩中文字幕1| 久久久精品国产免费观看同学| 成人精品小蝌蚪| 亚洲gay无套男同| 精品日韩一区二区| 成人美女视频在线观看18| 亚洲成人av在线电影| 精品国内二区三区| 91视频免费看| 男男成人高潮片免费网站| 亚洲国产成人一区二区三区| 色激情天天射综合网| 久久成人麻豆午夜电影| 中文字幕在线播放不卡一区| 欧美三级在线看| 国产一区二区三区| 亚洲一区中文日韩| 久久精子c满五个校花| 一本到高清视频免费精品| 免费高清不卡av| 国产精品视频免费| 欧美日本国产视频| 粉嫩13p一区二区三区| 日韩中文字幕一区二区三区| 国产精品第四页| 日韩精品专区在线影院重磅| 97精品电影院| 韩国三级电影一区二区| 亚洲国产毛片aaaaa无费看| 国产午夜精品美女毛片视频| 91精品在线免费观看| 99re视频精品| 国产自产视频一区二区三区| 亚洲国产一区二区视频| 中文一区在线播放| 日韩精品在线一区二区| 欧美色爱综合网|