本文整理汇总了Java中javax.microedition.khronos.opengles.GL11Ext类的典型用法代码示例。如果您正苦于以下问题:Java GL11Ext类的具体用法?Java GL11Ext怎么用?Java GL11Ext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GL11Ext类属于javax.microedition.khronos.opengles包,在下文中一共展示了GL11Ext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MatrixTrackingGL
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public MatrixTrackingGL(GL gl) {
mgl = (GL10) gl;
if (gl instanceof GL10Ext) {
mgl10Ext = (GL10Ext) gl;
}
if (gl instanceof GL11) {
mgl11 = (GL11) gl;
}
if (gl instanceof GL11Ext) {
mgl11Ext = (GL11Ext) gl;
}
mModelView = new MatrixStack();
mProjection = new MatrixStack();
mTexture = new MatrixStack();
mCurrent = mModelView;
mMatrixMode = GL10.GL_MODELVIEW;
}
示例2: MatrixTrackingGL
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public MatrixTrackingGL(GL gl) {
mgl = (GL10) gl;
if (gl instanceof GL10Ext) {
mgl10Ext = (GL10Ext) gl;
}
if (gl instanceof GL11) {
mgl11 = (GL11) gl;
}
if (gl instanceof GL11Ext) {
mgl11Ext = (GL11Ext) gl;
}
mModelView = new MatrixStack();
mProjection = new MatrixStack();
mTexture = new MatrixStack();
mCurrent = mModelView;
mMatrixMode = GL10.GL_MODELVIEW;
}
示例3: draw
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public void draw(GL10 gl) {
gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureName);
if (mGrid == null) {
// Draw using the DrawTexture extension.
((GL11Ext) gl).glDrawTexfOES(x, y, z, width, height);
} else {
// Draw using verts or VBO verts.
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glTranslatef(
x,
y,
z);
mGrid.draw(gl, true, false);
gl.glPopMatrix();
}
}
示例4: MatrixTrackingGL
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public MatrixTrackingGL(GL gl, GLSurfaceView glSurfaceView) {
mgl = (GL10) gl;
if (gl instanceof GL10Ext) {
mgl10Ext = (GL10Ext) gl;
}
if (gl instanceof GL11) {
mgl11 = (GL11) gl;
}
if (gl instanceof GL11Ext) {
mgl11Ext = (GL11Ext) gl;
}
mGLSurfaceView = glSurfaceView;
mModelView = new MatrixStack();
mProjection = new MatrixStack();
mTexture = new MatrixStack();
mCurrent = mModelView;
mMatrixMode = GL10.GL_MODELVIEW;
}
示例5: GLWrapper
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
/**init methods*/
public GLWrapper(GL gl, GLSurfaceView glSurfaceView)
{
mGL = (GL10)gl;
if(gl instanceof GL10Ext)
{
mGL10Ext = (GL10Ext)gl;
}
if(gl instanceof GL11)
{
mGL11 = (GL11)gl;
}
if(gl instanceof GL11Ext)
{
mGL11Ext = (GL11Ext)gl;
}
if(gl instanceof GL11ExtensionPack)
{
mGL11ExtPack = (GL11ExtensionPack)gl;
}
mGLSurfaceView = glSurfaceView;
}
示例6: setTextureParameters
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
@Override
public void setTextureParameters(BasicTexture texture) {
int width = texture.getWidth();
int height = texture.getHeight();
// Define a vertically flipped crop rectangle for OES_draw_texture.
// The four values in sCropRect are: left, bottom, width, and
// height. Negative value of width or height means flip.
sCropRect[0] = 0;
sCropRect[1] = height;
sCropRect[2] = width;
sCropRect[3] = -height;
// Set texture parameters.
int target = texture.getTarget();
mGL.glBindTexture(target, texture.getId());
mGL.glTexParameterfv(target, GL11Ext.GL_TEXTURE_CROP_RECT_OES, sCropRect, 0);
mGL.glTexParameteri(target, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP_TO_EDGE);
mGL.glTexParameteri(target, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP_TO_EDGE);
mGL.glTexParameterf(target, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
mGL.glTexParameterf(target, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
}
示例7: render
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public void render(GL10 gl) {
checkCreated();
gl.glBindTexture(GL10.GL_TEXTURE_2D,m_texture);
if (m_angle==0 && GLHelpers.hasDrawTexture(gl)) {
m_cropRect[0]=0;
m_cropRect[1]=m_height;
m_cropRect[2]=m_width;
m_cropRect[3]=-m_height;
float scaledWidth=m_scaleX*m_width;
float scaledHeight=m_scaleY*m_height;
((GL11)gl).glTexParameterfv(
GL10.GL_TEXTURE_2D,
GL11Ext.GL_TEXTURE_CROP_RECT_OES,m_cropRect,0);
((GL11Ext)gl).glDrawTexfOES(
m_centerX-scaledWidth/2,m_centerY-scaledHeight/2,0,
scaledWidth,scaledHeight);
} else {
gl.glPushMatrix();
gl.glTranslatef(m_centerX,m_centerY,0);
gl.glRotatef(m_angle,0,0,1);
gl.glScalef(m_scaleX*m_width,m_scaleY*m_height,1);
GLHelpers.drawTextureXY(gl);
gl.glPopMatrix();
}
}
示例8: draw
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public void draw(GL10 gl) {
GL11 gl11 = (GL11) gl;
GL11Ext gl11Ext = (GL11Ext) gl;
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
gl11.glVertexPointer(3, GL10.GL_FLOAT, VERTEX_SIZE, 0);
gl11.glTexCoordPointer(2, GL10.GL_FLOAT, VERTEX_SIZE, VERTEX_TEXTURE_BUFFER_INDEX_OFFSET * FLOAT_SIZE);
gl.glEnableClientState(GL11Ext.GL_MATRIX_INDEX_ARRAY_OES);
gl.glEnableClientState(GL11Ext.GL_WEIGHT_ARRAY_OES);
gl11Ext.glWeightPointerOES(2, GL10.GL_FLOAT, VERTEX_SIZE, VERTEX_WEIGHT_BUFFER_INDEX_OFFSET * FLOAT_SIZE);
gl11Ext.glMatrixIndexPointerOES(2, GL10.GL_UNSIGNED_BYTE, VERTEX_SIZE, VERTEX_PALETTE_INDEX_OFFSET );
gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
gl11.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, 0);
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
gl.glDisableClientState(GL11Ext.GL_MATRIX_INDEX_ARRAY_OES);
gl.glDisableClientState(GL11Ext.GL_WEIGHT_ARRAY_OES);
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);
}
示例9: draw
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
/**
* Draw a given label at a given x,y position, expressed in pixels, with the
* lower-left-hand-corner of the view being (0,0).
*
* @param gl
* @param x
* @param y
* @param labelID
*/
public void draw(GL10 gl, float x, float y, int labelID) {
checkState(STATE_DRAWING, STATE_DRAWING);
gl.glPushMatrix();
float snappedX = (float) Math.floor(x);
float snappedY = (float) Math.floor(y);
gl.glTranslatef(snappedX, snappedY, 0.0f);
Label label = mLabels.get(labelID);
gl.glEnable(GL10.GL_TEXTURE_2D);
((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
GL11Ext.GL_TEXTURE_CROP_RECT_OES, label.mCrop, 0);
((GL11Ext)gl).glDrawTexiOES((int) snappedX, (int) snappedY, 0,
(int) label.width, (int) label.height);
gl.glPopMatrix();
}
示例10: setTextureCrop
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public static final void setTextureCrop(int[] crop) {
int cropSignature = 0;
cropSignature = (crop[0] + crop[1]) << 16;
cropSignature |= crop[2] + crop[3];
if (cropSignature != sLastSetCropSignature) {
((GL11) sGL).glTexParameteriv(GL10.GL_TEXTURE_2D, GL11Ext.GL_TEXTURE_CROP_RECT_OES,
crop, 0);
sLastSetCropSignature = cropSignature;
}
}
示例11: glMatrixIndexPointerOES
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public void glMatrixIndexPointerOES(int size, int type, int stride,
Buffer pointer) {
((GL11Ext)mGL).glMatrixIndexPointerOES( size, type, stride,
pointer);
checkError();
}
示例12: draw
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public void draw(GL10 gl, float x, float y) {
gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureID);
gl.glShadeModel(GL10.GL_FLAT);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glColor4x(0x10000, 0x10000, 0x10000, 0x10000);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glOrthof(0.0f, mViewWidth, 0.0f, mViewHeight, 0.0f, 1.0f);
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glPushMatrix();
gl.glLoadIdentity();
// Magic offsets to promote consistent rasterization.
gl.glTranslatef(0.375f, 0.375f, 0.0f);
gl.glEnable(GL10.GL_TEXTURE_2D);
((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
GL11Ext.GL_TEXTURE_CROP_RECT_OES, mUV, 0);
((GL11Ext)gl).glDrawTexiOES((int) x, (int) y, 0, textWidth, textHeight);
gl.glDisable(GL10.GL_BLEND);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glPopMatrix();
gl.glDisable(GL10.GL_TEXTURE_2D);//lkj add
}
示例13: draw
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
/**
* Draw a given label at a given x,y position, expressed in pixels, with the
* lower-left-hand-corner of the view being (0,0).
*
* @param gl
* @param x
* @param y
* @param labelID
*/
public void draw(GL10 gl, float x, float y, int labelID) {
checkState(STATE_DRAWING, STATE_DRAWING);
Label label = mLabels.get(labelID);
gl.glEnable(GL10.GL_TEXTURE_2D);
((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
GL11Ext.GL_TEXTURE_CROP_RECT_OES, label.mCrop, 0);
((GL11Ext)gl).glDrawTexiOES((int) x, (int) y, 0,
(int) label.width, (int) label.height);
}
示例14: drawBoundTexture
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
private void drawBoundTexture(
BasicTexture texture, int x, int y, int width, int height) {
// Test whether it has been rotated or flipped, if so, glDrawTexiOES
// won't work
if (isMatrixRotatedOrFlipped(mMatrixValues)) {
if (texture.hasBorder()) {
setTextureCoords(
1.0f / texture.getTextureWidth(),
1.0f / texture.getTextureHeight(),
(texture.getWidth() - 1.0f) / texture.getTextureWidth(),
(texture.getHeight() - 1.0f) / texture.getTextureHeight());
} else {
setTextureCoords(0, 0,
(float) texture.getWidth() / texture.getTextureWidth(),
(float) texture.getHeight() / texture.getTextureHeight());
}
textureRect(x, y, width, height);
} else {
// draw the rect from bottom-left to top-right
float points[] = mapPoints(
mMatrixValues, x, y + height, x + width, y);
x = (int) (points[0] + 0.5f);
y = (int) (points[1] + 0.5f);
width = (int) (points[2] + 0.5f) - x;
height = (int) (points[3] + 0.5f) - y;
if (width > 0 && height > 0) {
((GL11Ext) mGL).glDrawTexiOES(x, y, 0, width, height);
mCountTextureOES++;
}
}
}
示例15: renderRegion
import javax.microedition.khronos.opengles.GL11Ext; //导入依赖的package包/类
public void renderRegion(GL10 gl,float rx,float ry,float rw,float rh) {
checkCreated();
gl.glBindTexture(GL10.GL_TEXTURE_2D,m_texture);
if (m_angle==0 && GLHelpers.hasDrawTexture(gl)) {
m_cropRect[0]=rx;
m_cropRect[1]=rh-ry;
m_cropRect[2]=rw;
m_cropRect[3]=-rh;
float scaledWidth=m_scaleX*rw;
float scaledHeight=m_scaleY*rh;
((GL11)gl).glTexParameterfv(
GL10.GL_TEXTURE_2D,
GL11Ext.GL_TEXTURE_CROP_RECT_OES,m_cropRect,0);
((GL11Ext)gl).glDrawTexfOES(
m_centerX-scaledWidth/2,m_centerY-scaledHeight/2,0,
scaledWidth,scaledHeight);
} else {
gl.glPushMatrix();
gl.glTranslatef(m_centerX,m_centerY,0);
gl.glRotatef(m_angle,0,0,1);
gl.glScalef(m_scaleX*rw,m_scaleY*rh,1);
{
gl.glMatrixMode(GL10.GL_TEXTURE);
gl.glTranslatef(rx/m_width,ry/m_height,0);
gl.glScalef(rw/m_width,rh/m_height,1);
GLHelpers.drawTextureXY(gl);
gl.glLoadMatrixf(GLHelpers.IDENTITY_MATRIX,0);
gl.glMatrixMode(GL10.GL_MODELVIEW);
}
gl.glPopMatrix();
}
}