Mercurial > repos > blastem
diff render_sdl.c @ 505:b7b7a1cab44a
The local clone on my laptop got messed up and some changes had not been pushed. This commit represents the status of the working copy from that clone. It unfortunately contains some changes that I did not intend to commit yet, but this seems like the best option at the moment.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 06 Jan 2014 22:54:05 -0800 |
parents | 7fdfcced65b6 |
children | b76d2a628ab9 2e1b3b258523 |
line wrap: on
line diff
--- a/render_sdl.c Thu Oct 31 01:00:32 2013 -0700 +++ b/render_sdl.c Mon Jan 06 22:54:05 2014 -0800 @@ -18,7 +18,7 @@ SDL_Surface *screen; uint8_t render_dbg = 0; uint8_t debug_pal = 0; -uint8_t render_gl; +uint8_t render_gl = 1; uint32_t last_frame = 0; @@ -100,7 +100,7 @@ } #ifndef DISABLE_OPENGL -GLuint textures[3], buffers[2], vshader, fshader, program, un_textures[2], at_pos; +GLuint textures[3], buffers[2], vshader, fshader, program, un_textures[2], un_width, at_pos; GLfloat vertex_data[] = { -1.0f, -1.0f, @@ -196,6 +196,7 @@ } un_textures[0] = glGetUniformLocation(program, "textures[0]"); un_textures[1] = glGetUniformLocation(program, "textures[1]"); + un_width = glGetUniformLocation(program, "width"); at_pos = glGetAttribLocation(program, "pos"); } else { #endif @@ -363,6 +364,8 @@ glBindTexture(GL_TEXTURE_2D, (context->regs[REG_MODE_4] & BIT_INTERLACE) ? textures[1] : textures[2]); glUniform1i(un_textures[1], 1); + glUniform1f(un_width, context->latched_mode & BIT_H40 ? 320.0f : 256.0f); + glBindBuffer(GL_ARRAY_BUFFER, buffers[0]); glVertexAttribPointer(at_pos, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat[2]), (void *)0); glEnableVertexAttribArray(at_pos);