all repos — mgba @ 3f9abf2b05396e7219a7e9a6034c95b74cb0c055

mGBA Game Boy Advance Emulator

SDL: Reserve correct number of bytes for video buffer allocation
Jeffrey Pfau jeffrey@endrift.com
Sun, 08 Mar 2015 22:45:40 -0700
commit

3f9abf2b05396e7219a7e9a6034c95b74cb0c055

parent

9a76ba6b43bbf46ee11800ca885bee45436d9594

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/platform/sdl/gl-sdl.csrc/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);