Learning from OpenGL

Pit 001

:
:
:
:
:
:
:
:
:
:
:

    std::fstream file(filepath);
    std::string shaderText = "";
    std::string line;
    while (std::getline(file, line))
        shaderText = shaderText + line +"\n" ;
    file.close();

In particular, put a newline character “\n” at the end of each line change after reading it.
Pit 002
And then at the end of the transformation into the camera space, we have to multiply by the three basis vectors for the camera space.

Pit 003

Flag ① : Sometimes the render is too frequent, which causes us to process our input too much, so here we use the code in Flag ① to control the render frequency a bit. Render only if the value of count is an integer multiple of 100,000.
flag ② : The Render Callback needs to constantly refresh the transformation matrix we set, otherwise even if we change the render matrix in the code, it will not work.


Read More: