### OpenGL Getting Started Source: https://learnopengl-cn.github.io/05%20Advanced%20Lighting/09%20SSAO Covers the fundamental steps to get started with OpenGL, including window creation, basic rendering, shaders, textures, transformations, coordinate systems, and camera setup. ```C++ // Example for creating a window (conceptual) #include int main() { if (!glfwInit()) return -1; GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); // ... OpenGL initialization and rendering loop ... glfwTerminate(); return 0; } ``` ```GLSL // Example Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; void main() { gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); } ``` ```GLSL // Example Fragment Shader #version 330 core out vec4 FragColor; void main() { FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); } ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/05%20Advanced%20Lighting/03%20Shadows/01%20Shadow%20Mapping Covers the fundamental steps for getting started with OpenGL, including window creation, basic rendering with triangles, shaders, textures, transformations, coordinate systems, and camera setup. ```en https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/07%20Postprocessing Covers the fundamental steps to begin with OpenGL, including setup, window creation, and basic rendering. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/05%20Collisions/01%20Ball Covers the fundamental steps to get started with OpenGL, including window creation, basic rendering, shaders, textures, transformations, coordinate systems, and camera setup. ```OpenGL // Creating a window // Hello, Window // Hello, Triangle // Shaders // Textures // Transformations // Coordinate Systems // Camera ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/05%20Advanced%20Lighting/02%20Gamma%20Correction Covers the fundamental steps for getting started with OpenGL, including window creation, rendering basic shapes, shaders, textures, transformations, coordinate systems, and camera setup. ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/10%20Instancing Covers the fundamental steps to begin with OpenGL, including window creation, basic rendering, shaders, textures, transformations, coordinate systems, and camera setup. ```C++ // Example for creating a window (conceptual) #include int main() { if (!glfwInit()) return -1; GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); // ... OpenGL initialization and rendering loop ... glfwTerminate(); return 0; } ``` ```GLSL // Example Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; void main() { gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); } ``` ```GLSL // Example Fragment Shader #version 330 core out vec4 FragColor; void main() { FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); } ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders Covers the fundamental steps to begin with OpenGL, including setting up the environment, creating windows, and rendering basic shapes like triangles. ```OpenGL Creating a window https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ ``` ```OpenGL Hello Window https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ ``` ```OpenGL Hello Triangle https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/09%20Audio Covers the fundamental steps to begin with OpenGL, including window creation, basic rendering of triangles, shaders, textures, transformations, coordinate systems, and camera setup. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/03%20Rendering%20Sprites Covers the fundamental steps to get started with OpenGL, including creating a window, understanding shaders, textures, and transformations. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started: Hello Window Source: https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle This entry refers to the initial steps in setting up an OpenGL window, a fundamental part of the 'Getting Started' series. ```OpenGL Hello Window ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/02%20Lighting/06%20Multiple%20lights Covers the fundamental steps to begin with OpenGL, including setting up a window, rendering basic shapes like triangles, and understanding shaders. ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ ``` -------------------------------- ### OpenGL Getting Started: Hello Triangle Source: https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle This snippet details the core concepts for getting started with OpenGL, specifically focusing on the 'Hello Triangle' example. It covers vertex input, vertex and fragment shaders, shader compilation, linking vertex attributes, element buffer objects, and additional resources and exercises. ```OpenGL Hello, Triangle Vertex Input Vertex Shader Compile Shaders Fragment Shader Linking Vertex Attributes Element Buffer Objects Additional Resources Exercises ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/01%20Depth%20testing Covers the fundamental steps to begin with OpenGL, including setting up a window, rendering basic shapes like triangles, and understanding shaders. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/02%20Lighting/03%20Materials Covers the fundamental steps to begin with OpenGL, including window creation, basic rendering with triangles, shaders, textures, and coordinate systems. ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/05%20Advanced%20Lighting/01%20Advanced%20Lighting Covers the fundamental steps to get started with OpenGL, including window creation, rendering triangles, shaders, textures, transformations, coordinate systems, and camera. ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/02%20Setting%20up Covers the fundamental steps to get started with OpenGL, including creating a window, rendering basic shapes like triangles, and understanding shaders. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/06%20In%20Practice/02%20Text%20Rendering Covers the fundamental steps to get started with OpenGL, including window creation, basic rendering, shaders, textures, transformations, coordinate systems, and camera implementation. ```en OpenGL Creating a window Hello Window Hello Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/03%20Model%20Loading/03%20Model Covers the fundamental steps to get started with OpenGL, including window creation, rendering basic shapes like triangles, and understanding shaders. ```C++ #include #include void framebuffer_size_callback(GLFWwindow* window, int width, int height) { glViewport(0, 0, width, height); } int main() { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL); glfwMakeContextCurrent(window); gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); glViewport(0, 0, 800, 600); glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); while (!glfwWindowShouldClose(window)) { // Render loop glfwSwapBuffers(window); glfwPollEvents(); } glfwTerminate(); return 0; } ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/04%20Levels Covers the fundamental steps to get started with OpenGL, including window creation, basic rendering, shaders, textures, transformations, coordinate systems, and camera implementation. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera Covers the fundamental steps to begin with OpenGL, including setting up the environment, creating a window, and rendering basic shapes like triangles. It also introduces core concepts like shaders and textures. ```OpenGL Creating a window: https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ Hello, Window: https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ Hello, Triangle: https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ Shaders: https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ Textures: https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ Transformations: https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ Coordinate Systems: https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ Camera: https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ Review: https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/07%20PBR/02%20Lighting Covers the fundamental steps to begin with OpenGL programming, including window creation, rendering basic shapes like triangles, and understanding shaders. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/06%20In%20Practice/01%20Debugging Covers the fundamental steps to begin with OpenGL programming, including window creation, rendering basic shapes like triangles, and understanding shaders and textures. ```en https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/code_repo Covers the fundamental concepts of OpenGL, including window creation, rendering basic shapes like triangles, shaders, textures, transformations, coordinate systems, and camera implementation. ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/01%20Breakout Covers the fundamental steps to begin with OpenGL, including window creation, rendering basic shapes like triangles, and understanding shaders, textures, transformations, coordinate systems, and camera implementation. ```C++ // Example for creating a window (conceptual) #include int main() { if (!glfwInit()) return -1; GLFWwindow* window = glfwCreateWindow(800, 600, "Hello Window", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); // ... OpenGL setup and rendering loop ... glfwDestroyWindow(window); glfwTerminate(); return 0; } ``` ```OpenGLSL // Example Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; void main() { gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); } ``` ```OpenGLSL // Example Fragment Shader #version 330 core out vec4 FragColor; void main() { FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); } ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/08%20Guest%20Articles/2020/01%20Skeletal%20Animation Covers the fundamental steps to begin with OpenGL, including window creation, rendering basic shapes like triangles, and understanding shaders, textures, transformations, coordinate systems, and camera implementation. ```OpenGL Creating a window Hello, Window Hello, Triangle Shaders Textures Transformations Coordinate Systems Camera Review ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/08%20Guest%20Articles/2021/01%20CSM Covers the fundamental steps to begin with OpenGL, including window creation, rendering basic shapes like triangles, and understanding shaders, textures, transformations, coordinate systems, and camera implementation. ```OpenGLSL // Example for Hello Window // No specific code provided in the text, but implies setup and rendering loop. ``` ```OpenGLSL // Example for Hello Triangle // Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; void main() { gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); } // Fragment Shader #version 330 core out vec4 FragColor; void main() { FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); } ``` ```OpenGLSL // Example for Shaders // Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; layout (location = 1) in vec3 aColor; out vec3 ourColor; void main() { gl_Position = vec4(aPos, 1.0); ourColor = aColor; } // Fragment Shader #version 330 core out vec4 FragColor; in vec3 ourColor; void main() { FragColor = vec4(ourColor, 1.0f); } ``` ```OpenGLSL // Example for Textures // Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; layout (location = 1) in vec2 aTexCoord; out vec2 TexCoord; void main() { gl_Position = vec4(aPos, 1.0); TexCoord = aTexCoord; } ``` ```OpenGLSL // Fragment Shader #version 330 core out vec4 FragColor; in vec2 TexCoord; uniform sampler2D texture1; uniform sampler2D texture2; void main() { FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2); } ``` ```OpenGLSL // Example for Transformations // Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; uniform mat4 transform; void main() { gl_Position = transform * vec4(aPos, 1.0); } ``` ```OpenGLSL // Example for Coordinate Systems // Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; uniform mat4 model; uniform mat4 view; uniform mat4 projection; void main() { gl_Position = projection * view * model * vec4(aPos, 1.0); } ``` ```OpenGLSL // Example for Camera // Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; uniform mat4 model; uniform mat4 view; uniform mat4 projection; void main() { gl_Position = projection * view * model * vec4(aPos, 1.0); } ``` -------------------------------- ### OpenGL Getting Started Source: https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review Covers the fundamental concepts of OpenGL, including setting up a window, rendering basic shapes like triangles, and understanding shaders, textures, transformations, coordinate systems, and cameras. ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/01%20OpenGL/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/06%20Textures/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ ``` ```OpenGL https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### OpenGL Getting Started Tutorials Source: https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems Covers the fundamental concepts of OpenGL, including window creation, rendering triangles, shaders, textures, transformations, coordinate systems, and camera implementation. ```C++ // Example for creating a window (conceptual) #include int main() { if (!glfwInit()) return -1; GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); // ... OpenGL initialization and rendering loop ... glfwDestroyWindow(window); glfwTerminate(); return 0; } ``` ```OpenGLSL // Example Vertex Shader #version 330 core layout (location = 0) in vec3 aPos; void main() { gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); } ``` ```OpenGLSL // Example Fragment Shader #version 330 core out vec4 FragColor; void main() { FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); } ``` -------------------------------- ### OpenGL 2D Game Development: Breakout Source: https://learnopengl-cn.github.io/02%20Lighting/06%20Multiple%20lights Guides through the development of a 2D game, Breakout, covering setup, sprite rendering, level design, and collision detection. ```OpenGL https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/01%20Breakout/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/02%20Setting%20up/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/03%20Rendering%20Sprites/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/04%20Levels/ ``` -------------------------------- ### OpenGL 2D Game Development Source: https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders Guides through the process of developing a 2D game using OpenGL, covering setup, sprite rendering, level design, and collision detection. ```OpenGL Breakout Game https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/01%20Breakout/ ``` ```OpenGL Setting up 2D Game https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/02%20Setting%20up/ ``` ```OpenGL Rendering Sprites https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/03%20Rendering%20Sprites/ ``` ```OpenGL Levels https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/04%20Levels/ ``` ```OpenGL Collision https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/05%20Collision/ ``` -------------------------------- ### Visual Studio Project Setup for OpenGL Source: https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window Steps for setting up a new Visual Studio project for OpenGL development, including changing the target architecture. ```C++ Create a new project in Visual Studio. Select 'Visual C++' and 'Empty Project'. Change the target architecture from x86 to x64 (usually found in a dropdown near the Debug/Release configuration). ``` -------------------------------- ### OpenGL In Practice Tutorials Source: https://learnopengl-cn.github.io/01%20Getting%20started/08%20Coordinate%20Systems Covers practical applications of OpenGL, including debugging, text rendering, and developing a 2D game (Breakout), with steps for setup, sprite rendering, and level design. ```C++ // Conceptual code for rendering text using a font library (e.g., FreeType) // FT_Library ft; // FT_Init_FreeType(&ft); // FT_Face face; // FT_New_Face(ft, "path/to/font.ttf", 0, &face); // FT_Set_Pixel_Sizes(face, 0, fontSize); // // ... Load glyph, create texture, render quads ... ``` ```C++ // Conceptual code for Breakout game sprite rendering // struct Sprite { // Texture2D Texture; // glm::vec4 SpriteColor; // glm::vec2 Position, Size, TexCoords; // }; // // void RenderSprite(Sprite sprite, SpriteRenderer& renderer) { // renderer.DrawSprite(sprite.Texture, sprite.Position, sprite.Size, sprite.SpriteColor, sprite.Rotation); // } ``` -------------------------------- ### Introduction to LearnOpenGL Source: https://learnopengl-cn.github.io/index This section introduces the LearnOpenGL project, its goals, and the target audience. It emphasizes the focus on modern OpenGL and the use of clear examples to explain concepts. It also mentions support for the author through donations. ```markdown # 欢迎来到OpenGL的世界 欢迎来到OpenGL的世界。这个工程只是我([Joey de Vries](http://joeydevries.com/))的一次小小的尝试,希望能够建立起一个完善的OpenGL教学平台。无论你学习OpenGL是为了学业,找工作,或仅仅是因为兴趣,这个网站都将能够教会你**现代**(Core-profile) OpenGL从基础,中级,到高级的知识。LearnOpenGL的目标是使用易于理解的形式,使用清晰的例子,展现现代OpenGL的所有知识点,并与此同时为你以后的学习提供有用的参考。 如果您喜欢这个系列教程的话,不妨向Joey de Vries的[Paypal](https://www.paypal.me/learnopengl/)进行捐赠,支持一下作者,让这个教程能够持续完善并更新。 ``` -------------------------------- ### Creating a Window with GLFW Source: https://learnopengl-cn.github.io/01%20Getting%20started/02%20Creating%20a%20window This section details the process of setting up a window and an OpenGL context using the GLFW library. It covers obtaining, compiling, and linking the GLFW library, and assumes the use of Visual Studio IDE. ```en GLFW is a C library which provides an API for creating windows, contexts and surfaces, receiving input and events as well as for composing scenes with OpenGL. This section and the next one are about getting the GLFW environment set up and running, making sure it correctly creates an OpenGL context and a simple window for us to use. This tutorial will guide you step-by-step on how to get, compile and link the GLFW library. We are using Microsoft Visual Studio 2019 IDE (the process is identical for newer versions of Visual Studio). If you are not using Visual Studio (or an older version), do not worry, the process is similar in most IDEs. ``` -------------------------------- ### Matrix Multiplication Example (3x3) Source: https://learnopengl-cn.github.io/01%20Getting%20started/07%20Transformations Provides a larger example of matrix multiplication involving 3x3 matrices, highlighting the step-by-step calculation process. ```zh ⎡⎣⎢400281010⎤⎦⎥⋅⎡⎣⎢429204142⎤⎦⎥= ⎡⎣⎢4⋅4+2⋅2+0⋅9 4⋅2+2⋅0+0⋅4 4⋅1+2⋅4+0⋅2⎤⎦⎥ ⎡⎣⎢0⋅4+8⋅2+1⋅9 0⋅2+8⋅0+1⋅4 0⋅1+8⋅4+1⋅2⎤⎦⎥ ⎡⎣⎢4⋅4+1⋅2+0⋅9 4⋅2+1⋅0+0⋅4 4⋅1+1⋅4+0⋅2⎤⎦⎥ = ⎡⎣⎢2025284012344⎤⎦⎥ ``` -------------------------------- ### OpenGL In Practice Tutorials Source: https://learnopengl-cn.github.io/05%20Advanced%20Lighting/03%20Shadows/01%20Shadow%20Mapping Provides practical applications of OpenGL, including debugging, text rendering, and developing a 2D game (Breakout), covering setup, sprite rendering, and level design. ```en https://learnopengl-cn.github.io/06%20In%20Practice/01%20Debugging/ https://learnopengl-cn.github.io/06%20In%20Practice/02%20Text%20Rendering/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/01%20Breakout/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/02%20Setting%20up/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/03%20Rendering%20Sprites/ https://learnopengl-cn.github.io/06%20In%20Practice/2D-Game/04%20Levels/ ``` -------------------------------- ### Project Repository and Support Source: https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle Links to the project's code repository on GitHub and a PayPal link for donations, supporting the continuation of the LearnOpenGL-CN project. ```General GitHub Repository: https://github.com/LearnOpenGL-CN/LearnOpenGL-CN Donation Link: https://www.paypal.me/learnopengl/ ``` -------------------------------- ### Example Usage of glGetError() Source: https://learnopengl-cn.github.io/06%20In%20Practice/01%20Debugging Demonstrates how to call glGetError() after OpenGL operations to check for errors. It shows examples of valid and invalid calls and their expected return values. ```cpp glBindTexture(GL_TEXTURE_2D, tex); std::cout << glGetError() << std::endl; // 返回 0 (无错误) tglTexImage2D(GL_TEXTURE_3D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, data); std::cout << glGetError() << std::endl; // 返回 1280 (非法枚举) glGenTextures(-5, textures); std::cout << glGetError() << std::endl; // 返回 1281 (非法值) std::cout << glGetError() << std::endl; // 返回 0 (无错误) ``` -------------------------------- ### Stencil Test Example Configuration Source: https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/02%20Stencil%20testing An example configuration for the stencil function, setting the test to pass only when the stored stencil value is equal to the reference value of 1. ```c++ glStencilFunc(GL_EQUAL, 1, 0xFF); ``` -------------------------------- ### GLFW Window Handling Hints Source: https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window API documentation for GLFW window hints, detailing options for configuring the OpenGL context and window behavior. ```APIDOC GLFWwindowhint(hint_name, hint_value) - Configures window and OpenGL context properties. - Parameters: - hint_name: An enum value starting with GLFW_ (e.g., GLFW_CONTEXT_VERSION_MAJOR, GLFW_OPENGL_PROFILE). - hint_value: The desired value for the specified hint. - Documentation Reference: [GLFW’s window handling](http://www.glfw.org/docs/latest/window.html#window_hints) Common Hints: - GLFW_CONTEXT_VERSION_MAJOR: Sets the major version of the OpenGL context. - GLFW_CONTEXT_VERSION_MINOR: Sets the minor version of the OpenGL context. - GLFW_OPENGL_PROFILE: Sets the OpenGL profile (e.g., GLFW_OPENGL_CORE_PROFILE, GLFW_OPENGL_COMPAT_PROFILE). - GLFW_OPENGL_FORWARD_COMPAT: Enables forward compatibility (required for macOS). ``` -------------------------------- ### OpenGL Camera and Review Source: https://learnopengl-cn.github.io/01%20Getting%20started/05%20Shaders Covers the implementation of cameras in OpenGL for scene navigation and provides a review of the introductory concepts. ```OpenGL Camera https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ ``` ```OpenGL Review https://learnopengl-cn.github.io/01%20Getting%20started/10%20Review/ ``` -------------------------------- ### Geometry Shader Examples Source: https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/09%20Geometry%20Shader Demonstrates practical applications of geometry shaders, including generating geometric shapes, creating explosion effects, and visualizing surface normals. These examples illustrate the power of geometry shaders in procedural geometry generation and debugging. ```GLSL https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/09%20Geometry%20Shader/#_1 https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/09%20Geometry%20Shader/#_2 https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/09%20Geometry%20Shader/#_3 https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/09%20Geometry%20Shader/#_4 https://learnopengl-cn.github.io/04%20Advanced%20OpenGL/09%20Geometry%20Shader/#_5 ``` -------------------------------- ### Spotlight C++ Implementation Example Source: https://learnopengl-cn.github.io/02%20Lighting/05%20Light%20casters This C++ code snippet demonstrates how to set up and use the soft spotlight effect in an OpenGL application. It involves defining a Light struct with cutoff angles and setting these as uniform variables in the shader. The example links to the full source code for a practical implementation. ```C++ // Example usage (conceptual, actual implementation details may vary) // Assuming 'light' is a struct containing cutoff angles and 'shader' is an OpenGL shader program // Set uniform for inner cutoff angle (e.g., 12.5 degrees) // shader.setFloat("light.cutOff", glm::cos(glm::radians(12.5f))); // Set uniform for outer cutoff angle (e.g., 17.5 degrees) // shader.setFloat("light.outerCutOff", glm::cos(glm::radians(17.5f))); // The GLSL shader code would then use these uniforms as shown in the GLSL snippet. ``` -------------------------------- ### 基本渲染循环 Source: https://learnopengl-cn.github.io/01%20Getting%20started/03%20Hello%20Window 一个简单的渲染循环,用于持续绘制图像并处理用户输入,直到窗口被要求关闭。 ```c++ while(!glfwWindowShouldClose(window)) { glfwSwapBuffers(window); glfwPollEvents(); } ``` -------------------------------- ### Deferred Shading: Lighting Pass Setup Source: https://learnopengl-cn.github.io/05%20Advanced%20Lighting/08%20Deferred%20Shading This C++ code snippet demonstrates the setup for the lighting pass in deferred shading. It clears the screen, binds the lighting shader, activates and binds the G-buffer textures (position, normal, albedo/specular), sends light uniforms, and finally renders a quad to apply the lighting calculations. ```cpp glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); shaderLightingPass.Use(); glActiveTexture(GL_TEXTURE0); bindTexture(GL_TEXTURE_2D, gPosition); glActiveTexture(GL_TEXTURE1); bindTexture(GL_TEXTURE_2D, gNormal); glActiveTexture(GL_TEXTURE2); bindTexture(GL_TEXTURE_2D, gAlbedoSpec); // 同样发送光照相关的uniform SendAllLightUniformsToShader(shaderLightingPass); glUniform3fv(glGetUniformLocation(shaderLightingPass.Program, "viewPos"), 1, &camera.Position[0]); RenderQuad(); ```