Java Code Examples for org.andengine.opengl.util.GLState#scaleModelViewGLMatrixf()

The following examples show how to use org.andengine.opengl.util.GLState#scaleModelViewGLMatrixf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextureWarmUpVertexBufferObject.java    From tilt-game-android with MIT License 6 votes vote down vote up
public void warmup(final GLState pGLState, final ITexture pTexture) {
	pTexture.bind(pGLState);
	this.bind(pGLState, PositionTextureCoordinatesShaderProgram.getInstance());

	pGLState.pushModelViewGLMatrix();
	{
		/* Far far away and really small. */
		pGLState.loadModelViewGLMatrixIdentity();
		pGLState.translateModelViewGLMatrixf(1000000, 1000000, 0);
		pGLState.scaleModelViewGLMatrixf(0.0001f, 0.0001f, 0);

		this.draw(GLES20.GL_TRIANGLES, TextureWarmUpVertexBufferObject.VERTICES_PER_VERTEXBUFFEROBJECT_SIZE);
	}
	pGLState.popModelViewGLMatrix();

	this.unbind(pGLState, PositionTextureCoordinatesShaderProgram.getInstance());
}
 
Example 2
Source File: TextureWarmUpVertexBufferObject.java    From 30-android-libraries-in-30-days with Apache License 2.0 6 votes vote down vote up
public void warmup(final GLState pGLState, final ITexture pTexture) {
	pTexture.bind(pGLState);
	this.bind(pGLState, PositionTextureCoordinatesShaderProgram.getInstance());

	pGLState.pushModelViewGLMatrix();
	{
		/* Far far away and really small. */
		pGLState.loadModelViewGLMatrixIdentity();
		pGLState.translateModelViewGLMatrixf(1000000, 1000000, 0);
		pGLState.scaleModelViewGLMatrixf(0.0001f, 0.0001f, 0);

		this.draw(GLES20.GL_TRIANGLES, VERTICES_PER_VERTEXBUFFEROBJECT_SIZE);
	}
	pGLState.popModelViewGLMatrix();

	this.unbind(pGLState, PositionTextureCoordinatesShaderProgram.getInstance());
}
 
Example 3
Source File: Entity.java    From tilt-game-android with MIT License 5 votes vote down vote up
protected void applyScale(final GLState pGLState) {
	final float scaleX = this.mScaleX;
	final float scaleY = this.mScaleY;

	if ((scaleX != 1) || (scaleY != 1)) {
		final float localScaleCenterX = this.mLocalScaleCenterX;
		final float localScaleCenterY = this.mLocalScaleCenterY;

		pGLState.translateModelViewGLMatrixf(localScaleCenterX, localScaleCenterY, 0);
		pGLState.scaleModelViewGLMatrixf(scaleX, scaleY, 1);
		pGLState.translateModelViewGLMatrixf(-localScaleCenterX, -localScaleCenterY, 0);
	}
}
 
Example 4
Source File: Entity.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
protected void applyScale(final GLState pGLState) {
	final float scaleX = this.mScaleX;
	final float scaleY = this.mScaleY;

	if((scaleX != 1) || (scaleY != 1)) {
		final float scaleCenterX = this.mScaleCenterX;
		final float scaleCenterY = this.mScaleCenterY;

		pGLState.translateModelViewGLMatrixf(scaleCenterX, scaleCenterY, 0);
		pGLState.scaleModelViewGLMatrixf(scaleX, scaleY, 1);
		pGLState.translateModelViewGLMatrixf(-scaleCenterX, -scaleCenterY, 0);
	}
}