summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-05 10:12:55 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-05 10:12:55 -0500
commitdd3887ec47137b6bf993674356a73b3266bb8a51 (patch)
treec9981783a6574b58dd9f503384b2fe651495b224 /main.c
parent1e7e392b9d5e593aeb9680d82b76afddad8ce2e6 (diff)
got text working with modern OpenGL
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/main.c b/main.c
index 92d6b23..7ef1447 100644
--- a/main.c
+++ b/main.c
@@ -305,13 +305,10 @@ int main(int argc, char **argv) {
glViewport(0, 0, w, h);
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- for (int i = 0; i < 200; ++i) {
- gl_geometry_rect(rect(V2(0, 4*(float)i), V2(100, 100)), 0xffffffff >> i);
-
- gl_geometry_draw();
- }
- text_render(font, "hello", 5, 5);
+ text_render(font, "Hello how are you?", 5, 5, 0xff00aaff);
SDL_GL_SwapWindow(window);
}