예제 #1
0
void VimridViewer::Render()
{
	this->GlutApplication::Render();

	// Use dark gray which is good for stereo.
	glClearColor(0.2, 0.2, 0.2, 1.0);

	if (IsStereoEnabled())
	{
		RenderStereoBuffer(GL_BACK_LEFT);
		RenderStereoBuffer(GL_BACK_RIGHT);
	}
	else
	{
		glDrawBuffer(GL_BACK);

		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();

		// Set a normal frustum for non-stereo viewers.
		glFrustum(
			-1.0, 1.0,
			-GetAspectRatio(),
			GetAspectRatio(),
			GetFrustumNearClip(),
			GetFrustumFarClip());

		RenderDelegate();
	}

	FinishRender();
}
예제 #2
0
파일: MriDemo1.cpp 프로젝트: nbolton/vimrid
void MriDemo1::Render()
{
	this->GlutApplication::Render();

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glEnable(GL_TEXTURE_2D);

	glMatrixMode(GL_PROJECTION);
	glPushMatrix();

	glTranslatef(0, 0, GetCameraVector().Z);
	glRotatef(GetCameraVector().Y, 1, 0, 0);
	glRotatef(GetCameraVector().X, 0, 1, 0);

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	// Make all sprites transparent.
	glColor4f(1, 1, 1, .7);

	RenderSprites();

	glMatrixMode(GL_PROJECTION);
	glPopMatrix();

	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();

	FinishRender();
}
	void Game::Run()
	{
		Initialize();

		while(GameProperties::Running)
		{
			Update();

			StartRender();
			Render();
			FinishRender();

			SDL_Delay(1);
		}

		Finalize();
	}
예제 #4
0
bool rend_single_frame()
{
	//wait render start only if no frame pending
	do
	{
		rs.Wait();
		_pvrrc = DequeueRender();
	}
	while (!_pvrrc);
	
	bool do_swp = rend_frame(_pvrrc, true);

	//clear up & free data ..
	FinishRender(_pvrrc);
	_pvrrc=0;

	return do_swp;
}
예제 #5
0
bool rend_single_frame()
{
	//wait render start only if no frame pending
	do
	{
		rs.Wait();
		_pvrrc = DequeueRender();
	}
	while (!_pvrrc);

	bool proc = renderer->Process(_pvrrc);
	re.Set();
	
	bool do_swp = proc && renderer->Render();
		
	if (do_swp)
		renderer->DrawOSD();

	//clear up & free data ..
	FinishRender(_pvrrc);
	_pvrrc=0;

	return do_swp;
}