The 2024 Wheel Reinvention Jam is in 16 days. September 23-29, 2024. More info

GLAD without glfw

Hey!

im wondering if i can do this without using glfwGetProcAddress? :

since im not using glfw library to create a window i don't have access to glfwGetProcAddress.

Can i initialize GLAD in some other way?

1
2
3
4
5
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
{
    std::cout << "Failed to initialize GLAD" << std::endl;
    return -1;
}    



why can't use wglGetProcAddress instead?

1
2
3
4
5
if (!gladLoadGLLoader((GLADloadproc)wglGetProcAddress))
{
    std::cout << "Failed to initialize GLAD" << std::endl;
    return -1;
}    



cheers

Edited by C_Worm on
So why can't you? What does not work when you do it that way?