Code: Select all
int main(int ac, char** av) {
try {
// TODO add resolution chooser here
irr::IrrlichtDevice* pdevice = irr::createDevice(
#ifndef WIN32
irr::video::EDT_OPENGL,
#else
irr::video::EDT_DIRECT3D9,
#endif
irr::core::dimension2d<unsigned int>(1024, 768),
32,
false,
false,
true);
if (!pdevice) throw std::runtime_error("ERROR : Could not create device");
pdevice->setWindowCaption(L"Biolite - Irrlicht Version");
irrwin main_logic(pdevice);
while (main_logic.runOnce(pdevice))
#ifndef WIN32
usleep(1);
#else
Sleep(1);
#endif
} catch (std::runtime_error ex) {
std::cerr << ex.what() << std::endl;
// TODO change this for a more GUI oriented way
// probaly have to make a Linux and a Mac OS X version...
#ifdef WIN32
MessageBoxA(NULL, ex.what(), "Exception", MB_ICONEXCLAMATION);
#endif
}
return 0;
}
Code: Select all
#ifdef WIN32
HWND hwnd;
pdevice->setWindowCaption(L"ERROR");
hwnd = FindWindow(NULL,TEXT("ERROR"));
MessageBoxA(hwnd, ex.what(), "Exception", MB_ICONEXCLAMATION);
#endif