Skip to content

Commit a275ad3

Browse files
committed
~ wiki - old oop readme
1 parent e10110c commit a275ad3

File tree

2 files changed

+14
-176
lines changed

2 files changed

+14
-176
lines changed

BasicOOP/README.txt

-160
This file was deleted.

wiki/BasicOOP.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
21
# Intro
32

43
[OpenGL docs](https://www.glfw.org/documentation.html).
54

65
Every OpenGL call involves the GPU in some way. OpenGL stores memory in column major format when, data is read in column by column. [Abstracting OpenGL into Classes](https://www.youtube.com/watch?v=bTHqmzjm2UI&list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2&index=13) and almost last vid in this series is [Writing a Basic Renderer in OpenGL](https://www.youtube.com/watch?v=jjaTTRFXRAk&list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2&index=16).
76

8-
Depdends on: [GL Extension Wrangler](https://github.com/nigels-com/glew), [imgui](https://github.com/ocornut/imgui).
7+
Depends on: [GL Extension Wrangler](https://github.com/nigels-com/glew), [imgui](https://github.com/ocornut/imgui).
98

109
# Draw Pipeline
11-
(CPU) Bind vertex > (CPU) Bind vertex array >(CPU) Bind index buffer > (CPU) Bind shader > (GPU) GLSM fragment and vertex shader > (CPU) Give all to Renderer > (CPU) Renderer.Draw()
10+
(CPU) Bind vertex > (CPU) Bind vertex array >(CPU) Bind index buffer > (CPU) Bind shader > (GPU) GLSL fragment and vertex shader > (CPU) Give all to Renderer > (CPU) Renderer.Draw()
1211
* Vertex buffer has our graphics bytes.
1312
* Vertex array defines the memory layout of our vertex buffer.
1413
* Vertex buffer layout defines mem address structure.
1514
* Shader and Texture adds the color and image graphics.
16-
* Draw earch frame on Window.
15+
* Draw each frame on Window.
1716

1817
## Unbind
1918
Generally don't need to call unbind since going to bind something new anyway
@@ -23,26 +22,26 @@ Generally don't need to call unbind since going to bind something new anyway
2322
Memory
2423
* Vertex Buffer
2524
Size of our queued up graphics data
26-
Tri verticies
25+
Tri vertices
2726

2827
* Vertex Buffer Layout
2928
Struct for containing our vertex buffer attributes for our glVertexAttribPointer
3029
Vector of this struct
3130
Stride for vertex_mem_address_width between verts in our vector
3231
Push to add m_elements to our Buffer layout
33-
Ploymorphic funtion to store floats, int, and bytes
32+
Polymorphic function to store floats, int, and bytes
3433

3534
* Vertex Array
3635
Adds collection of VertexBuffers with offsets
3736
Binds the vertex buffers and set memory layout
3837

3938
* Index Buffer
40-
Loads rendundant vertex data during drawing
41-
Supporting 32 bit indicies
39+
Loads redundant vertex data during drawing
40+
Supporting 32 bit indices
4241

4342
* Vertex Buffer & Index Buffer
4443
Has a Renderer ID that uniquely identifies each Vertex Buffer
45-
Can bind, unbind with renderer id holding our pointer to the binded data
44+
Can bind, unbind with renderer id holding our pointer to the bound data
4645

4746
Graphics
4847
* Shader
@@ -68,7 +67,7 @@ Graphics
6867
glm::vec4 result = orthographic_projection_matrix * vertex_position;
6968
```
7069
* In fragment shader, we can use the last color output to draw our texture with white.
71-
```glsm
70+
```glsl
7271
void main()
7372
{
7473
vec4 texture_color = texture(u_texture, varying_texture_coordinate);
@@ -78,7 +77,7 @@ Graphics
7877
```
7978
8079
* Blending
81-
* Belending colors. Render a red squrare and blue square on top of each other will get a purple square.
80+
* Blending colors. Render a red squrare and blue square on top of each other will get a purple square.
8281
* Combine both colors using `glBlendFunc` into an "output color" and store in a "target buffer"
8382
* Math is take each RGBA color channel for square1 and square2 then do:
8483
* sqaure1 RGBA (1.0, 1.0, 1.0, 0.5) -> SOURCE
@@ -91,7 +90,7 @@ Graphics
9190
```
9291
9392
* Textures
94-
* Image files loaded into CPU memory and Shader draws by reading the images pixel array and defining what color is for earch array element.
93+
* Image files loaded into CPU memory and Shader draws by reading the images pixel array and defining what color is for each array element.
9594
* Use [stb image loader](https://github.com/nothings/stb) header file.
9695
* In OpenGL bottom left is (0,0) so we must flip our image.
9796
* Need "Slots" to bind textures to, most desktops have 32 slots
@@ -110,10 +109,10 @@ Graphics
110109
* OpenlGL uses 0 to 1 as coordinate space then scales up.
111110
* Model view projection matrix
112111
* View matrix control camera (simulated by translating all on screen objects).
113-
* Model matrix code for our object (has position, rotatation, and scale).
112+
* Model matrix code for our object (has position, rotation, and scale).
114113
* Vector: directional or positional (where does ball go, where does camera go?).
115114
116-
## Visual Studio 2019 Properities
115+
## Visual Studio 2019 Properties
117116
Solution should target 32 bit `x86` since opengl libs are `0x20` bit compatible.
118117
C/C++
119118
* General: Add GLFW and glew include locations using `$(SolutionDir)`.
@@ -126,5 +125,4 @@ Linker
126125
## Misc. Concepts
127126
* Quads are squares.
128127
* Tris are triangles.
129-
* Sampling: openGL uses 0 to 1 and scales depending on resolution and interpolates the color to fill in between for * earch pixel in the screen coordinates.
130-
128+
* Sampling: OpenGL uses 0 to 1 and scales depending on resolution and interpolates the color to fill in between for * each pixel in the screen coordinates.

0 commit comments

Comments
 (0)