Skip to content

Commit fac5f19

Browse files
authored
Merge pull request #891 from RayTracing/tdb/main_includes
Added context to main includes
2 parents 96c28a3 + 0a35a95 commit fac5f19

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,9 +1547,18 @@
15471547
<div class='together'>
15481548
Main is also changed:
15491549

1550+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
1551+
#include "rtweekend.h"
1552+
1553+
15501554
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
15511555
#include "camera.h"
15521556
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
1557+
#include "color.h"
1558+
#include "hittable_list.h"
1559+
#include "sphere.h"
1560+
1561+
#include <iostream>
15531562

15541563
...
15551564

@@ -2292,12 +2301,17 @@
22922301
Now let’s add some metal spheres to our scene:
22932302

22942303
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
2295-
...
2296-
2304+
#include "rtweekend.h"
22972305

2306+
#include "camera.h"
2307+
#include "color.h"
2308+
#include "hittable_list.h"
22982309
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
22992310
#include "material.h"
23002311
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
2312+
#include "sphere.h"
2313+
2314+
#include <iostream>
23012315

23022316
...
23032317

@@ -2860,19 +2874,26 @@
28602874
#include "color.h"
28612875
#include "hittable_list.h"
28622876
#include "material.h"
2877+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
28632878
#include "scene.h"
2879+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
28642880
#include "sphere.h"
28652881

28662882
int main() {
2883+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
28672884
scene scene_desc;
2885+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
28682886

28692887
const double aspect_ratio = 16.0 / 9.0;
28702888

2889+
2890+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
28712891
scene_desc.image_width = 400;
28722892
scene_desc.image_height = static_cast<int>(scene_desc.image_width / aspect_ratio);
28732893
scene_desc.samples_per_pixel = 100;
28742894

28752895
hittable_list& world = scene_desc.world;
2896+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
28762897

28772898
auto material_ground = make_shared<lambertian>(color(0.8, 0.8, 0.0));
28782899
auto material_center = make_shared<lambertian>(color(0.1, 0.2, 0.5));
@@ -2885,7 +2906,10 @@
28852906
world.add(make_shared<sphere>(point3(-1.0, 0.0, -1.0), -0.4, material_left));
28862907
world.add(make_shared<sphere>(point3( 1.0, 0.0, -1.0), 0.5, material_right));
28872908

2909+
2910+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
28882911
scene_desc.render();
2912+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
28892913
}
28902914
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28912915
[Listing [main-with-scene]: <kdb>[main.cc]</kbd> main.cc using the new scene class]

0 commit comments

Comments
 (0)