aboutsummaryrefslogtreecommitdiff
path: root/platform/gl/gl.c
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-10 00:28:14 -0400
committeriamcheeseman <[email protected]>2026-05-10 00:28:14 -0400
commit576bd27e11ec70bdbd1b9a644d2e227b57586337 (patch)
tree2dc41e3f88bb95568f73ee372fc35512afcbcf9b /platform/gl/gl.c
parent9ed5698b3c74c7ce1784d3bebe2aa73d5a0c319d (diff)
i ain't splitting alla this up
Diffstat (limited to 'platform/gl/gl.c')
-rw-r--r--platform/gl/gl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/platform/gl/gl.c b/platform/gl/gl.c
index 4072949..b6c3d2a 100644
--- a/platform/gl/gl.c
+++ b/platform/gl/gl.c
@@ -5,9 +5,9 @@
#include <glad/glad.h>
#include <GLFW/glfw3.h>
-#include "common.h"
#include "teensy.h"
-#include "platform.h"
+#include "teensy_common.h"
+#include "teensy_platform.h"
static char vert[] =
"#version 330 core\n"
@@ -75,9 +75,9 @@ void ty_platform_init(struct ty_ctx *ctx)
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
p.win = glfwCreateWindow(
- ctx->creation_hints.win_width,
- ctx->creation_hints.win_height,
- ctx->creation_hints.win_title,
+ ctx->hints.scr_width * 3,
+ ctx->hints.scr_height * 3,
+ ctx->hints.game_title,
NULL,
NULL
);
@@ -102,6 +102,8 @@ void ty_platform_init(struct ty_ctx *ctx)
glGenTextures(1, &p.screen_handle);
glBindTexture(GL_TEXTURE_2D, p.screen_handle);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glGenVertexArrays(1, &p.vao);
glGenBuffers(1, &p.vbo);
@@ -149,6 +151,10 @@ void ty_platform_init(struct ty_ctx *ctx)
void ty_platform_deinit(void)
{
+ glDeleteProgram(p.program);
+ glDeleteBuffers(1, &p.vbo);
+ glDeleteVertexArrays(1, &p.vao);
+ glDeleteTextures(1, &p.screen_handle);
glfwDestroyWindow(p.win);
glfwTerminate();
}