GLFW window does not appear

  c++, direct2d, glfw
HWND graph::createwindow() {
    FreeConsole();
    glfwInit();
    glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
    glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
    glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE);
    GLFWmonitor* monitor = glfwGetPrimaryMonitor();
    const GLFWvidmode* mode = glfwGetVideoMode(monitor);
    glfwWindowHint(GLFW_RED_BITS, mode->redBits);
    glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
    glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
    glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);

    glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);

    window = glfwCreateWindow(mode->width, mode->height, "GLFW", monitor, nullptr);

    return glfwGetWin32Window(window);
}

I am trying to use glfw with direct2d. I wrote this function to create a window and return a hwnd value. When I compile the project, no errors appear. But when i run the exe, i see no window. Can you help me?

Source: Windows Questions C++

LEAVE A COMMENT