本文整理汇总了Java中org.andengine.opengl.shader.constants.ShaderProgramConstants类的典型用法代码示例。如果您正苦于以下问题:Java ShaderProgramConstants类的具体用法?Java ShaderProgramConstants怎么用?Java ShaderProgramConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShaderProgramConstants类属于org.andengine.opengl.shader.constants包,在下文中一共展示了ShaderProgramConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAttributeLocationOptional
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
public int getAttributeLocationOptional(final String pAttributeName) {
final Integer location = this.mAttributeLocations.get(pAttributeName);
if (location != null) {
return location.intValue();
} else {
return ShaderProgramConstants.LOCATION_INVALID;
}
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:ShaderProgram.java
示例2: getUniformLocationOptional
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
public int getUniformLocationOptional(final String pUniformName) {
final Integer location = this.mUniformLocations.get(pUniformName);
if (location != null) {
return location.intValue();
} else {
return ShaderProgramConstants.LOCATION_INVALID;
}
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:ShaderProgram.java
示例3: bind
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
public void bind(final GLState pGLState, final VertexBufferObjectAttributes pVertexBufferObjectAttributes) {
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION);
super.bind(pGLState, pVertexBufferObjectAttributes);
GLES20.glUniformMatrix4fv(PositionTextureCoordinatesShaderProgram.sUniformModelViewPositionMatrixLocation, 1, false, pGLState.getModelViewProjectionGLMatrix(), 0);
GLES20.glUniform1i(PositionTextureCoordinatesShaderProgram.sUniformTexture0Location, 0);
}
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:10,代码来源:PositionTextureCoordinatesShaderProgram.java
示例4: setTextureOptional
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
/**
* @param pUniformName
* @param pTexture the index of the Texture to use. Similar to {@link android.opengl.GLES20#GL_TEXTURE0}, {@link android.opengl.GLES20#GL_TEXTURE1}, ... except that it is <b><code>0</code></b> based.
*/
public void setTextureOptional(final String pUniformName, final int pTexture) {
final int location = this.getUniformLocationOptional(pUniformName);
if (location != ShaderProgramConstants.LOCATION_INVALID) {
GLES20.glUniform1i(location, pTexture);
}
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:11,代码来源:ShaderProgram.java
示例5: link
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES_LOCATION, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES);
super.link(pGLState);
PositionTextureCoordinatesUniformColorShaderProgram.sUniformModelViewPositionMatrixLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_MODELVIEWPROJECTIONMATRIX);
PositionTextureCoordinatesUniformColorShaderProgram.sUniformTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_0);
PositionTextureCoordinatesUniformColorShaderProgram.sUniformColorLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_COLOR);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:PositionTextureCoordinatesUniformColorShaderProgram.java
示例6: bind
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
public void bind(final GLState pGLState, final VertexBufferObjectAttributes pVertexBufferObjectAttributes) {
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION);
super.bind(pGLState, pVertexBufferObjectAttributes);
GLES20.glUniformMatrix4fv(PositionTextureCoordinatesUniformColorShaderProgram.sUniformModelViewPositionMatrixLocation, 1, false, pGLState.getModelViewProjectionGLMatrix(), 0);
GLES20.glUniform1i(PositionTextureCoordinatesUniformColorShaderProgram.sUniformTexture0Location, 0);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:10,代码来源:PositionTextureCoordinatesUniformColorShaderProgram.java
示例7: link
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_0_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION_0);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_1_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION_1);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES_LOCATION, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES);
super.link(pGLState);
PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformModelViewPositionMatrixLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_MODELVIEWPROJECTIONMATRIX);
PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_0);
PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformTexture1Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_1);
PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformTextureSelectTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURESELECT_TEXTURE_0);
PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformPositionInterpolationMix0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_POSITION_INTERPOLATION_MIX_0);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:15,代码来源:PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.java
示例8: bind
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
public void bind(final GLState pGLState, final VertexBufferObjectAttributes pVertexBufferObjectAttributes) {
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION);
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION);
GLES20.glEnableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_POSITION_0_LOCATION);
GLES20.glEnableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_POSITION_1_LOCATION);
super.bind(pGLState, pVertexBufferObjectAttributes);
GLES20.glUniformMatrix4fv(PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformModelViewPositionMatrixLocation, 1, false, pGLState.getModelViewProjectionGLMatrix(), 0);
GLES20.glUniform1i(PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformTexture0Location, 0);
GLES20.glUniform1i(PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.sUniformTexture1Location, 1);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:14,代码来源:PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.java
示例9: unbind
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
public void unbind(final GLState pGLState) {
GLES20.glEnableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION);
GLES20.glEnableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION);
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_POSITION_0_LOCATION);
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_POSITION_1_LOCATION);
super.unbind(pGLState);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:10,代码来源:PositionTextureCoordinatesPositionInterpolationTextureSelectShaderProgram.java
示例10: link
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES_LOCATION, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES);
super.link(pGLState);
PositionTextureCoordinatesTextureSelectShaderProgram.sUniformModelViewPositionMatrixLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_MODELVIEWPROJECTIONMATRIX);
PositionTextureCoordinatesTextureSelectShaderProgram.sUniformTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_0);
PositionTextureCoordinatesTextureSelectShaderProgram.sUniformTexture1Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_1);
PositionTextureCoordinatesTextureSelectShaderProgram.sUniformTextureSelectTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURESELECT_TEXTURE_0);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:13,代码来源:PositionTextureCoordinatesTextureSelectShaderProgram.java
示例11: bind
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
public void bind(final GLState pGLState, final VertexBufferObjectAttributes pVertexBufferObjectAttributes) {
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION);
super.bind(pGLState, pVertexBufferObjectAttributes);
GLES20.glUniformMatrix4fv(PositionTextureCoordinatesTextureSelectShaderProgram.sUniformModelViewPositionMatrixLocation, 1, false, pGLState.getModelViewProjectionGLMatrix(), 0);
GLES20.glUniform1i(PositionTextureCoordinatesTextureSelectShaderProgram.sUniformTexture0Location, 0);
GLES20.glUniform1i(PositionTextureCoordinatesTextureSelectShaderProgram.sUniformTexture1Location, 1);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:11,代码来源:PositionTextureCoordinatesTextureSelectShaderProgram.java
示例12: link
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION, ShaderProgramConstants.ATTRIBUTE_COLOR);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES_LOCATION, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES);
super.link(pGLState);
PositionColorTextureCoordinatesShaderProgram.sUniformModelViewPositionMatrixLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_MODELVIEWPROJECTIONMATRIX);
PositionColorTextureCoordinatesShaderProgram.sUniformTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_0);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:PositionColorTextureCoordinatesShaderProgram.java
示例13: link
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES_LOCATION, ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES);
super.link(pGLState);
PositionTextureCoordinatesShaderProgram.sUniformModelViewPositionMatrixLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_MODELVIEWPROJECTIONMATRIX);
PositionTextureCoordinatesShaderProgram.sUniformTexture0Location = this.getUniformLocation(ShaderProgramConstants.UNIFORM_TEXTURE_0);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:11,代码来源:PositionTextureCoordinatesShaderProgram.java
示例14: link
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_POSITION_LOCATION, ShaderProgramConstants.ATTRIBUTE_POSITION);
GLES20.glBindAttribLocation(this.mProgramID, ShaderProgramConstants.ATTRIBUTE_COLOR_LOCATION, ShaderProgramConstants.ATTRIBUTE_COLOR);
super.link(pGLState);
PositionColorShaderProgram.sUniformModelViewPositionMatrixLocation = this.getUniformLocation(ShaderProgramConstants.UNIFORM_MODELVIEWPROJECTIONMATRIX);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:10,代码来源:PositionColorShaderProgram.java
示例15: bind
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
@Override
public void bind(final GLState pGLState, final VertexBufferObjectAttributes pVertexBufferObjectAttributes) {
GLES20.glDisableVertexAttribArray(ShaderProgramConstants.ATTRIBUTE_TEXTURECOORDINATES_LOCATION);
super.bind(pGLState, pVertexBufferObjectAttributes);
GLES20.glUniformMatrix4fv(PositionColorShaderProgram.sUniformModelViewPositionMatrixLocation, 1, false, pGLState.getModelViewProjectionGLMatrix(), 0);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:PositionColorShaderProgram.java
示例16: initUniformLocations
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
private void initUniformLocations() throws ShaderProgramLinkException {
this.mUniformLocations.clear();
ShaderProgram.PARAMETERS_CONTAINER[0] = 0;
GLES20.glGetProgramiv(this.mProgramID, GLES20.GL_ACTIVE_UNIFORMS, ShaderProgram.PARAMETERS_CONTAINER, 0);
final int numUniforms = ShaderProgram.PARAMETERS_CONTAINER[0];
for (int i = 0; i < numUniforms; i++) {
GLES20.glGetActiveUniform(this.mProgramID, i, ShaderProgram.NAME_CONTAINER_SIZE, ShaderProgram.LENGTH_CONTAINER, 0, ShaderProgram.SIZE_CONTAINER, 0, ShaderProgram.TYPE_CONTAINER, 0, ShaderProgram.NAME_CONTAINER, 0);
int length = ShaderProgram.LENGTH_CONTAINER[0];
/* Some drivers do not report the actual length here, but zero. Then the name is '\0' terminated. */
if (length == 0) {
while ((length < ShaderProgram.NAME_CONTAINER_SIZE) && (ShaderProgram.NAME_CONTAINER[length] != '\0')) {
length++;
}
}
String name = new String(ShaderProgram.NAME_CONTAINER, 0, length);
int location = GLES20.glGetUniformLocation(this.mProgramID, name);
if (location == ShaderProgramConstants.LOCATION_INVALID) {
/* Some drivers do not report an incorrect length. Then the name is '\0' terminated. */
length = 0;
while (length < ShaderProgram.NAME_CONTAINER_SIZE && ShaderProgram.NAME_CONTAINER[length] != '\0') {
length++;
}
name = new String(ShaderProgram.NAME_CONTAINER, 0, length);
location = GLES20.glGetUniformLocation(this.mProgramID, name);
if (location == ShaderProgramConstants.LOCATION_INVALID) {
throw new ShaderProgramLinkException("Invalid location for uniform: '" + name + "'.");
}
}
this.mUniformLocations.put(name, location);
}
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:41,代码来源:ShaderProgram.java
示例17: getAttributeLocationOptional
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
public int getAttributeLocationOptional(final String pAttributeName) {
final Integer location = this.mAttributeLocations.get(pAttributeName);
if(location != null) {
return location.intValue();
} else {
return ShaderProgramConstants.LOCATION_INVALID;
}
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:9,代码来源:ShaderProgram.java
示例18: getUniformLocationOptional
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
public int getUniformLocationOptional(final String pUniformName) {
final Integer location = this.mUniformLocations.get(pUniformName);
if(location != null) {
return location.intValue();
} else {
return ShaderProgramConstants.LOCATION_INVALID;
}
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:9,代码来源:ShaderProgram.java
示例19: initUniformLocations
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
private void initUniformLocations() throws ShaderProgramLinkException {
this.mUniformLocations.clear();
ShaderProgram.PARAMETERS_CONTAINER[0] = 0;
GLES20.glGetProgramiv(this.mProgramID, GLES20.GL_ACTIVE_UNIFORMS, ShaderProgram.PARAMETERS_CONTAINER, 0);
final int numUniforms = ShaderProgram.PARAMETERS_CONTAINER[0];
for(int i = 0; i < numUniforms; i++) {
GLES20.glGetActiveUniform(this.mProgramID, i, ShaderProgram.NAME_CONTAINER_SIZE, ShaderProgram.LENGTH_CONTAINER, 0, ShaderProgram.SIZE_CONTAINER, 0, ShaderProgram.TYPE_CONTAINER, 0, ShaderProgram.NAME_CONTAINER, 0);
int length = ShaderProgram.LENGTH_CONTAINER[0];
/* Some drivers do not report the actual length here, but zero. Then the name is '\0' terminated. */
if(length == 0) {
while((length < ShaderProgram.NAME_CONTAINER_SIZE) && (ShaderProgram.NAME_CONTAINER[length] != '\0')) {
length++;
}
}
String name = new String(ShaderProgram.NAME_CONTAINER, 0, length);
int location = GLES20.glGetUniformLocation(this.mProgramID, name);
if(location == ShaderProgramConstants.LOCATION_INVALID) {
/* Some drivers do not report an incorrect length. Then the name is '\0' terminated. */
length = 0;
while(length < ShaderProgram.NAME_CONTAINER_SIZE && ShaderProgram.NAME_CONTAINER[length] != '\0') {
length++;
}
name = new String(ShaderProgram.NAME_CONTAINER, 0, length);
location = GLES20.glGetUniformLocation(this.mProgramID, name);
if(location == ShaderProgramConstants.LOCATION_INVALID) {
throw new ShaderProgramLinkException("Invalid location for uniform: '" + name + "'.");
}
}
this.mUniformLocations.put(name, location);
}
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:41,代码来源:ShaderProgram.java
示例20: setTextureOptional
import org.andengine.opengl.shader.constants.ShaderProgramConstants; //导入依赖的package包/类
/**
* @param pUniformName
* @param pTexture the index of the Texture to use. Similar to {@link GLES20#GL_TEXTURE0}, {@link GLES20#GL_TEXTURE1}, ... except that it is <b><code>0</code></b> based.
*/
public void setTextureOptional(final String pUniformName, final int pTexture) {
final int location = this.getUniformLocationOptional(pUniformName);
if(location != ShaderProgramConstants.LOCATION_INVALID) {
GLES20.glUniform1i(location, pTexture);
}
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:11,代码来源:ShaderProgram.java
注:本文中的org.andengine.opengl.shader.constants.ShaderProgramConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论