Thread: A few questions

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sanity is for the weak! beene's Avatar
    Join Date
    Jul 2006
    Posts
    321

    A few questions

    Hi there.
    i'm relatively new to directx.

    I have a message loop from a book called Introduction to 3d Game Programming with Directx 9.0

    here it is:

    Code:
    int d3d::EnterMsgLoop( bool (*ptr_display)(float timeDelta) )
    {
    	MSG msg;
    	::ZeroMemory(&msg, sizeof(MSG));
    
    	static float lastTime = (float)timeGetTime(); 
    
    	while(msg.message != WM_QUIT)
    	{
    		if(::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
    		{
    			::TranslateMessage(&msg);
    			::DispatchMessage(&msg);
    		}
    		else
            {	
    			float currTime  = (float)timeGetTime();
    			float timeDelta = (currTime - lastTime)*0.001f;
    
    			ptr_display(timeDelta);
    
    			lastTime = currTime;
            }
        }
        return msg.wParam;
    }
    could someone clear this up for me please.
    i understand a little, but not all of it.

    thanks if anyone replies.

    EDIT:
    Oh yes, and what is HRESULT?
    Last edited by beene; 04-14-2007 at 05:26 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM