Skip to content

Commit

Permalink
Show actual fragment shader
Browse files Browse the repository at this point in the history
  • Loading branch information
deccer committed Nov 25, 2023
1 parent 888923b commit 86e6e86
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/01-basics/02-basic-window-and-triangle.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ What does it do? It creates an `OpenGL` object to represent a program, we will p
If there was problem it will be returned as error message and if everything was alright we will
get back the program itself.

Here is how we use it to create the vertex shader we need
The vertex shader itself:

```cpp
--8<-- "src/01-02-BasicWindowAndTriangle/Main.cpp:211:228"
```

And here is how we create a program out of it.

```cpp
--8<-- "src/01-02-BasicWindowAndTriangle/Main.cpp:242:248"
Expand Down Expand Up @@ -217,6 +223,14 @@ The fragment shader takes the fragments from the rasterizer stage and "colors" t

The fragment shader is also an object we create, similar to the vertex shader

The fragment shader itself

```cpp
--8<-- "src/01-02-BasicWindowAndTriangle/Main.cpp:230:240"
```

And we also create a program out of it like so

```cpp
--8<-- "src/01-02-BasicWindowAndTriangle/Main.cpp:250:256"
```
Expand Down

0 comments on commit 86e6e86

Please sign in to comment.