Skip to content

Commit 5a71df4

Browse files
authored
Lots of grammar/spelling issues & rewrote some docs (#119)
* Lots of grammar/spelling issues & rewrote some docs * Resolve conversations
1 parent 83fea43 commit 5a71df4

File tree

7 files changed

+88
-66
lines changed

7 files changed

+88
-66
lines changed

docs/1-introduction/1-1-getting-started/1-1-0-overview.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
# Overview
22

3-
As many may know or not know, there's a few choices in terms of what to use for graphics, such as OpenGL, Vulkan, Metal and what is commonly known as "DirectX".
4-
However in word of mouth DirectX usually refers to Direct3D, which is one of the many API's that DirectX has, as it is less known that DirectX is more than just graphics, it is:
3+
As you may or may not know, there's a few choices in terms of what you can use for rendering, such
4+
as OpenGL, Vulkan, Metal, and what is commonly known as "DirectX". However, in word of mouth
5+
DirectX usually refers to Direct3D, which is one of the many API's that DirectX has. In fact
6+
DirectX provides tooling and libraries for more aspects of game development, including:
57

68
- **Audio**
7-
89
- **Fonts**
9-
1010
- **Input**
11-
1211
- **Graphics**
1312

14-
And _other things_ more or less targeted at stuff one needs for game development.
13+
The goal of LearnD3D11 is, as one might guess, the targeted explanation and showcase of Direct3D11
14+
within C++, or as one generally refers to it: "DirectX 11". This guide does _NOT_ cover DirectX 12,
15+
the newer version of the API, as it is very low level and will usually require a good understanding
16+
of the GPU and how it works. We will cover concepts and some techniques used in graphics programming,
17+
and we do not expect you to have any prerequisites in this field. It is, however, not a guide
18+
covering C++ or programming in general; we expect at least the ability and understanding to write
19+
object-oriented programs in C++.
1520

16-
The goal of LearnD3D11 is as one might guess is the targeted explanation and showcase of Direct3D11 or as one generally refers to it: "DirectX 11".
21+
During each step we'll provide a project for you to follow along as we explain everything for you
22+
to start rendering geometry using your GPU.
1723

18-
During each step we'll provide a project for you to follow along as we explain each individual thing needed to get some graphics on your own screen.
24+
Also note that DirectX is made by Microsoft and is generally only available on Windows. However,
25+
`DXVK` was developed to run D3D9 through D3D11 on Linux or Wine on top of Vulkan and would be the
26+
only way of developing and using D3D11 on those platforms.
1927

20-
This initial section will cover creating the actual window, initializing Direct3D11 and getting our very first visuals (which is commonly known as the Hello Triangle)
28+
This initial section will cover creating the actual window, initializing Direct3D11 and getting our
29+
very first visuals (which is commonly known as the Hello Triangle)
2130

2231
## Project structure
2332

@@ -45,5 +54,3 @@ x-x-x-project.vcxproj
4554
- `obj/` contains all intermediate junk the compiler produced, to keep the folder structure clean
4655
- `bin/` will contain the compiled program of the chapter along with all necessary `Assets`
4756
- `Assets/` will contain all the used assets, such as models, shaders and textures and other things. It will be empty for the first few chapters, and we will copy it and its contents to the bin/Debug or bin/Release directory, depending on which configuration you chose
48-
49-
[Next chapter](../1-1-1-hello-window/)

docs/1-introduction/1-1-getting-started/1-1-1-hello-window.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@ resolution you use. Size-wise it will cover 90% of your main monitor.
9898
glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_FALSE);
9999
```
100100
101-
This will tell `GLFW` to not scale the window in any way, should you have setup a specific scaling
102-
other than 100% on your desktop. That will keep the windowsize at what we set it, without thinking
103-
about odd fractionals to manually scale the windowsize for any arbitrary scaling on your OS.
101+
This will tell `GLFW` to not scale the window in any way, should you have set up a specific scaling
102+
other than 100% on your desktop. That will keep the window size at what we set it, and lets us
103+
forget about fractional window and pixel scaling.
104104
105105
```cpp
106106
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
107107
```
108108

109109
`GLFW` was initially meant to support development of OpenGL based applications, hence the gl in its
110110
name, but over the years it also started to support other APIs and not just OpenGL. Now since `GLFW`
111-
automatically creates a context for OpenGL and we want to use DirectX, we will have to tell it to not
112-
to do so via [glfwWindowHint](https://www.glfw.org/docs/3.3/group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033).
111+
by default creates a context for OpenGL, and as we want to use DirectX we need to tell `GLFW`
112+
to not do so via [glfwWindowHint](https://www.glfw.org/docs/3.3/group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033).
113113

114114
There are many other options one can define through glfwWindowHint which can be found [here](https://www.glfw.org/docs/3.3/group__window.html).
115115
Many of these options might be useful in your application, depending on what you want and how you
@@ -156,7 +156,7 @@ That is more or less the heart of your application, the mainloop.
156156
You could also call it game loop, since in here everything happens.
157157
From reading keyboard and mouse input, reacting to it, to telling the graphics
158158
card to put a frog on the screen. It will keep doing it, until it gets signaled
159-
to not to do that anymore because you closed the window for example
159+
to not do that anymore because you closed the window for example
160160
([glfwWindowShouldClose](https://www.glfw.org/docs/3.3/group__window.html#ga24e02fbfefbb81fc45320989f8140ab5)),
161161
or hit Escape and mapped Escape to close the window. [glfwPollEvents](https://www.glfw.org/docs/3.3/group__window.html#ga37bd57223967b4211d60ca1a0bf3c832)
162162
will make sure that `GLFW` knows about all required events coming from the operating system.
@@ -200,7 +200,7 @@ The further we go into this tutorial series the more stuff we will add to the pr
200200
But we don't want to cram everything into `Main.cpp`, your main entry point of the program.
201201
A good practise is to split up things into smaller units, to not lose overview.
202202
203-
Right now we dont have much to show for, just a window, made by a few lines of code,
203+
Right now we don't have much to show for, just a window, made by a few lines of code,
204204
but we are going to abstract that code into a new class called `Application` which will also be
205205
our main container so to speak, in which all the magic will happen.
206206
@@ -363,9 +363,9 @@ int main(int argc, char* argv[])
363363
}
364364
```
365365

366-
Let's start with `Main.cpp`. That's all its doing, creating the hellowindow application and running it.
366+
Let's start with `Main.cpp`. That's all its doing, creating the "hellowindow" application and running it.
367367
In the future this can be accompanied by loading a configuration, initializing a logger,
368-
initiating a connection to a possible server server, or other stuff.
368+
initiating a connection to a possible server, or other stuff.
369369

370370
```cpp
371371
public:
@@ -377,7 +377,7 @@ public:
377377
This is a section of the `Application` class, showing only its publicly available methods. `Run` being
378378
the most important one to the outside world, like `Main`, it's the entry point into this Application.
379379

380-
We still dont want to cram everything into one main or one method, therefore `Run` is split up
380+
We still don't want to cram everything into one main or one method, therefore `Run` is split up
381381
again into the following blocks.
382382

383383
```cpp
@@ -402,22 +402,22 @@ void Application::Run()
402402
}
403403
```
404404

405-
You can clearly see what it is doing. `Initialize`, as the name suggests, will initialize everything
406-
which is required for the app to run, which currently is the window in our case. In future chapters it
407-
will also including initializing `D3D11` and its resources or imgui for some UI.
405+
This function is pretty simple. `Initialize`, as the name suggests, will initialize everything
406+
which is required for the app to run, which currently is the window in our case. In future
407+
chapters it will also include initializing `D3D11`, its resources, and ImGUI for the UI.
408408

409-
`Load`s purpose is to load all the assets required to run the application, in further chapters it will
409+
`Load`'s purpose is to load all the assets required to run the application, in further chapters it will
410410
encompass textures, shaders, models and other things.
411411

412-
The next block is the aforementioned mainloop or gameloop, which still does what it was doing before,
413-
checking with the OS if events need to be processed and now we also call a `Update` and `Render` method.
412+
The next block is the aforementioned mainloop or game loop, which still does what it was doing before,
413+
checking with the OS if events need to be processed, and now we also call a `Update` and `Render` method.
414414

415415
`Update` may contain queries about pressed key or mouse buttons, updating variables or other things
416416
which are - for instance - reflected on display inside the `Render` method.
417417

418418
You probably have noticed that all the protected method in `Application` are virtual, that's because
419419
we are deriving from `Application` in form of `HelloWindowApplication` and only focus on those four
420-
methods if required. We now dont have to deal with the mainloop anymore for the time being.
420+
methods if required. We now don't have to deal with the mainloop anymore for the time being.
421421

422422
```cpp
423423
virtual void Cleanup();
@@ -438,5 +438,3 @@ and more.
438438
[Raw Winapi Hello Window Project on GitHub](https://github.com/GraphicsProgramming/learnd3d11/tree/main/src/Cpp/1-getting-started/1-1-1-HelloWin32Window)
439439

440440
[Project on GitHub](https://github.com/GraphicsProgramming/learnd3d11/tree/main/src/Cpp/1-getting-started/1-1-1-HelloWindow)
441-
442-
[Next chapter](../1-1-2-hello-d3d11/)

docs/1-introduction/1-1-getting-started/1-1-2-hello-d3d11.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Hello D3D11
22

33
In this chapter, we'll introduce you to the basics of using D3D11; how to create a ID3D11Device and
4-
how to use it to show something in our window. In the last chapter we setup a basic implementation
4+
how to use it to show something in our window. In the last chapter we set up a basic implementation
55
for an application with a window through GLFW. The implementation for `Main.cpp` and
66
`Application.cpp` won't be shown here anymore.
77

8-
If you are looking at the source code for this chapter, you will also notice that
9-
`Application.cpp` and `Application.hpp` do not exist anymore, as we have moved both of these
10-
files into a separate `Framework` project to ease development between chapters. This `Framework`
11-
project will include code that is shared between all chapters, so it might include a lot of other
12-
files which are not used or are not relevant within some chapters. Please note that the code for
13-
already existing files is also subject to change to accomodate newer chapters and their needs.
8+
If you are looking at the source code for this chapter, you will also notice that `Application.cpp`
9+
and `Application.hpp` do not exist anymore, as we have moved both of these files into a separate
10+
`Framework` project to ease development between chapters. This `Framework` project will include
11+
code that is shared between all chapters, so it might include a lot of other files which are not
12+
used or are not relevant within some chapters. Please note that the code for already existing files
13+
is also subject to change to accommodate newer chapters and their needs.
1414

1515
However, let's start by breaking down the relevant bits and pieces by showing you how the new
1616
class, which derives from `Application` will look like.
@@ -173,7 +173,7 @@ You might have noticed that we are not using raw pointers for those pieces, but
173173

174174
`DXGI` stands for DirectX Graphics Infrastructure, in case you are wondering.
175175

176-
Lets go in to `Initialize`
176+
Let's go in to `Initialize`
177177

178178
```cpp
179179
if (!Application::Initialize())
@@ -192,7 +192,7 @@ if (FAILED(CreateDXGIFactory2(
192192
193193
The first part calls the parent class, where `GLFW` is initialized and setup.
194194
195-
`IID_PPV_ARGS(ppType)` Is a compile time macro that is defined as
195+
`IID_PPV_ARGS(ppType)` Is a compile-time macro that is defined as
196196
```cpp
197197
#define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType)
198198
```
@@ -211,7 +211,7 @@ HRESULT CreateDXGIFactory2(
211211
What the parts of the `IID_PPV_ARGS(ppType)` macro are:
212212

213213
[the `ppType` in `IID_PPV_ARGS(ppType)`]
214-
- a pointer to a pointer of a object.
214+
- a pointer to a pointer of an object.
215215

216216
[the `__uuidof(**(ppType))` part of `IID_PPV_ARGS(ppType)`]
217217
- at compile time retrieves a `UUID` from `ppType` type which represents a `GUID`, which is returned as a `REFIID` — which means that the type returned is a reference to an identifier to a specific type of COM object.
@@ -245,7 +245,7 @@ if (FAILED(D3D11CreateDevice(
245245
}
246246
```
247247

248-
This block is the the entry point into D3D11, where we ask for a device and its device context to be created. The input parameters are:
248+
This block is the entry point into D3D11, where we ask for a device and its device context to be created. The input parameters are:
249249

250250
We want a LEVEL_11_0, hardware accelerated device, which has support for a specific color format.
251251
Feature levels are a concept that has been introduced with D3D11, it is a way to specify which set of features we would like to use. Each GPU may support different feature levels (for example a very old GPU might only support LEVEL_9_1, while a more modern one may support every feature level up to, and including LEVEL_11_0), this is a way to avoid rewriting our application in D3D9 just because our GPU doesn't support D3D11.
@@ -290,7 +290,7 @@ The majority of values should make some sense without explanation, like width an
290290
291291
`BufferCount` is 2, because we want double buffering. Double buffering is an age-old technique to avoid presenting an image that is being used by the GPU, instead we work on the "back buffer", while the GPU is happy presenting the "front buffer", then, as soon as we are done with the back buffer, we swap front and back, and begin working on the former front buffer present that one and render to the other one again in the meantime. That process is supposed to reduce flicker or tearing.
292292
293-
`SwapEffect` specifies if the contents of the back buffer should be preserved or discarded after a swap, here we don't care about preserving the back buffer so we just discard everything.
293+
`SwapEffect` specifies if the contents of the back buffer should be preserved or discarded after a swap, here we don't care about preserving the back buffer, so we just discard everything.
294294
295295
`AlphaMode` specifies how DXGI should handle transparency, we don't care about that (yet), so we'll just say it's unspecified and rely on default behaviour
296296
@@ -332,7 +332,7 @@ bool HelloD3D11Application::CreateSwapchainResources()
332332
}
333333
```
334334

335-
When we render things, the GPU simply writes color values to a texture, which you can picture as a buffer which holds color information Swapchain is a container to manage those buffers we want to present on screen. To do that we have to create a special kind of texture called a "Render Target View" or an RTV. First off we have to grab a texture from the swapchain's main buffer (index 0), from that texture, we now have create an RTV from that, which specifies the subresource of the texture that we will be drawing to. We wont keep the actual texture around, we just need the render target view, which we will refer to as render target.
335+
When we render things, the GPU simply writes color values to a texture, which you can picture as a buffer which holds color information Swapchain is a container to manage those buffers we want to present on screen. To do that we have to create a special kind of texture called a "Render Target View" or an RTV. First off we have to grab a texture from the swapchain's main buffer (index 0), from that texture, we now have to create an RTV from that, which specifies the subresource of the texture that we will be drawing to. We won't keep the actual texture around, we just need the render target view, which we will refer to as render target.
336336

337337
```cpp
338338
void HelloD3D11Application::DestroySwapchainResources()
@@ -426,7 +426,7 @@ bool HelloD3D11Application::Load()
426426
}
427427
```
428428

429-
Finally we need to modify `Appplication.hpp` and `Application.cpp`. Since we want to handle resizing as well.
429+
Finally, we need to modify `Appplication.hpp` and `Application.cpp`. Since we want to handle resizing as well.
430430

431431
### Application.hpp
432432

@@ -446,7 +446,7 @@ virtual void OnResize(
446446
[[nodiscard]] int32_t GetWindowHeight() const;
447447
```
448448
449-
`HandleResize` will be the callback from `GLFW` which handles resize events and `OnResize` will be execute when GLFW runs HandleResize, so that we can handle our custom things we want to execute when resizing the window, like changing the size of the swapchain in our example.
449+
`HandleResize` will be the callback from `GLFW` which handles resize events and `OnResize` will be executed when GLFW runs HandleResize, so that we can handle our custom things we want to execute when resizing the window, like changing the size of the swapchain in our example.
450450
451451
`GetWindow()` is used to derive the actual native window handle from, which is needed when we create the swapchain. `GetWindowWidth()` and `GetWindowHeight()` do what they say :) Also required for swapchain creation.
452452

0 commit comments

Comments
 (0)