我的vs2022搭建了OpenGL的运行环境,写了几天代码发现运行不了,原因是 严重性 代码 说明 项目 文件 行 禁止显示状态
错误 C1021 无效的预处理器命令“version” Project5 D:\vs2022\Project5\4.2.texturevs.txt 2
这是我的数组着色器代码:
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec2 aTexCoord;
out vec3 ourColor;
out vec2 TexCoord;
uniform mat4 transform;
uniform mat4 modelMat;
uniform mat4 viewMat;
uniform mat4 projMat;
void main()
{
gl_Position =projMat * viewMat * modelMat * vec4(aPos, 1.0);
ourColor = aColor;
TexCoord = aTexCoord;
}