Skip to content

Bug on windows platform during runtime! #1

@YUZHIGUIYI

Description

@YUZHIGUIYI

Hello, Zilize. V-PathTracer won't work on windows platform, because it doesn't initialize OpenGL before using any OpenGL function like glGenTextures.
As V-PathTracer uses glfw and glad, I try to add function initOpenGL() before showInit(), it works, as follows:

void Application::showInit() {
    using namespace nanogui;

    // A new function to initialize OpenGL
    initOpenGL();

    if(image->childCount()) image->removeChild(0);

    mImageTexture = new GLTexture("../cache/init");
    mImageTexture->loadFile("../cache/init.png");
    imageView = new ImageView(image, mImageTexture->texture());

    performLayout();
}

void Application::initOpenGL()
{
    int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
    if (!status)
        throw std::runtime_error("Failed to initialize OpenGL!");
}

Thank you for your project, I have learned a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions