Created
October 18, 2016 20:22
-
-
Save Oipo/637aeae12cbe986a790c8294f9e20e89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vertexData = { | |
x, y, 0.0f, 0.0f, | |
x+w, y, 1.0f, 0.0f, | |
x, y+h, 0.0f, 1.0f, | |
x+y, y+h, 1.0f, 1.0f | |
}; | |
LOG(INFO) << "[sprite] " << x << " " << y << " " << w << " " << h << endl; | |
// example: [sprite] 288 288 32 32 | |
#version 330 core | |
layout (location = 0) in vec2 position; | |
layout (location = 1) in vec2 inTexCoord; | |
uniform mat4 projection; | |
out vec2 texCoord; | |
void main() | |
{ | |
gl_Position = projection * vec4(position.x, position.y, 0.0, 1.0); | |
texCoord = vec2(inTexCoord.x, inTexCoord.y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment