예제 #1
0
//----------------------------------------------------------------//
void MOAIGfxDevice::SetViewRect () {

	float width = ( float )this->mFrameBuffer->mBufferWidth;
	float height = ( float )this->mFrameBuffer->mBufferHeight;

	MOAIViewport rect;
	rect.Init ( 0.0f, 0.0f, width, height );
	
	this->SetViewRect ( rect );
}
예제 #2
0
//----------------------------------------------------------------//
void MOAIGfxDevice::SetViewport () {

	float width = ( float )this->mWidth;
	float height = ( float )this->mHeight;

	MOAIViewport viewport;
	viewport.Init ( 0.0f, 0.0f, width, height );
	viewport.SetScale ( width, -height );
	viewport.SetOffset ( -1.0f, 1.0f );
	
	this->SetViewport ( viewport );
}
예제 #3
0
//----------------------------------------------------------------//
void MOAIGfxDevice::BeginLayer () {

	float width = ( float )this->mWidth;
	float height = ( float )this->mHeight;
	
	MOAIViewport viewport;
	viewport.Init ( 0.0f, 0.0f, width, height );
	viewport.SetScale ( width, -height );
	viewport.SetOffset ( -1.0f, 1.0f );
	
	this->SetViewport ( viewport );

	for ( u32 i = 0; i < TOTAL_VTX_TRANSFORMS; ++i ) {
		this->mVertexTransforms [ i ].Ident ();
	}
	this->mUVTransform.Ident ();
	this->mCpuVertexTransformMtx.Ident ();
	
	this->mVertexMtxInput = VTX_STAGE_MODEL;
	this->mVertexMtxOutput = VTX_STAGE_MODEL;
	
	USMatrix4x4 projMtx;
	projMtx.Init ( viewport.GetProjMtx ());
	this->mVertexTransforms [ VTX_PROJ_TRANSFORM ] = projMtx;
	
	// fixed function reset
#if USE_OPENGLES1
	if ( !this->IsProgrammable ()) {
		
		// load identity matrix
		glMatrixMode ( GL_MODELVIEW );
		glLoadIdentity ();
		
		glMatrixMode ( GL_PROJECTION );
		this->GpuLoadMatrix ( projMtx );
		
		glMatrixMode ( GL_TEXTURE );
		glLoadIdentity ();
		
		// reset the current vertex color
		glColor4f ( 1.0f, 1.0f, 1.0f, 1.0f );
		
		// reset the point size
		glPointSize (( GLfloat )this->mPointSize );
	}
#endif
}