SDL: Reserve correct number of bytes for video buffer allocation
Jeffrey Pfau jeffrey@endrift.com
Sun, 08 Mar 2015 22:45:40 -0700
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
src/platform/sdl/gl-sdl.c
→
src/platform/sdl/gl-sdl.c
@@ -59,7 +59,7 @@ SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL);
#endif #endif - renderer->d.outputBuffer = malloc(VIDEO_HORIZONTAL_PIXELS * VIDEO_VERTICAL_PIXELS * 4); + renderer->d.outputBuffer = malloc(VIDEO_HORIZONTAL_PIXELS * VIDEO_VERTICAL_PIXELS * BYTES_PER_PIXEL); renderer->d.outputBufferStride = VIDEO_HORIZONTAL_PIXELS; glGenTextures(1, &renderer->tex); glBindTexture(GL_TEXTURE_2D, renderer->tex);