#include "d3dApp.h"
#include <WindowsX.h>
#include <sstream>
namespace
{
// This is just used to forward Windows messages from a global window
// procedure to our member function window procedure because we cannot
// assign a member function to WNDCLASS::lpfnWndProc.
D3DApp* gd3dApp = 0;
}
LRESULT CALLBACK
MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Forward hwnd on because we can get messages (e.g., WM_CREATE)
// before CreateWindow returns, and thus before mhMainWnd is valid.
return gd3dApp->MsgProc(hwnd, msg, wParam, lParam);
}
我对 C++ 中命名空间的这种使用感到好奇。我开始阅读有关命名空间的文档,我看到很多示例调用命名空间的名称,例如“命名空间优先”,但在命名空间声明之后没有任何内容,例如这个。