19 Commits

Author SHA1 Message Date
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
950829f234 Add Wav class 2014-11-30 00:48:08 +03:00
Dmitry Marakasov
2be68a9ebb Add wrapper for large part of SDL2 audio functionality 2014-11-29 22:58:27 +03:00
Dmitry Marakasov
359a0e93c8 Implement Rect::Contains(Point) 2014-11-24 01:52:49 +03:00
Dmitry Marakasov
e3ad1a4ad7 Add custom RWops for use with constant containers 2014-09-05 05:23:13 +04:00
Dmitry Marakasov
5542acd252 Add tests for RWops 2014-09-05 04:54:53 +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
Dmitry Marakasov
1ec8df2964 More Get() tests 2014-02-21 23:54:22 +04:00
Dmitry Marakasov
5a61a8f51b Fix Get() for null Points and Rects, add tests for it 2014-02-21 23:46:37 +04:00
Dmitry Marakasov
8e6bf5fc2f Add basic Point arith 2014-02-21 20:09:11 +04:00
Dmitry Marakasov
015a9e5be5 Add partial GUI test 2014-02-11 07:41:23 +04:00
Dmitry Marakasov
820813b79f Improve testing framework, add stub for GUI tests 2014-02-11 06:15:01 +04:00
Dmitry Marakasov
f6d6572602 Fix Rect::FromCenter and add test for it 2014-02-11 06:01:36 +04:00
Dmitry Marakasov
07bf0aa3d5 Add Point and Rect tests 2014-02-11 05:51:15 +04:00
Dmitry Marakasov
3df16d40d1 Add basic tests
For now the only thing checked is that header files compile by
themselves, e.g. includes and forward declarations in them are
complete and they do not require extra includes
2014-02-03 01:48:38 +04:00