Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on windows platform during runtime! #1

Open
YUZHIGUIYI opened this issue Feb 26, 2023 · 0 comments
Open

Bug on windows platform during runtime! #1

YUZHIGUIYI opened this issue Feb 26, 2023 · 0 comments

Comments

@YUZHIGUIYI
Copy link

YUZHIGUIYI commented Feb 26, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant