mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Make more doxygen friendly
This commit is contained in:
parent
75637d72ef
commit
dfd82ae6bf
30
README.md
30
README.md
@ -6,8 +6,7 @@ This library provides C++11 bindings/wrapper for SDL2 and satellite libraries.
|
||||
|
||||
## Synopsis ##
|
||||
|
||||
```c++
|
||||
try {
|
||||
try {
|
||||
// Init SDL; will be automatically deinitialized when the object is destroyed
|
||||
SDL2pp::SDL sdl(SDL_INIT_VIDEO);
|
||||
|
||||
@ -43,12 +42,11 @@ try {
|
||||
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
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
std::cerr << "SDL Error: " << e.GetSDLError() << std::endl;
|
||||
}
|
||||
```
|
||||
}
|
||||
|
||||
## Features ##
|
||||
|
||||
@ -105,7 +103,7 @@ Dependencies:
|
||||
|
||||
To build standalone version:
|
||||
|
||||
```cmake . && make```
|
||||
cmake . && make
|
||||
|
||||
Following variabled may be supplied to CMake to affect build:
|
||||
|
||||
@ -122,12 +120,12 @@ Following variabled may be supplied to CMake to affect build:
|
||||
|
||||
To install the library systemwide, run:
|
||||
|
||||
```cmake . && make && make install```
|
||||
cmake . && make && make install
|
||||
|
||||
You can change installation prefix with CMAKE_INSTALL_PREFIX cmake
|
||||
variable:
|
||||
|
||||
```cmake -DCMAKE_INSTALL_PREFIX=/usr/local . && make && make install```
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local . && make && make install
|
||||
|
||||
SDL2pp installs pkg-config file, so it can be used with any build
|
||||
system which interacts with pkg-config, including CMake and GNU
|
||||
@ -147,23 +145,19 @@ still recommended).
|
||||
Just place the library into dedicated directory in your project
|
||||
(for example, lib/SDL2pp) and add
|
||||
|
||||
```cmake
|
||||
SET(SDL2PP_WITH_IMAGE ON) # if you need SDL_image support
|
||||
SET(SDL2PP_WITH_TTF ON) # if you need SDL_ttf support
|
||||
ADD_SUBDIRECTORY(lib/SDL2pp)
|
||||
```
|
||||
SET(SDL2PP_WITH_IMAGE ON) # if you need SDL_image support
|
||||
SET(SDL2PP_WITH_TTF ON) # if you need SDL_ttf support
|
||||
ADD_SUBDIRECTORY(lib/SDL2pp)
|
||||
|
||||
into your core CMakeLists.txt. This will act as similar to what
|
||||
FIND_PACKAGE usually does, and will provide ${SDL2PP_INCLUDE_DIRS}
|
||||
and ${SDL2PP_LIBRARIES} variables for your project. You will then
|
||||
be able to use them as usual:
|
||||
|
||||
```cmake
|
||||
INCLUDE_DIRECTORIES(${SDL2PP_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${SDL2PP_INCLUDE_DIRS})
|
||||
|
||||
ADD_EXECUTABLE(mytarget ...)
|
||||
TARGET_LINK_LIBRARIES(mytarget ${SDL2PP_LIBRARIES})
|
||||
```
|
||||
ADD_EXECUTABLE(mytarget ...)
|
||||
TARGET_LINK_LIBRARIES(mytarget ${SDL2PP_LIBRARIES})
|
||||
|
||||
if bundled, libSDL2pp does not build examples and becomes a static
|
||||
library, providing required SDL2 includes/libs in the mentioned
|
||||
|
Loading…
x
Reference in New Issue
Block a user