diff options
| author | iamcheeseman <[email protected]> | 2026-05-10 00:28:14 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-10 00:28:14 -0400 |
| commit | 576bd27e11ec70bdbd1b9a644d2e227b57586337 (patch) | |
| tree | 2dc41e3f88bb95568f73ee372fc35512afcbcf9b /platform | |
| parent | 9ed5698b3c74c7ce1784d3bebe2aa73d5a0c319d (diff) | |
i ain't splitting alla this up
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/gl/gl.c | 16 | ||||
| -rw-r--r-- | platform/x11/x11.c | 6 |
2 files changed, 14 insertions, 8 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(); } diff --git a/platform/x11/x11.c b/platform/x11/x11.c index c117c47..2dde168 100644 --- a/platform/x11/x11.c +++ b/platform/x11/x11.c @@ -11,9 +11,9 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> -#include "common.h" #include "teensy.h" -#include "platform.h" +#include "teensy_common.h" +#include "teensy_platform.h" #define SEC2NANO ((uint64_t)1000000000) @@ -70,7 +70,7 @@ void ty_platform_init(struct ty_ctx *ctx) p.dis, p.root, 0, 0, - ctx->creation_hints.win_width, ctx->creation_hints.win_height, + ctx->hints.scr_width, ctx->hints.scr_height, 0, DefaultDepth(p.dis, p.scr), CopyFromParent, |
