コード例 #1
0
IZ_BOOL CStateNormalMap::Render(izanagi::graph::CGraphicsDevice* device)
{
	Render3D();
	Render2D();

	return IZ_TRUE;
}
コード例 #2
0
void CProcessIA4::RenderScene(CRenderManager* rm) 
{
  /*PhysX test*/
	//CORE->Render();
	Render3D(rm); 
	Render2D(rm); 
}
コード例 #3
0
///<summary>
/// PhysX:: RenderScene : Renderiza la escena.
///</summary>
///<param name="rm">Puntero a render manager.</param>
///<returns name=""></returns>
void PhysX::RenderScene(CRenderManager* rm)
{
    Render3D(rm);
    Render2D(rm);
    RenderDebugInfo();

    //prueba
    //CORE->GetScriptManager()->RunCode("lua_draw_literal_test()");
    CORE->GetScriptManager()->RunCode("get_core():get_font_manager():lua_draw_literal(100, 100, 'Exit')");
}
コード例 #4
0
		void Graphics::Update()
		{	
            BeginRender();
			Render3D();
            Begin2DRender();
            Render2D();
			End2DRender();
            PostRender3D();
            EndRender();
        }
コード例 #5
0
/* Here goes our drawing code */
int drawGLScene( struct display_camera *camera, GLWindow *GLWin)
{
	ProcessGLDraw( TRUE );

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    
    Move( l.origin );
    Render3D( camera );
    
    if (GLWin->doubleBuffered)
    {
        glXSwapBuffers(GLWin->dpy, GLWin->win);
    }
    return True;    
}
コード例 #6
0
ファイル: Engine.cpp プロジェクト: bodguy/GameSource
INT CEngine::Run()
{
	//Main message loop
	MSG msg = {0,};
	while( msg.message!=WM_QUIT )
	{
		if( ::PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
		{
			::TranslateMessage( &msg );
			::DispatchMessage( &msg );
		}
		else
		{
			if(FAILED(Render3D()))
				::PostMessage(m_hWnd, WM_DESTROY,0,0);
		}
	}

	::UnregisterClass( m_sAppTitle.c_str(), m_hInst );

	return static_cast<int>(msg.wParam);
}
コード例 #7
0
//
// Program starts here
//
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, PSTR cmdLine, int showCmd) {	

	g_pHWND = CreateGameWindow();
	CreateD3DDevice();	
	

	MY_UI::DirectX11* renderer = new MY_UI::DirectX11( g_Device, g_DeviceContext );
	MY_UI::cRootWidget* root = new MY_UI::cRootWidget();
	MY_UI::cWidgetSkin* skin = new MY_UI::cWidgetSkin();
	//the MY_UI::Utilities::cInput input    class declared above will clean up MY UI on its destruction so you dont need to free any memory. You can explicitly call MY_UI::DeInit() if you want when the program is shutting down though
	MY_UI::Init(renderer, skin, root);
	MY_UI::Utilities::SetCursor(MY_UI::Utilities::Standard);
	RECT temp;
	GetClientRect( g_pHWND, &temp );
	root->SetSize(temp.right, temp.bottom);

	InitDemo();
	InitScene();

	//
	// Begin the main game loop
	//
	MY_UI::Controls::Text* fpscounter = new MY_UI::Controls::Text(root);
	fpscounter->SetFontSize(20);
	unsigned int framecount = 0;
	unsigned int lasttick = MY_UI::Utilities::GetTime();
	std::string fpsStr, FrameStats;

	MSG msg;
	while( true )
	{
		// Skip out if the window is closed
		if ( !IsWindowVisible( g_pHWND ) )
			break;

		// If we have a message from windows..
		if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
		{
			// if it's QUIT then quit..
			if ( msg.message == WM_QUIT )
				break;

			// Handle the regular window stuff..
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
		else
		{
			// Normal DirectX rendering loop
				

				framecount++;
				if(MY_UI::Utilities::GetTime() -lasttick  >= 1000){// update
					float fps(static_cast<float>(framecount));
					float msec(1000.0f/fps);
					std::ostringstream outs1;   
					outs1.precision(4);
					outs1<<" FPS: "<<fps<<" MPF: "<<msec;
					fpsStr=outs1.str();
					lasttick=MY_UI::Utilities::GetTime();
					framecount=0;// reset
					std::ostringstream o;
					o<<"Draw Calls: "<<renderer->GetDrawCalls();
					fpscounter->SetText(fpsStr +o.str());
				}
				
	
				float ClearColor[4] = { .2f, .1f, 1.0f, 0.0f };
				
				g_DeviceContext->ClearRenderTargetView( BackBufferRTV, ClearColor );
	
				// This is how easy it is to render

				Render3D();
				root->Draw();
				
				SwapChain->Present(0, 0);

		}
	}
	MY_UI::Safe_Delete(Dummy);// destroy the dummy. This is not absolutely needed because the MY_UI library will clean up all widgets, but I delete it here because the 3d example needs to be shut down before everything else
	SAFE_DELETE(input);// make sure to delete this here. It will call the cleanup code in its destructor
	Cleanup();// clean up the 3d stuff
	HR(SwapChain->SetFullscreenState(false, 0));// this is needed in case full screen is on
	
	RELEASECOM(BackBufferRTV);
	RELEASECOM(SwapChain);
	RELEASECOM(g_DeviceContext);
	RELEASECOM(g_Device);


}