From 53e564ecbe0c15c6b506b496071c801ad9c06ed1 Mon Sep 17 00:00:00 2001 From: Adrian Hedqvist Date: Sun, 17 Sep 2017 22:31:48 +0200 Subject: [PATCH] Segfault fix test... --- src/Renderer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 81c3850..7a1c4e8 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -250,6 +250,11 @@ Texture * Renderer::LoadTexture(std::string path) { mode = GL_RGBA; } + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glTexImage2D(GL_TEXTURE_2D, 0, mode, surface->w, surface->h, 0, mode, GL_UNSIGNED_BYTE, surface->pixels); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);