I have my render set up like this...
Code:
//-----------------------------------------------------------------------------
// Name: WinMain()
// Desc: The application's entry point
//-----------------------------------------------------------------------------
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
// Register the window class
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
"D3D", NULL };
RegisterClassEx( &wc );
// Create the application's window
HWND hWnd = CreateWindow( "D3D", "D3D",
WS_OVERLAPPEDWINDOW, 150, 150, 500, 500,
GetDesktopWindow(), NULL, wc.hInstance, NULL );
// Initialize Direct3D
if( SUCCEEDED( InitD3D( hWnd ) ) )
{
//Program Functions
ProgramStart();
// Show the window
ShowWindow( hWnd, SW_SHOWDEFAULT );
UpdateWindow( hWnd );
// Enter the message loop
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while( msg.message!=WM_QUIT )
{
if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
ProgramStep(); //Other stuff to happen before rendering
Render(); //Actaully rendering of d3d objects
}
}
}
UnregisterClass( "D3D", wc.hInstance );
return 0;
}
The stuff I need looked at is near the end of the code.
But I want to know if that is the correct place to put it and how I should put it there. It seems to be a bit laggy, and I don't know how to get the fps.
Any help of any sort is helpfull to me!
Thanks