121 Commits

Author SHA1 Message Date
Dmitry Marakasov
d7987b33da Allow ContainerRWops to work with both const and non-const containers
Analogus to how StreamRWops work. Also add more tests for
ContainerRWops.
2014-12-18 16:48:48 +03:00
Dmitry Marakasov
53aa26dec5 Make StreamRWops work with istream/ostream
Streams do not generally work well with RWops because
* streams have separate read and write pointers
* ostream doesn't allow you to determine how many bytes were actually written
* istream and ostream have separate set of functions

Try my best to support streams in RWops though, engaging some template
magic:
* provide separate template implementations of all operations which
  depend on whether stream is an istream or ostream. This allows to
  e.g. return 0 immediately for an attempt to write() to istream.
* disallow StreamRWops for classes which are both istream and ostream
  to not run into ambiguity of separate read/write pointers
* for read failure, but partially read object back to the stream to not
  lose data for following read (not sure that e.g. fread behaves so
  though; I'll anyway expect user to Seek() after read or write failure)
* for write failure, there's no way to avoid leaking partial data to the
  stream

In general, it is best to use this container as read-only.

Also add tests for StreamRWops
2014-12-18 16:23:22 +03:00
Dmitry Marakasov
7ba131a913 Add StreamRWops class 2014-12-18 14:32:27 +03:00
Dmitry Marakasov
c73bd885c5 Name header file after class it defines 2014-12-18 14:29:45 +03:00
Dmitry Marakasov
9d2097cdea Silence warning on Release build 2014-12-18 13:16:12 +03:00
Dmitry Marakasov
d5b557706a Use correct exception
SDL2pp::Exception doesn't is not suitable here as this is not an SDL
error. Incorrect argument is a logic error.
2014-12-18 13:14:12 +03:00
Dmitry Marakasov
46591a9cbf Update project comment 2014-12-18 02:52:08 +03:00
Dmitry Marakasov
0124e2703a Update copyright years 2014-12-18 02:51:49 +03:00
Dmitry Marakasov
a727fb4857 Use more consistent name for an option 2014-12-18 02:44:16 +03:00
Dmitry Marakasov
0a72e7206c Update readme 2014-12-18 02:38:51 +03:00
Dmitry Marakasov
941cc480c6 Add travis build status icon 2014-12-17 18:58:31 +03:00
Dmitry Marakasov
4a48b94e29 Make -Werror optional 2014-12-16 20:32:00 +03:00
Dmitry Marakasov
93a77542d8 Fix move assignments
- Add self-assignment checks
- Free resources of object which is going to be replaced to avoid
  resource leaks
0.3.0
2014-11-30 01:22:22 +03:00
Dmitry Marakasov
8471330bbb Merge branch 'audio' 2014-11-30 01:08:22 +03:00
Dmitry Marakasov
003cbe03d1 Add demo for wav loading and playing 2014-11-30 00:53:16 +03:00
Dmitry Marakasov
950829f234 Add Wav class 2014-11-30 00:48:08 +03:00
Dmitry Marakasov
646380520f Add method to check if two AudioSpecs are equal 2014-11-30 00:45:36 +03:00
Dmitry Marakasov
7ebd613d01 Add AudioSpec copy constructor
Since callback is non-copyable, new callback is specified
2014-11-30 00:44:43 +03:00
Dmitry Marakasov
e034f6cd67 Add AudioSpec empty constructor 2014-11-30 00:44:02 +03:00
Dmitry Marakasov
724e3f37a8 Provide default value for empty callback 2014-11-30 00:43:13 +03:00
Dmitry Marakasov
fcf0302213 Remove noexcept specifications
std::function(std::function&&) is only noexcept in libc++, not
libstdc++, so calculated signatire of move ctor/assignment of AudioSpec
won't match specification
2014-11-29 23:12:11 +03:00
Dmitry Marakasov
4e68627f12 Add audio demo 2014-11-29 22:58:49 +03:00
Dmitry Marakasov
2be68a9ebb Add wrapper for large part of SDL2 audio functionality 2014-11-29 22:58:27 +03:00
Dmitry Marakasov
bb1c4bf168 Add another project user 2014-11-29 19:25:26 +03:00
Dmitry Marakasov
a97d100372 Implement texture property getters 0.2.0 2014-11-25 23:41:54 +03:00
Dmitry Marakasov
f5fa211cfe Implement texture locking 2014-11-24 19:27:56 +03:00
Dmitry Marakasov
359a0e93c8 Implement Rect::Contains(Point) 2014-11-24 01:52:49 +03:00
Dmitry Marakasov
39c377d7ee Only build image demo when SDL2_image support is enabled 2014-10-01 00:40:00 +04:00
Dmitry Marakasov
cf5f1c16c4 Unroll needless cmake loop 2014-09-30 23:32:59 +04:00
Dmitry Marakasov
c7a444769e Mention RWops in README 2014-09-20 23:51:52 +04:00
Dmitry Marakasov
936e133e44 Test installation as well 2014-09-10 00:32:10 +04:00
Dmitry Marakasov
6150f414b7 Provide proper library version 0.1.1 2014-09-09 23:24:34 +04:00
Dmitry Marakasov
563f566180 Implement installation 2014-09-09 23:17:03 +04:00
Dmitry Marakasov
6d2c1b4f9e Add sdl2-image dependency to travis config 0.1.0 2014-09-05 05:50:25 +04:00
Dmitry Marakasov
168143510b Mention template args 2014-09-05 05:41:59 +04:00
Dmitry Marakasov
3e5b392075 ContainerRWops are not assignable due to references; add noexecpt to move ctor 2014-09-05 05:35:34 +04:00
Dmitry Marakasov
a1717d8b18 Merge branch 'image' 2014-09-05 05:23:25 +04:00
Dmitry Marakasov
e3ad1a4ad7 Add custom RWops for use with constant containers 2014-09-05 05:23:13 +04:00
Dmitry Marakasov
1993fd3ec6 Add demo for SDL_image support 2014-09-05 05:06:21 +04:00
Dmitry Marakasov
2fad6762ff Update documentation for new features 2014-09-05 05:05:31 +04:00
Dmitry Marakasov
2b84c17ce2 Allow to load texture fro file or via RWops 2014-09-05 05:03:12 +04:00
Dmitry Marakasov
d69a07ea1c Options should only be used in standalone build 2014-09-05 05:01:27 +04:00
Dmitry Marakasov
9a0a6b9da6 Add Config.hh to record build-time settings 2014-09-05 05:00:06 +04:00
Dmitry Marakasov
955d6f7bc1 Add SDL_image2 support to cmake 2014-09-05 04:57:32 +04:00
Dmitry Marakasov
5542acd252 Add tests for RWops 2014-09-05 04:54:53 +04:00
Dmitry Marakasov
fbf5d046ea Add custom RWops class which works with arbitrary container as a storage 2014-09-05 04:54:50 +04:00
Dmitry Marakasov
aaea702856 Add RWops class 2014-09-05 04:46:30 +04:00
Dmitry Marakasov
1ddf04e823 Make test which depend on OpenGL behavior non-fatal 2014-09-02 07:27:16 +04:00
Dmitry Marakasov
cced165fbd Update testing.h 2014-09-02 07:27:13 +04:00
Dmitry Marakasov
b92804536c Make gui test result visible 2014-07-27 00:30:49 +04:00