mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-11 02:53:23 +08:00
Add full source code of the finished (and revised code) Breakout example. Not set up for cross-platform compilation as it has irrKlang and FreeType dependency, but at least source code is available online (and can be referenced from Breakout chapters).
This commit is contained in:
14
src/7.in_practice/3.2d_game/0.full_source/shaders/sprite.vs
Normal file
14
src/7.in_practice/3.2d_game/0.full_source/shaders/sprite.vs
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec4 vertex; // <vec2 position, vec2 texCoords>
|
||||
|
||||
out vec2 TexCoords;
|
||||
|
||||
uniform mat4 model;
|
||||
// note that we're omitting the view matrix; the view never changes so we basically have an identity view matrix and can therefore omit it.
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
TexCoords = vertex.zw;
|
||||
gl_Position = projection * model * vec4(vertex.xy, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user