diff options
Diffstat (limited to 'platform/gl/gl.c')
| -rw-r--r-- | platform/gl/gl.c | 16 |
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(); } |
