------------------------------------------------------------------------------- Entry point to the application -------------------------------------------------------------------------------
| 2165 | // Entry point to the application |
| 2166 | //------------------------------------------------------------------------------- |
| 2167 | int APIENTRY _tWinMain(HINSTANCE hInstance, |
| 2168 | HINSTANCE hPrevInstance, |
| 2169 | LPTSTR lpCmdLine, |
| 2170 | int nCmdShow) |
| 2171 | { |
| 2172 | UNREFERENCED_PARAMETER(hPrevInstance); |
| 2173 | UNREFERENCED_PARAMETER(lpCmdLine); |
| 2174 | |
| 2175 | // needed for the RichEdit control in the about/help dialog |
| 2176 | LoadLibrary( "riched20.dll" ); |
| 2177 | |
| 2178 | // load windows common controls library to get XP style |
| 2179 | InitCommonControls(); |
| 2180 | |
| 2181 | // initialize the IDirect3D9 interface |
| 2182 | g_hInstance = hInstance; |
| 2183 | if (0 == InitD3D()) { |
| 2184 | MessageBox(nullptr,"Failed to initialize Direct3D 9", |
| 2185 | "ASSIMP ModelViewer",MB_OK); |
| 2186 | return -6; |
| 2187 | } |
| 2188 | |
| 2189 | // create the main dialog |
| 2190 | HWND hDlg = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOGMAIN), |
| 2191 | nullptr,&MessageProc); |
| 2192 | |
| 2193 | // ensure we get high priority |
| 2194 | ::SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); |
| 2195 | |
| 2196 | // initialize the default logger if necessary |
| 2197 | Assimp::DefaultLogger::create("",Assimp::Logger::VERBOSE); |
| 2198 | |
| 2199 | CLogWindow::Instance().pcStream = new CMyLogStream(); |
| 2200 | Assimp::DefaultLogger::get()->attachStream(CLogWindow::Instance().pcStream, |
| 2201 | Assimp::DefaultLogger::Debugging | Assimp::DefaultLogger::Info | |
| 2202 | Assimp::DefaultLogger::Err | Assimp::DefaultLogger::Warn); |
| 2203 | |
| 2204 | if (nullptr == hDlg) { |
| 2205 | MessageBox(nullptr,"Failed to create dialog from resource", |
| 2206 | "ASSIMP ModelViewer",MB_OK); |
| 2207 | return -5; |
| 2208 | } |
| 2209 | |
| 2210 | // display the window |
| 2211 | g_hDlg = hDlg; |
| 2212 | MSG uMsg; |
| 2213 | memset(&uMsg,0,sizeof( MSG)); |
| 2214 | ShowWindow( hDlg, nCmdShow ); |
| 2215 | UpdateWindow( hDlg ); |
| 2216 | |
| 2217 | // create the D3D device object |
| 2218 | if (0 == CreateDevice(g_sOptions.bMultiSample,false,true)) { |
| 2219 | MessageBox(nullptr,"Failed to initialize Direct3D 9 (2)", |
| 2220 | "ASSIMP ModelViewer",MB_OK); |
| 2221 | return -4; |
| 2222 | } |
| 2223 | |
| 2224 | CLogDisplay::Instance().AddEntry("[OK] Here we go!"); |
nothing calls this directly
no test coverage detected