File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Change Log -- Ray Tracing in One Weekend
27
27
- Change: First image size changed to 256x256
28
28
- Change: Default image sizes changed from 200x100 to 384x216
29
29
- Change: Define image aspect ratio up front, then image height from that and the image width
30
+ - Change: The C++ ` <random> ` version of ` random_double() ` no longer depends on ` <functional> ` header
30
31
31
32
### _ The Next Week_
32
33
- Change: Large rewrite of the ` image_texture ` class. Now handles image loading too. (#434 )
Original file line number Diff line number Diff line change 1290
1290
If you want to use this, you can obtain a random number with the conditions we need as follows:
1291
1291
1292
1292
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
1293
- #include < functional>
1294
1293
#include < random>
1295
1294
1296
1295
inline double random_double() {
1297
1296
static std::uniform_real_distribution< double> distribution(0.0, 1.0);
1298
1297
static std::mt19937 generator;
1299
- static std::function< double()> rand_generator =
1300
- std::bind(distribution, generator);
1301
- return rand_generator();
1298
+ return generator(distribution);
1302
1299
}
1303
1300
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1304
1301
[Listing [random-double-alt]: < kbd> [rtweekend.h]</ kbd> random_double(), alternate implemenation]
You can’t perform that action at this time.
0 commit comments