小编Jak*_*kub的帖子

使用 OpenGL 时 nvoglv64.dll 中的访问冲突

我的代码给了我这个错误:

在program.exe中的0x00007FFCF428A6CF (nvoglv64.dll)处抛出异常:0xC0000005:读取位置0x000001D6B603F000时发生访问冲突。

在 Visual Studio 的调试输出窗口中,我还看到未加载 nvoglv64.dll 文件的 pdb。

因为我已将此代码添加到我的 openGL 应用程序中:

data = stbi_load("src/pickaxe.png", &width, &height, &nrChannels, 0);
if (!data) {
        std::cout << "swords image loaded incorrectly " << std::endl;
    }
    else {
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
        glGenerateMipmap(GL_TEXTURE_2D);
    }
Run Code Online (Sandbox Code Playgroud)

是由于加载图像还是函数 GLTEXIMAGE_2D 引起的?这是我的完整代码:

    #include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"

// global variables
int p_WIDTH = 1280;
int p_HEIGHT = 960;
int succes;
char info[512];
// buffers


// shader sources
const …
Run Code Online (Sandbox Code Playgroud)

c++ opengl libraries opengl-3 stb-image

1
推荐指数
1
解决办法
3174
查看次数

标签 统计

c++ ×1

libraries ×1

opengl ×1

opengl-3 ×1

stb-image ×1