22 Commits

Author SHA1 Message Date
Dmitry Marakasov
0d08d4b7bc Provide pi constant, clean up floating point math
Since M_PI is non-standard, provide own constant to avoid using
-std=gnu++11 or other unwanted hacks.
2015-03-27 03:55:52 +03:00
Dmitry Marakasov
8bdc43417d Include cmath for sin/cos 2015-03-26 19:30:32 +03:00
Dmitry Marakasov
8636fb651f Simplify exception handling 2015-03-20 15:04:07 +03:00
Dmitry Marakasov
2869db24ef Remove unneeded parentheses, fix README example 2015-01-21 23:15:18 +03:00
Dmitry Marakasov
689f57b864 Exception rework
Now it explicitely stores name of SDL function which caused an error
and generates complete user-readable error message which contains both
function name and SDL error message. Users can now handle SDL2pp
exceptions along with all others in `catch (std::exception&)' and
get complete error info.

While here, fixed incorrect function names in some throw's
2015-01-19 01:41:37 +03:00
Dmitry Marakasov
6e6f8d1a6f Don't use deprecated method 2015-01-12 22:27:16 +03:00
Dmitry Marakasov
7d00d3bbb2 Add outline to font demo 2014-12-29 21:38:38 +03:00
Dmitry Marakasov
31c68423fc Use size getters 2014-12-29 21:38:21 +03:00
Dmitry Marakasov
8a7d5cab0e Make example more demonstrative 2014-12-28 06:38:29 +03:00
Dmitry Marakasov
5a72312d82 Offset by real surface size 2014-12-28 06:36:27 +03:00
Dmitry Marakasov
f1398b54df Implement basic ttf rendering, use in example 2014-12-28 06:15:46 +03:00
Dmitry Marakasov
ffdeb9465d Merge branch 'master' into ttf
Conflicts:
	CMakeLists.txt
	SDL2pp/SDL2pp.hh
2014-12-28 06:14:12 +03:00
Dmitry Marakasov
0557464b56 Merge branch 'surface'
Conflicts:
	CMakeLists.txt
2014-12-28 04:29:07 +03:00
Dmitry Marakasov
cf79498c5e Bundle Bitstream Vera font
It's not that large (even smaller than our example .wav file), has
liberal license and saves us from complexity of finding system
font. Later I may consider installing it as a default font to make
ttf features of SDL2pp usable out-of-box without need for extra
fonts.
2014-12-28 04:01:58 +03:00
Dmitry Marakasov
ffc2caf14d If font is not found, just don't build example instead of failing 2014-12-28 03:50:22 +03:00
Dmitry Marakasov
3570d812eb Add more possible paths to Vera.ttf 2014-12-28 03:49:50 +03:00
Dmitry Marakasov
9a9aa0b05c Add stub for ttf example 2014-12-28 03:35:38 +03:00
Dmitry Marakasov
79300dea2b Use surface in example 2014-12-27 21:46:07 +03:00
Dmitry Marakasov
e0032de447 Implement wrapper for SDL_image init/deinit
Fixes #21
2014-12-27 05:22:12 +03:00
Dmitry Marakasov
65b5446fd1 Axe out remaining uses of old Point/Rect API 2014-12-25 19:30:37 +03:00
Dmitry Marakasov
3796a6d246 Switch AudioDevice to Optional
No compatibility here, as API is broken anyway (Optional<std::string>
ctor won't accept const char*)
2014-12-25 19:15:28 +03:00
Dmitry Marakasov
18fe309309 Remove demos into more suitable examples
Also add options for conditional build of tests and examples
2014-12-20 18:04:22 +03:00