Segfault fix test...

This commit is contained in:
Adrian Hedqvist 2017-09-17 22:31:48 +02:00
parent b9a26bfe5a
commit 53e564ecbe

View file

@ -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);