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


Java GL10.glDisableClientState方法代碼示例

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


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

示例1: render

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void render(GL10 gl) {
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    if (colorIndex>4) {
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
    }
    else {
        gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
    }

    gl.glVertexPointer(2, GL10.GL_FLOAT, 0, vertexBuffer);
    if (colorIndex>4) {
        gl.glColorPointer(4, GL10.GL_FLOAT, 0, colorBuffer);
    }
    else if (colorIndex==4) {
        // single color
        gl.glColor4f(
                colorComponents[0], colorComponents[1], colorComponents[2], colorComponents[3]);
    }

    gl.glDrawArrays(glMode, 0, numVertices);
}
 
開發者ID:StringMon,項目名稱:homescreenarcade,代碼行數:22,代碼來源:GLVertexList.java

示例2: onDrawFrame

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onDrawFrame(GL10 gl) {
    gl.glClearColor(1.f, 0.f, 0.f, 1.f);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

    gl.glLoadIdentity();
    gl.glTranslatef(0.f, 0.f, -50.f);

    long time = SystemClock.uptimeMillis() % 4000L;
    float angle = 0.090f * ((int) time);
    gl.glRotatef(angle, 0.f, 0.f, 1.f);

    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glColor4f(1.f, 1.f, 1.f, 1.f);
    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer);

    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:PacktPublishing,項目名稱:Building-Android-UIs-with-Custom-Views,代碼行數:20,代碼來源:GLDrawerES1.java

示例3: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void draw(GL10 gl) {
	if (normalList == null || triangleBuffer == null) {
		return;
	}
	
	gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
	gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);
	//gl.glFrontFace(GL10.GL_CCW);
	gl.glVertexPointer(3, GL10.GL_FLOAT, 0, triangleBuffer);
	gl.glNormalPointer(GL10.GL_FLOAT,0, normalBuffer);
	gl.glDrawArrays(GL10.GL_TRIANGLES, 0, vertext_size*3);
	gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
	gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);
	

}
 
開發者ID:xhd-Git,項目名稱:3DPrint-Controller,代碼行數:17,代碼來源:STLObject.java

示例4: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
/**
 * Encapsulates the OpenGL ES instructions for drawing this shape.
 *
 * @param gl - The OpenGL ES context in which to draw this shape.
 */
public void draw(GL10 gl) {
    // Since this shape uses vertex arrays, enable them
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

    // draw the shape
    gl.glColor4f(       // set color
            color[0], color[1],
            color[2], color[3]);
    gl.glVertexPointer( // point to vertex data:
            COORDS_PER_VERTEX,
            GL10.GL_FLOAT, 0, vertexBuffer);
    gl.glDrawElements(  // draw shape:
            GL10.GL_TRIANGLES,
            drawOrder.length, GL10.GL_UNSIGNED_SHORT,
            drawListBuffer);

    // Disable vertex array drawing to avoid
    // conflicts with shapes that don't use it
    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:26,代碼來源:Square.java

示例5: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
/**
 * Encapsulates the OpenGL ES instructions for drawing this shape.
 *
 * @param gl - The OpenGL ES context in which to draw this shape.
 */
public void draw(GL10 gl) {
    // Since this shape uses vertex arrays, enable them
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

    // draw the shape
    gl.glColor4f(       // set color:
            color[0], color[1],
            color[2], color[3]);
    gl.glVertexPointer( // point to vertex data:
            COORDS_PER_VERTEX,
            GL10.GL_FLOAT, 0, vertexBuffer);
    gl.glDrawArrays(    // draw shape:
            GL10.GL_TRIANGLES, 0,
            triangleCoords.length / COORDS_PER_VERTEX);

    // Disable vertex array drawing to avoid
    // conflicts with shapes that don't use it
    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:25,代碼來源:Triangle.java

示例6: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
    public void draw(GL10 gl){
        gl.glRotatef(45f,0,0,0);
        gl.glFrontFace(GL10.GL_CCW);
        gl.glEnable(GL10.GL_CULL_FACE);
        gl.glCullFace(GL10.GL_BACK);
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glVertexPointer(3, GL10.GL_FLOAT,0,mVertexBuffer);
        gl.glColorPointer(4,GL10.GL_FIXED,0,mColorBuffer);
//        gl.glDrawArrays(GL10.GL_TRIANGLES,0,3);
        gl.glDrawElements(GL10.GL_TRIANGLES,indices.length,GL10.GL_UNSIGNED_SHORT,mIndexBuffer);
//        gl.glDrawElements(GL10.GL_COLOR_ARRAY,colors.length,GL10.GL_FLOAT,mColorBuffer);

        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
        gl.glDisable(GL10.GL_CULL_FACE);
    }
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:19,代碼來源:Square.java

示例7: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
    public void draw(GL10 gl){
        gl.glRotatef(45f,0,0,0);
        GLES20.glFrontFace(GL10.GL_CCW);
        GLES20.glEnable(GL10.GL_CULL_FACE);
        GLES20.glCullFace(GL10.GL_BACK);
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glVertexPointer(3, GL10.GL_FLOAT,0,mVertexBuffer);
        gl.glColorPointer(4,GL10.GL_FIXED,0,mColorBuffer);
//        gl.glDrawArrays(GL10.GL_TRIANGLES,0,3);
        GLES20.glDrawElements(GL10.GL_TRIANGLES,indices.length,GL10.GL_UNSIGNED_SHORT,mIndexBuffer);
//        gl.glDrawElements(GL10.GL_COLOR_ARRAY,colors.length,GL10.GL_FLOAT,mColorBuffer);

        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
        GLES20.glDisable(GL10.GL_CULL_FACE);
    }
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:19,代碼來源:Square20.java

示例8: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
    public void draw(GL10 gl) {
        gl.glClearColor(1.0f,1.0f,1.0f,1.0f);
        if(shouldLoadTexture){
            loadTexture(gl);
            shouldLoadTexture = false;
        }
        if(mTextureId != -1 && mVertexBuffer != null){
            gl.glEnable(GL10.GL_TEXTURE_2D);
            gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
            gl.glTexCoordPointer(2,GL10.GL_FLOAT,0,mVertexBuffer);
            gl.glBindTexture(GL10.GL_TEXTURE_2D,mTextureId);
        }
//        gl.glRotatef(180.0f,1,0,0);
        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glVertexPointer(2,GL10.GL_FLOAT,0,mVertexBuffer);
        gl.glDrawElements(GL10.GL_TRIANGLES, indices.length,
                GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
//        gl.glDrawArrays(GL10.GL_TRIANGLES,0,4);
        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
        if(mTextureId != -1 && mVertexBuffer != null){
            gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
            gl.glDisable(GL10.GL_TEXTURE_2D);
        }

    }
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:27,代碼來源:Texture.java

示例9: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
    public void draw(GL10 gl){
        gl.glRotatef(30f, 1, 0, 0);
        gl.glRotatef(30f, 0, 1, 0);
//        gl.glRotatef(45f, 0, 0, 1);
        gl.glFrontFace(GL10.GL_CCW);
        gl.glEnable(GL10.GL_CULL_FACE);
        gl.glCullFace(GL10.GL_BACK);
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glVertexPointer(3, GL10.GL_FLOAT,0,mVertexBuffer);
        gl.glColorPointer(4,GL10.GL_FIXED,0,mColorBuffer);
//        gl.glDrawArrays(GL10.GL_TRIANGLES,0,3);
        gl.glDrawElements(GL10.GL_TRIANGLES,indices.length,GL10.GL_UNSIGNED_SHORT,mIndexBuffer);
//        gl.glDrawElements(GL10.GL_COLOR_ARRAY,colors.length,GL10.GL_FLOAT,mColorBuffer);

        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
        gl.glDisable(GL10.GL_CULL_FACE);
    }
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:21,代碼來源:Cube.java

示例10: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void draw(GL10 gl, float alpha) {

	    gl.glDisable(GL_TEXTURE_2D);
	    gl.glEnable(GL_BLEND);
		gl.glEnableClientState(GL_VERTEX_ARRAY);
		gl.glDisableClientState(GL_COLOR_ARRAY);

		// Use mColorBuffer as a global alpha mask:
		glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL11.GL_COMBINE);
		glTexEnvx(GL_TEXTURE_ENV, GL11.GL_COMBINE_RGB, GL11.GL_REPLACE);
		glTexEnvx(GL_TEXTURE_ENV, GL11.GL_COMBINE_ALPHA, GL11.GL_MODULATE); // mix with alpha from glColor

		// Alpha from glColor will be used thanks to GL_MODULATE mode
		glColor4f(1f, 1f, 1f, 1f-alpha);

		glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);

		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFVertexBuffer);

		glDrawElements(GL_TRIANGLE_STRIP, VERTS, GL_UNSIGNED_SHORT, mIndexBuffer);
	}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:22,代碼來源:FadeOutVeil.java

示例11: drawLine

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void drawLine(GL10 gl, Position3D p3PrevPoint, Position3D p3NextPoint, com.cyzapps.VisualMFP.Color color) {
    // set the colour for the line
    gl.glColor4f(color.getF1R(), color.getF1G(), color.getF1B(), color.getF1Alpha());
    float vertices[] = {
            (float)p3PrevPoint.getX(), (float)p3PrevPoint.getY(), (float)p3PrevPoint.getZ(),
            (float)p3NextPoint.getX(), (float)p3NextPoint.getY(), (float)p3NextPoint.getZ(),

    };
    ByteBuffer byteBuffer = ByteBuffer.allocateDirect(vertices.length * 4);
    byteBuffer.order(ByteOrder.nativeOrder());
    FloatBuffer vertexBuffer;
    vertexBuffer = byteBuffer.asFloatBuffer();
    vertexBuffer.put(vertices);
    // set the cursor position to the beginning of the buffer
    vertexBuffer.position(0);
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    // Set the face rotation
    //gl.glFrontFace(GL10.GL_CW);
    // Point to our vertex buffer
    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
    // Draw the vertices as triangle strip
    gl.glDrawArrays(GL10.GL_LINES, 0, vertices.length / 3);

    // Disable the client state before leaving
    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:27,代碼來源:OGLChart.java

示例12: drawPoint

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void drawPoint(GL10 gl, Position3D p3Point, com.cyzapps.VisualMFP.Color color) {
	// 3d chart ignore point shape and size.
    gl.glColor4f(color.getF1R(), color.getF1G(), color.getF1B(), color.getF1Alpha());
    float vertices[] = {
            (float)p3Point.getX(), (float)p3Point.getY(), (float)p3Point.getZ()
            };
    ByteBuffer byteBuffer = ByteBuffer.allocateDirect(vertices.length * 4);
    byteBuffer.order(ByteOrder.nativeOrder());
    FloatBuffer vertexBuffer;
    vertexBuffer = byteBuffer.asFloatBuffer();
    vertexBuffer.put(vertices);
    // set the cursor position to the beginning of the buffer
    vertexBuffer.position(0);
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    // Set the face rotation
    //gl.glFrontFace(GL10.GL_CW);
    // Point to our vertex buffer
    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
    // Draw the vertices as triangle strip
    gl.glDrawArrays(GL10.GL_POINTS, 0, vertices.length / 3);

    // Disable the client state before leaving
    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:25,代碼來源:OGLChart.java

示例13: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
    public void draw(GL10 gl) {
//        gl.glColor4f(1.0f,0.0f,0.0f,1.0f);
//        gl.glPointSize(8.0f);
        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
        gl.glVertexPointer(3, GL10.GL_VERTEX_ARRAY,0,mVertexBuffer);
        gl.glColorPointer(4, GL10.GL_FIXED,0,mColorBuffer);
        gl.glDrawArrays(GL10.GL_POINTS,0,3);

        gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
    }
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:14,代碼來源:Point.java

示例14: drawRectangle

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void drawRectangle(GL10 gl, Position3D p3LeftTop, Position3D p3RightBottom, com.cyzapps.VisualMFP.Color color) {
	/** 3d chart ignore point shape and size. An alternative way is like
        gl.glColor3f(r, g, b);
        gl.glBegin(GL.GL_QUADS);
        gl.glVertex3f(-halfFaceSize, -halfFaceSize, halfFaceSize);
        gl.glVertex3f( halfFaceSize, -halfFaceSize, halfFaceSize);
        gl.glVertex3f( halfFaceSize,  halfFaceSize, halfFaceSize);
        gl.glVertex3f(-halfFaceSize,  halfFaceSize, halfFaceSize);
        gl.glEnd();
    */
    gl.glColor4f(color.getF1R(), color.getF1G(), color.getF1B(), color.getF1Alpha());
    float vertices[] = {
            (float)p3LeftTop.getX(), (float)p3RightBottom.getY(), (float)p3LeftTop.getZ(),
            (float)p3RightBottom.getX(), (float)p3RightBottom.getY(), (float)p3RightBottom.getZ(),
            (float)p3LeftTop.getX(), (float)p3LeftTop.getY(), (float)p3LeftTop.getZ(),
            (float)p3RightBottom.getX(), (float)p3LeftTop.getY(), (float)p3LeftTop.getZ()
            };
    ByteBuffer byteBuffer = ByteBuffer.allocateDirect(vertices.length * 4);
    byteBuffer.order(ByteOrder.nativeOrder());
    FloatBuffer vertexBuffer;
    vertexBuffer = byteBuffer.asFloatBuffer();
    vertexBuffer.put(vertices);
    // set the cursor position to the beginning of the buffer
    vertexBuffer.position(0);
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    // Set the face rotation
    //gl.glFrontFace(GL10.GL_CW);
    // Point to our vertex buffer
    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
    // Draw the vertices as triangle strip
    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);

    // Disable the client state before leaving
    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:36,代碼來源:OGLChart.java

示例15: draw

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
/**
 * same as draw in a Sprite but doesn't render a texture
 * @param gl
 */
@Override
public void draw(GL10 gl) {
    textureCoordinates = Alignment.getVertices(this, Alignment.LEFT_TOP);
    ByteBuffer byteBuf = ByteBuffer.allocateDirect(textureCoordinates.length * 4);
    byteBuf.order(ByteOrder.nativeOrder());

    mTextureBuffer = byteBuf.asFloatBuffer();
    mTextureBuffer.put(textureCoordinates);
    mTextureBuffer.position(0);

    float vertices[] = Alignment.getVertices(this, Alignment.LEFT_TOP);

    ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
    vbb.order(ByteOrder.nativeOrder());

    vertexBuffer = vbb.asFloatBuffer();
    vertexBuffer.put(vertices);
    vertexBuffer.position(0);

    ByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2);
    ibb.order(ByteOrder.nativeOrder());

    indexBuffer = ibb.asShortBuffer();
    indexBuffer.put(indices);
    indexBuffer.position(0);

    gl.glEnable(GL_BLEND);
    gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    gl.glColor4f(red / 100, green / 100, blue / 100, alpha / 100);

    gl.glFrontFace(GL10.GL_CCW);
    gl.glEnable(GL10.GL_CULL_FACE);
    gl.glCullFace(GL10.GL_BACK);

    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);


    gl.glEnable(GL10.GL_TEXTURE_2D);
    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);

    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTextureBuffer);
    gl.glBindTexture(GL10.GL_TEXTURE_2D, 0);


    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
    gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer);
    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
    gl.glDisable(GL10.GL_CULL_FACE);
}
 
開發者ID:ondramisar,項目名稱:AdronEngine,代碼行數:56,代碼來源:HitBox.java


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