When loading the jpg image using SOIL, the image is displayed slanted and the colors are not right (i don't know how to describe it, because it is in color, but it looks black and white)
The intended version
However, it is displayed like this
The shaders are:
vertex shader
#version 330 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 color;
layout (location = 2) in vec2 texCoord;
out vec3 ourColor;
out vec2 TexCoord;
void main(){
gl_Position = vec4(position, 1.0f);
ourColor = color;
TexCoord = texCoord;
}
fragment shader
#version 330 core
in vec3 ourColor;
in vec2 TexCoord;
out vec4 color;
uniform sampler2D ourTexture;
void main(){
color = texture(ourTexture, TexCoord);
}
How to display it correctly, the intended way?