• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ShaderProgramLinkException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.andengine.opengl.shader.exception.ShaderProgramLinkException的典型用法代码示例。如果您正苦于以下问题:Java ShaderProgramLinkException类的具体用法?Java ShaderProgramLinkException怎么用?Java ShaderProgramLinkException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ShaderProgramLinkException类属于org.andengine.opengl.shader.exception包,在下文中一共展示了ShaderProgramLinkException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: compile

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的package包/类
protected void compile(final GLState pGLState) throws ShaderProgramException {
	final String vertexShaderSource = this.mVertexShaderSource.getShaderSource(pGLState);
	final int vertexShaderID = ShaderProgram.compileShader(vertexShaderSource, GLES20.GL_VERTEX_SHADER);

	final String fragmentShaderSource = this.mFragmentShaderSource.getShaderSource(pGLState);
	final int fragmentShaderID = ShaderProgram.compileShader(fragmentShaderSource, GLES20.GL_FRAGMENT_SHADER);

	this.mProgramID = GLES20.glCreateProgram();
	GLES20.glAttachShader(this.mProgramID, vertexShaderID);
	GLES20.glAttachShader(this.mProgramID, fragmentShaderID);

	try {
		this.link(pGLState);
	} catch (final ShaderProgramLinkException e) {
		throw new ShaderProgramLinkException("VertexShaderSource:\n##########################\n" + vertexShaderSource + "\n##########################" + "\n\nFragmentShaderSource:\n##########################\n" + fragmentShaderSource + "\n##########################", e);
	}

	GLES20.glDeleteShader(vertexShaderID);
	GLES20.glDeleteShader(fragmentShaderID);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:21,代码来源:ShaderProgram.java


示例2: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的package包/类
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
	GLES20.glLinkProgram(this.mProgramID);

	GLES20.glGetProgramiv(this.mProgramID, GLES20.GL_LINK_STATUS, ShaderProgram.HARDWAREID_CONTAINER, 0);
	if (ShaderProgram.HARDWAREID_CONTAINER[0] == 0) {
		throw new ShaderProgramLinkException(GLES20.glGetProgramInfoLog(this.mProgramID));
	}

	this.initAttributeLocations();
	this.initUniformLocations();

	this.mCompiled = true;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:14,代码来源:ShaderProgram.java


示例3: initUniformLocations

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例4: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例5: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例6: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例7: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例8: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例9: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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


示例10: link

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的package包/类
protected void link(final GLState pGLState) throws ShaderProgramLinkException {
	GLES20.glLinkProgram(this.mProgramID);

	GLES20.glGetProgramiv(this.mProgramID, GLES20.GL_LINK_STATUS, ShaderProgram.HARDWAREID_CONTAINER, 0);
	if(ShaderProgram.HARDWAREID_CONTAINER[0] == 0) {
		throw new ShaderProgramLinkException(GLES20.glGetProgramInfoLog(this.mProgramID));
	}

	this.initAttributeLocations();
	this.initUniformLocations();

	this.mCompiled = true;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:14,代码来源:ShaderProgram.java


示例11: initUniformLocations

import org.andengine.opengl.shader.exception.ShaderProgramLinkException; //导入依赖的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



注:本文中的org.andengine.opengl.shader.exception.ShaderProgramLinkException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WorkerClientRequestProcessor类代码示例发布时间:2022-05-23
下一篇:
Java ContentType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap