官方注释:https://www.khronos.org/registry/OpenGL-Refpages/
有一点要注意的是 GL10 意味着 这个借口遵从 OpenGL ES 1.0 规范。(以此类推)
本片文章参考 OpenGL ES 1.1 完成
以下为私人注释。请以官方为准。
好多方法直接百度就可以找到前人的经验
/* //device/java/android/javax/microedition/khronos/opengles/GL10.java
**
** Copyright 2006, The Android Open Source Project
**
** 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.
*/// This source file is automatically generatedpackage javax.microedition.khronos.opengles;public interface GL10 extends GL {int GL_ADD = 0x0104;int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;int GL_ALPHA = 0x1906;int GL_ALPHA_BITS = 0x0D55;int GL_ALPHA_TEST = 0x0BC0;int GL_ALWAYS = 0x0207;int GL_AMBIENT = 0x1200;int GL_AMBIENT_AND_DIFFUSE = 0x1602;int GL_AND = 0x1501;int GL_AND_INVERTED = 0x1504;int GL_AND_REVERSE = 0x1502;int GL_BACK = 0x0405;int GL_BLEND = 0x0BE2;int GL_BLUE_BITS = 0x0D54;int GL_BYTE = 0x1400;int GL_CCW = 0x0901;int GL_CLAMP_TO_EDGE = 0x812F;int GL_CLEAR = 0x1500;int GL_COLOR_ARRAY = 0x8076;int GL_COLOR_BUFFER_BIT = 0x4000;int GL_COLOR_LOGIC_OP = 0x0BF2;int GL_COLOR_MATERIAL = 0x0B57;int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;int GL_CONSTANT_ATTENUATION = 0x1207;int GL_COPY = 0x1503;int GL_COPY_INVERTED = 0x150C;int GL_CULL_FACE = 0x0B44;int GL_CW = 0x0900;int GL_DECAL = 0x2101;int GL_DECR = 0x1E03;int GL_DEPTH_BITS = 0x0D56;int GL_DEPTH_BUFFER_BIT = 0x0100;int GL_DEPTH_TEST = 0x0B71;int GL_DIFFUSE = 0x1201;int GL_DITHER = 0x0BD0;int GL_DONT_CARE = 0x1100;int GL_DST_ALPHA = 0x0304;int GL_DST_COLOR = 0x0306;int GL_EMISSION = 0x1600;int GL_EQUAL = 0x0202;int GL_EQUIV = 0x1509;int GL_EXP = 0x0800;int GL_EXP2 = 0x0801;int GL_EXTENSIONS = 0x1F03;int GL_FALSE = 0;int GL_FASTEST = 0x1101;int GL_FIXED = 0x140C;int GL_FLAT = 0x1D00;int GL_FLOAT = 0x1406;int GL_FOG = 0x0B60;int GL_FOG_COLOR = 0x0B66;int GL_FOG_DENSITY = 0x0B62;int GL_FOG_END = 0x0B64;int GL_FOG_HINT = 0x0C54;int GL_FOG_MODE = 0x0B65;int GL_FOG_START = 0x0B63;int GL_FRONT = 0x0404;int GL_FRONT_AND_BACK = 0x0408;int GL_GEQUAL = 0x0206;int GL_GREATER = 0x0204;int GL_GREEN_BITS = 0x0D53;int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B;int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A;int GL_INCR = 0x1E02;int GL_INVALID_ENUM = 0x0500;int GL_INVALID_OPERATION = 0x0502;int GL_INVALID_VALUE = 0x0501;int GL_INVERT = 0x150A;int GL_KEEP = 0x1E00;int GL_LEQUAL = 0x0203;int GL_LESS = 0x0201;int GL_LIGHT_MODEL_AMBIENT = 0x0B53;int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;int GL_LIGHT0 = 0x4000;int GL_LIGHT1 = 0x4001;int GL_LIGHT2 = 0x4002;int GL_LIGHT3 = 0x4003;int GL_LIGHT4 = 0x4004;int GL_LIGHT5 = 0x4005;int GL_LIGHT6 = 0x4006;int GL_LIGHT7 = 0x4007;int GL_LIGHTING = 0x0B50;int GL_LINE_LOOP = 0x0002;int GL_LINE_SMOOTH = 0x0B20;int GL_LINE_SMOOTH_HINT = 0x0C52;int GL_LINE_STRIP = 0x0003;int GL_LINEAR = 0x2601;int GL_LINEAR_ATTENUATION = 0x1208;int GL_LINEAR_MIPMAP_LINEAR = 0x2703;int GL_LINEAR_MIPMAP_NEAREST = 0x2701;int GL_LINES = 0x0001;int GL_LUMINANCE = 0x1909;int GL_LUMINANCE_ALPHA = 0x190A;int GL_MAX_ELEMENTS_INDICES = 0x80E9;int GL_MAX_ELEMENTS_VERTICES = 0x80E8;int GL_MAX_LIGHTS = 0x0D31;int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;int GL_MAX_TEXTURE_SIZE = 0x0D33;int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;int GL_MAX_TEXTURE_UNITS = 0x84E2;int GL_MAX_VIEWPORT_DIMS = 0x0D3A;int GL_MODELVIEW = 0x1700;int GL_MODULATE = 0x2100;int GL_MULTISAMPLE = 0x809D;int GL_NAND = 0x150E;int GL_NEAREST = 0x2600;int GL_NEAREST_MIPMAP_LINEAR = 0x2702;int GL_NEAREST_MIPMAP_NEAREST = 0x2700;int GL_NEVER = 0x0200;int GL_NICEST = 0x1102;int GL_NO_ERROR = 0;int GL_NOOP = 0x1505;int GL_NOR = 0x1508;int GL_NORMAL_ARRAY = 0x8075;int GL_NORMALIZE = 0x0BA1;int GL_NOTEQUAL = 0x0205;int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;int GL_ONE = 1;int GL_ONE_MINUS_DST_ALPHA = 0x0305;int GL_ONE_MINUS_DST_COLOR = 0x0307;int GL_ONE_MINUS_SRC_ALPHA = 0x0303;int GL_ONE_MINUS_SRC_COLOR = 0x0301;int GL_OR = 0x1507;int GL_OR_INVERTED = 0x150D;int GL_OR_REVERSE = 0x150B;int GL_OUT_OF_MEMORY = 0x0505;int GL_PACK_ALIGNMENT = 0x0D05;int GL_PALETTE4_R5_G6_B5_OES = 0x8B92;int GL_PALETTE4_RGB5_A1_OES = 0x8B94;int GL_PALETTE4_RGB8_OES = 0x8B90;int GL_PALETTE4_RGBA4_OES = 0x8B93;int GL_PALETTE4_RGBA8_OES = 0x8B91;int GL_PALETTE8_R5_G6_B5_OES = 0x8B97;int GL_PALETTE8_RGB5_A1_OES = 0x8B99;int GL_PALETTE8_RGB8_OES = 0x8B95;int GL_PALETTE8_RGBA4_OES = 0x8B98;int GL_PALETTE8_RGBA8_OES = 0x8B96;int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;int GL_POINT_SMOOTH = 0x0B10;int GL_POINT_SMOOTH_HINT = 0x0C51;int GL_POINTS = 0x0000;int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;int GL_POINT_SIZE = 0x0B11;int GL_POLYGON_OFFSET_FILL = 0x8037;int GL_POLYGON_SMOOTH_HINT = 0x0C53;int GL_POSITION = 0x1203;int GL_PROJECTION = 0x1701;int GL_QUADRATIC_ATTENUATION = 0x1209;int GL_RED_BITS = 0x0D52;int GL_RENDERER = 0x1F01;int GL_REPEAT = 0x2901;int GL_REPLACE = 0x1E01;int GL_RESCALE_NORMAL = 0x803A;int GL_RGB = 0x1907;int GL_RGBA = 0x1908;int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;int GL_SAMPLE_COVERAGE = 0x80A0;int GL_SCISSOR_TEST = 0x0C11;int GL_SET = 0x150F;int GL_SHININESS = 0x1601;int GL_SHORT = 0x1402;int GL_SMOOTH = 0x1D01;int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;int GL_SPECULAR = 0x1202;int GL_SPOT_CUTOFF = 0x1206;int GL_SPOT_DIRECTION = 0x1204;int GL_SPOT_EXPONENT = 0x1205;int GL_SRC_ALPHA = 0x0302;int GL_SRC_ALPHA_SATURATE = 0x0308;int GL_SRC_COLOR = 0x0300;int GL_STACK_OVERFLOW = 0x0503;int GL_STACK_UNDERFLOW = 0x0504;int GL_STENCIL_BITS = 0x0D57;int GL_STENCIL_BUFFER_BIT = 0x0400;int GL_STENCIL_TEST = 0x0B90;int GL_SUBPIXEL_BITS = 0x0D50;int GL_TEXTURE = 0x1702;int GL_TEXTURE_2D = 0x0DE1;int GL_TEXTURE_COORD_ARRAY = 0x8078;int GL_TEXTURE_ENV = 0x2300;int GL_TEXTURE_ENV_COLOR = 0x2201;int GL_TEXTURE_ENV_MODE = 0x2200;int GL_TEXTURE_MAG_FILTER = 0x2800;int GL_TEXTURE_MIN_FILTER = 0x2801;int GL_TEXTURE_WRAP_S = 0x2802;int GL_TEXTURE_WRAP_T = 0x2803;int GL_TEXTURE0 = 0x84C0;int GL_TEXTURE1 = 0x84C1;int GL_TEXTURE2 = 0x84C2;int GL_TEXTURE3 = 0x84C3;int GL_TEXTURE4 = 0x84C4;int GL_TEXTURE5 = 0x84C5;int GL_TEXTURE6 = 0x84C6;int GL_TEXTURE7 = 0x84C7;int GL_TEXTURE8 = 0x84C8;int GL_TEXTURE9 = 0x84C9;int GL_TEXTURE10 = 0x84CA;int GL_TEXTURE11 = 0x84CB;int GL_TEXTURE12 = 0x84CC;int GL_TEXTURE13 = 0x84CD;int GL_TEXTURE14 = 0x84CE;int GL_TEXTURE15 = 0x84CF;int GL_TEXTURE16 = 0x84D0;int GL_TEXTURE17 = 0x84D1;int GL_TEXTURE18 = 0x84D2;int GL_TEXTURE19 = 0x84D3;int GL_TEXTURE20 = 0x84D4;int GL_TEXTURE21 = 0x84D5;int GL_TEXTURE22 = 0x84D6;int GL_TEXTURE23 = 0x84D7;int GL_TEXTURE24 = 0x84D8;int GL_TEXTURE25 = 0x84D9;int GL_TEXTURE26 = 0x84DA;int GL_TEXTURE27 = 0x84DB;int GL_TEXTURE28 = 0x84DC;int GL_TEXTURE29 = 0x84DD;int GL_TEXTURE30 = 0x84DE;int GL_TEXTURE31 = 0x84DF;
/**
triangle fan 直译做三角形扇状物
实际本绘制模式的绘制方式是。
三维坐标系统一个点的坐标为(x,y,z)假若现在我们有7个点并且z值均为0[a,b,c,d,e,f,g]
那么在这种模式下绘制出的图像为(abc,acd,ade,aef,afg)几个个三角形共同构成的物体。
关于几个三角形从哪一个点开始绘制到哪一个点结束:http://blog.csdn.net/xiajun07061225/article/details/7455283#reply
*/ int GL_TRIANGLE_FAN = 0x0006;
/**
triangle strip 直译做三角形带状物。
实际上在绘制模式中这个参数代表的含义是逐个绘制三角形
三维坐标系统一个点的坐标为(x,y,z)假若现在我们有7个点并且z值均为0[a,b,c,d,e,f,g]
那么在这种模式下绘制出的图像为(abc,cde,efg)三个三角形共同构成的物体。
关于几个三角形从哪一个点开始绘制到哪一个点结束:http://blog.csdn.net/xiajun07061225/article/details/7455283#reply
*/int GL_TRIANGLE_STRIP = 0x0005;int GL_TRIANGLES = 0x0004;int GL_TRUE = 1;int GL_UNPACK_ALIGNMENT = 0x0CF5;int GL_UNSIGNED_BYTE = 0x1401;int GL_UNSIGNED_SHORT = 0x1403;int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;int GL_VENDOR = 0x1F00;int GL_VERSION = 0x1F02;int GL_VERTEX_ARRAY = 0x8074;int GL_XOR = 0x1506;int GL_ZERO = 0;void glActiveTexture(int texture);void glAlphaFunc(int func,float ref);void glAlphaFuncx(int func,int ref);/**
为target绑定我们创建好的纹理对象,当新的纹理对象被绑定后,之前绑定的纹理对象会自动解绑。
target默认的纹理目标是 0 `glBindTexture(target,0);`意味着解绑所有纹理对象,恢复到初始化的状态。
(就OpenGL ES 1.1而言,1.0的标准没找到)参数:
target- 只能是 GL_TEXTURE_2D。
texture- 我们创建的纹理对象的ID。(可以通过glGenTextures()方法可以创建纹理对象。)
*/void glBindTexture(int target,int texture);void glBlendFunc(int sfactor,int dfactor);void glClear(int mask);/**
指定缓冲区的颜色值。 通过`glClear()`使用缓冲区中的颜色清屏。参数:red-green-blue-alpha-透明度参数默认值是0,取值区间[0,1]相关:`glGet**()`获取此值的参数是 `GL_COLOR_CLEAR_VALUE`。
*/void glClearColor(float red,float green,float blue,float alpha);void glClearColorx(int red,int green,int blue,int alpha);/**
指定深度缓冲区的清除值。
类似`glClearColor()`
被方法使用后,再调用`glClear(GL_DEPTH_CLEAR_VALUE)`深度值就会修改为设置的值`depth`参数:depth- 默认初值为1.0f取值范围[0,1]
*/void glClearDepthf(float depth);void glClearDepthx(int depth);void glClearStencil(int s);void glClientActiveTexture(int texture);void glColor4f(float red,float green,float blue,float alpha);void glColor4x(int red,int green,int blue,int alpha);void glColorMask(boolean red,boolean green,boolean blue,boolean alpha);void glColorPointer(int size,int type,int stride,java.nio.Buffer pointer);void glCompressedTexImage2D(int target,int level,int internalformat,int width,int height,int border,int imageSize,java.nio.Buffer data);void glCompressedTexSubImage2D(int target,int level,int xoffset,int yoffset,int width,int height,int format,int imageSize,java.nio.Buffer data);void glCopyTexImage2D(int target,int level,int internalformat,int x,int y,int width,int height,int border);void glCopyTexSubImage2D(int target,int level,int xoffset,int yoffset,int x,int y,int width,int height);void glCullFace(int mode);void glDeleteTextures(int n,int[] textures,int offset);void glDeleteTextures(int n,java.nio.IntBuffer textures);/**
指定(*和*)比较的方法。
*/void glDepthFunc(int func);void glDepthMask(boolean flag);void glDepthRangef(float zNear,float zFar);void glDepthRangex(int zNear,int zFar);void glDisable(int cap);void glDisableClientState(int array);/**
根据数组中的数据进行渲染。
参数:mode- 渲染模式(可选):GL_POINTS,GL_LINE_STRIP,GL_LINE_LOOP,GL_LINES,GL_TRIANGLE_STRIP,GL_TRIANGLE_FAN, GL_TRIANGLES 三角形first- 开始渲染的收个坐标在数组中的索引。count- 需要需要渲染的坐标总数。
*/void glDrawArrays(int mode,int first,int count);void glDrawElements(int mode,int count,int type,java.nio.Buffer indices);
/**
OpenGl 函数。用于启用各种功能。具体功能由参数决定。与glDisable相对应。glDisable用以关闭各项功能。参数取值意义:GL_DEPTH_TEST- 如果启用并且深度缓冲值为非0,就做深度比较并更新缓冲区。GL_CULL_FACE- 打开忽略渲染设置。(`gl.glCullFace(GL10.GL_BACK);`指定背面不用渲染)提高效率。*/void glEnable(int cap);/**
启用或禁用客户端的某种能力(能力视参数而定)。(这个是历史遗留问题,它本应该归结到 `glEnable` 方法中去,但是没有。)
参数释义:GL_VERTEX_ARRAY-如果启用顶点数组允许写入,并且在渲染的时候使用顶点数组
*/void glEnableClientState(int array);void glFinish();void glFlush();void glFogf(int pname,float param);void glFogfv(int pname,float[] params,int offset);void glFogfv(int pname,java.nio.FloatBuffer params);void glFogx(int pname,int param);void glFogxv(int pname,int[] params,int offset);void glFogxv(int pname,java.nio.IntBuffer params);/**
定义多边形的正面或者背面。参数:mode- 可选值:`GL_CW、GL_CCW ` 默认为GL_CCWGL_CCW 表示窗口坐标上投影多边形的顶点顺序为逆时针方向的表面为正面。GL_CW 表示顶点顺序为顺时针方向的表面为正面。
*/void glFrontFace(int mode);void glFrustumf(float left,float right,float bottom,float top,float zNear,float zFar);void glFrustumx(int left,int right,int bottom,int top,int zNear,int zFar);/**
告诉OpenGL 创建 纹理对象 并把纹理对象的ID保存到数组中(和纹理对象的ID和指针的概念很相似)。
参数:n- 要创建的纹理对象的个数。(通常一个就够了)textures- 存放纹理对象ID的数组(通常数组的长度和 上一个参数 n 对应)offset- 偏移量(从textures数组中第offset位置处开始存放对象ID)
*/void glGenTextures(int n,int[] textures,int offset);void glGenTextures(int n,java.nio.IntBuffer textures);int glGetError();
/**
根据参数获取指定的值或值的集合。
*/void glGetIntegerv(int pname,int[] params,int offset);void glGetIntegerv(int pname,java.nio.IntBuffer params);public String glGetString(int name);void glHint(int target,int mode);void glLightModelf(int pname,float param);void glLightModelfv(int pname,float[] params,int offset);void glLightModelfv(int pname,java.nio.FloatBuffer params);void glLightModelx(int pname,int param);void glLightModelxv(int pname,int[] params,int offset);void glLightModelxv(int pname,java.nio.IntBuffer params);void glLightf(int light,int pname,float param);void glLightfv(int light,int pname,float[] params,int offset);void glLightfv(int light,int pname,java.nio.FloatBuffer params);void glLightx(int light,int pname,int param);void glLightxv(int light,int pname,int[] params,int offset);void glLightxv(int light,int pname,java.nio.IntBuffer params);void glLineWidth(float width);void glLineWidthx(int width);/**
将当前矩阵替换为单位矩阵。
*/void glLoadIdentity();void glLoadMatrixf(float[] m,int offset);void glLoadMatrixf(java.nio.FloatBuffer m);void glLoadMatrixx(int[] m,int offset);void glLoadMatrixx(java.nio.IntBuffer m);void glLogicOp(int opcode);void glMaterialf(int face,int pname,float param);void glMaterialfv(int face,int pname,float[] params,int offset);void glMaterialfv(int face,int pname,java.nio.FloatBuffer params);void glMaterialx(int face,int pname,int param);void glMaterialxv(int face,int pname,int[] params,int offset);void glMaterialxv(int face,int pname,java.nio.IntBuffer params);void glMatrixMode(int mode);void glMultMatrixf(float[] m,int offset);void glMultMatrixf(java.nio.FloatBuffer m);void glMultMatrixx(int[] m,int offset);void glMultMatrixx(java.nio.IntBuffer m);void glMultiTexCoord4f(int target,float s,float t,float r,float q);void glMultiTexCoord4x(int target,int s,int t,int r,int q);void glNormal3f(float nx,float ny,float nz);void glNormal3x(int nx,int ny,int nz);void glNormalPointer(int type,int stride,java.nio.Buffer pointer);void glOrthof(float left,float right,float bottom,float top,float zNear,float zFar);void glOrthox(int left,int right,int bottom,int top,int zNear,int zFar);void glPixelStorei(int pname,int param);void glPointSize(float size);void glPointSizex(int size);void glPolygonOffset(float factor,float units);void glPolygonOffsetx(int factor,int units);/**
将矩阵从栈中恢复
*/void glPopMatrix();
/**
将矩阵存入栈中
*/void glPushMatrix();void glReadPixels(int x,int y,int width,int height,int format,int type,java.nio.Buffer pixels);/**
glRotate产生一个围绕vector(x,y,x),角度为angle的旋转操作。
一说:旋转遵循右手规则,如果向量(x,y,z)点正对着用户的话,旋转是逆时针的
二说:角度为正时表示逆时针方向。
我说:有待验证一二。
http://blog.csdn.net/wangyuchun_799/article/details/7786031
*/void glRotatef(float angle,float x,float y,float z);void glRotatex(int angle,int x,int y,int z);void glSampleCoverage(float value,boolean invert);void glSampleCoveragex(int value,boolean invert);/**
根据缩放矩阵修改当前矩阵。
x, y, z 指明x, y, z 轴的缩放因子
glScale产生了一个在x,y,z轴上的非uniform缩放。三个参数表明了在各自轴上的缩放比例。
*/void glScalef(float x,float y,float z);void glScalex(int x,int y,int z);void glScissor(int x,int y,int width,int height);/**
设置阴影模式参数:mode- 可选的值包括 `GL_FLAT 。GL_SMOOTH`两个 默认值是 `GL_SMOOTH`
*/void glShadeModel(int mode);void glStencilFunc(int func,int ref,int mask);void glStencilMask(int mask);void glStencilOp(int fail,int zfail,int zpass);void glTexCoordPointer(int size,int type,int stride,java.nio.Buffer pointer);void glTexEnvf(int target,int pname,float param);void glTexEnvfv(int target,int pname,float[] params,int offset);void glTexEnvfv(int target,int pname,java.nio.FloatBuffer params);void glTexEnvx(int target,int pname,int param);void glTexEnvxv(int target,int pname,int[] params,int offset);void glTexEnvxv(int target,int pname,java.nio.IntBuffer params);void glTexImage2D(int target,int level,int internalformat,int width,int height,int border,int format,int type,java.nio.Buffer pixels);void glTexParameterf(int target,int pname,float param);void glTexParameterx(int target,int pname,int param);void glTexSubImage2D(int target,int level,int xoffset,int yoffset,int width,int height,int format,int type,java.nio.Buffer pixels);/**
作用:3D图像坐标系按xyz指定的向量移动。
原理:略。
*/void glTranslatef(float x,float y,float z);void glTranslatex(int x,int y,int z);/**
三个坐标为一组放进缓冲区,等待使用。
*/void glVertexPointer(int size,int type,int stride,java.nio.Buffer pointer);void glViewport(int x,int y,int width,int height);}