Syntax highlight synopsis code in README.md

This commit is contained in:
kumar8600 2015-03-16 12:56:14 +09:00
parent 9e8fb2fc69
commit 4daba0efa8

View File

@ -7,7 +7,8 @@ This library provides C++11 bindings/wrapper for SDL2 and satellite libraries.
## Synopsis ##
try {
```c++
try {
using namespace SDL2pp;
// Init SDL; will be automatically deinitialized when the object is destroyed
@ -59,14 +60,15 @@ This library provides C++11 bindings/wrapper for SDL2 and satellite libraries.
SDL_Delay(2000);
// All SDL objects are released at this point or if an error occurs
} catch (SDL2pp::Exception& e) {
} catch (SDL2pp::Exception& e) {
// Exception stores SDL_GetError() result and name of function which failed
std::cerr << "Error in: " << e.GetSDLFunction() << std::endl;
std::cerr << " Reason: " << e.GetSDLError() << std::endl;
} catch (std::exception& e) {
} catch (std::exception& e) {
// This also works (e.g. "SDL_Init failed: No available video device")
std::cerr << e.what() << std::endl;
}
}
```
## Features ##