Mercurial > repos > blastem
comparison render_sdl.c @ 502:7fdfcced65b6
Fix allocation and memset size for field buffers when using OpenGL
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 29 Oct 2013 23:13:15 -0700 |
parents | 251fe7a75a14 |
children | b7b7a1cab44a |
comparison
equal
deleted
inserted
replaced
501:e1355aa80f4d | 502:7fdfcced65b6 |
---|---|
157 | 157 |
158 void render_alloc_surfaces(vdp_context * context) | 158 void render_alloc_surfaces(vdp_context * context) |
159 { | 159 { |
160 #ifndef DISABLE_OPENGL | 160 #ifndef DISABLE_OPENGL |
161 if (render_gl) { | 161 if (render_gl) { |
162 context->oddbuf = context->framebuf = malloc(320 * 240 * 4 * 2); | 162 context->oddbuf = context->framebuf = malloc(512 * 256 * 4 * 2); |
163 memset(context->oddbuf, 0, 320 * 240 * 4 * 2); | 163 memset(context->oddbuf, 0, 512 * 256 * 4 * 2); |
164 context->evenbuf = ((char *)context->oddbuf) + 320 * 240 * 4; | 164 context->evenbuf = ((char *)context->oddbuf) + 512 * 256 * 4; |
165 glGenTextures(3, textures); | 165 glGenTextures(3, textures); |
166 for (int i = 0; i < 3; i++) | 166 for (int i = 0; i < 3; i++) |
167 { | 167 { |
168 glBindTexture(GL_TEXTURE_2D, textures[i]); | 168 glBindTexture(GL_TEXTURE_2D, textures[i]); |
169 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 169 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |