mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Add use of glad to tutorial
This commit is contained in:
parent
bbae72cea2
commit
156cd33c7f
@ -45,6 +45,17 @@ In other words:
|
|||||||
- If you _do_ need to include such headers, do it _before_ including the
|
- If you _do_ need to include such headers, do it _before_ including the
|
||||||
GLFW one and it will detect this
|
GLFW one and it will detect this
|
||||||
|
|
||||||
|
If you are using an [extension loader library](@ref context_glext_auto) to
|
||||||
|
access modern OpenGL then include the header for that library _before_ the GLFW
|
||||||
|
header. This lets it replace the OpenGL header included by GLFW without
|
||||||
|
conflicts. The following example uses [glad](https://github.com/Dav1dde/glad),
|
||||||
|
but the same rule applies to all.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#include <glad/glad.h>
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
@subsection quick_init_term Initializing and terminating GLFW
|
@subsection quick_init_term Initializing and terminating GLFW
|
||||||
|
|
||||||
@ -144,6 +155,15 @@ glfwMakeContextCurrent(window);
|
|||||||
The context will remain current until you make another context current or until
|
The context will remain current until you make another context current or until
|
||||||
the window owning the current context is destroyed.
|
the window owning the current context is destroyed.
|
||||||
|
|
||||||
|
If you are using an [extension loader library](@ref context_glext_auto) to
|
||||||
|
access modern OpenGL then this is when to initialize it. The loader needs the
|
||||||
|
context to be current before it can load from it. The following example uses
|
||||||
|
[glad](https://github.com/Dav1dde/glad), but the same rule applies to all.
|
||||||
|
|
||||||
|
@code
|
||||||
|
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
@subsection quick_window_close Checking the window close flag
|
@subsection quick_window_close Checking the window close flag
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user