mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Tweak example
This commit is contained in:
parent
4815bd386b
commit
c3ac6407fa
@ -72,11 +72,11 @@ try {
|
|||||||
SDL_Delay(2000);
|
SDL_Delay(2000);
|
||||||
|
|
||||||
// All SDL objects are released at this point or if an error occurs
|
// All SDL objects are released at this point or if an error occurs
|
||||||
} catch (SDL2pp::Exception& e) {
|
} catch (const SDL2pp::Exception& e) {
|
||||||
// Exception stores SDL_GetError() result and name of function which failed
|
// Exception stores SDL_GetError() result and name of function which failed
|
||||||
std::cerr << "Error in: " << e.GetSDLFunction() << std::endl;
|
std::cerr << "Error in: " << e.GetSDLFunction() << std::endl;
|
||||||
std::cerr << " Reason: " << e.GetSDLError() << std::endl;
|
std::cerr << " Reason: " << e.GetSDLError() << std::endl;
|
||||||
} catch (std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
// This also works (e.g. "SDL_Init failed: No available video device")
|
// This also works (e.g. "SDL_Init failed: No available video device")
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user