first build attempt

This commit is contained in:
2026-04-23 08:05:03 -07:00
parent a75186cab6
commit f68524a6ae
125 changed files with 23271 additions and 463 deletions

27
shaders/text.vert Normal file
View File

@@ -0,0 +1,27 @@
/*
* MIT License
* Author: Mark Allyn
*
* text.vert — vertex shader for FreeType glyph-atlas text rendering.
* Each glyph is a textured quad. Vertices are in window pixels
* (top-left origin); the shader converts to NDC and passes the
* glyph atlas UV coordinates to the fragment shader.
*/
#version 330 core
layout(location = 0) in vec4 aVertex; // xy = screen pos (px), zw = atlas UV
out vec2 vTexCoord;
uniform vec2 u_viewportSize; // (WINDOW_WIDTH, WINDOW_HEIGHT)
void main() {
vec2 pos = aVertex.xy;
vTexCoord = aVertex.zw;
vec2 ndc = vec2(
pos.x / u_viewportSize.x * 2.0 - 1.0,
-pos.y / u_viewportSize.y * 2.0 + 1.0
);
gl_Position = vec4(ndc, 0.0, 1.0);
}