diff options
author | Stephane Marchesin <stephane.marchesin@gmail.com> | 2010-04-21 18:06:48 -0700 |
---|---|---|
committer | Stephane Marchesin <stephane.marchesin@gmail.com> | 2010-04-21 18:06:48 -0700 |
commit | 37c917c57b073e07ab6011a897813760e32d1127 (patch) | |
tree | 3de4f6cbb2daf40fa3e55d532510a83f0a92297f | |
parent | 93b009d92e6c2321e79c612e886584fd4438d64b (diff) |
GL: should work fine on nv30 finally.
-rw-r--r-- | render-gl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/render-gl.c b/render-gl.c index fd3a06c..15f05cc 100644 --- a/render-gl.c +++ b/render-gl.c @@ -210,7 +210,7 @@ void render_page(u32 xscroll, u32 yscroll, u32 h, u32 w) glActiveTexture(GL_TEXTURE2); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, page_coor_texture); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 64, 32, GL_LUMINANCE_ALPHA, + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 128, 32, GL_LUMINANCE, GL_UNSIGNED_SHORT, coors); glActiveTexture(GL_TEXTURE3); @@ -365,7 +365,7 @@ static void init_textures(void) glBindTexture(GL_TEXTURE_2D, page_coor_texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16_ALPHA16, 64, 32, 0, + glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16, 128, 32, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT, 0); glGenTextures(1, &page_colour_texture); @@ -661,7 +661,9 @@ static void init_glsl_programs(void) " coor.y += hoff; \n" " coor = coor.yxxx * local1.xyyy + local0.xyyy; \n" " vec2 tile_coor = floor(coor) / vec2(64.0, 32.0); \n" - " vec4 tile = texture2D(page_coor_texture, tile_coor); \n" + " vec4 tile;\n" + " tile.x = texture2D(page_coor_texture, tile_coor); \n" + " tile.w = texture2D(page_coor_texture, tile_coor + vec2(1.0/128.0, 0.0) ); \n" " vec4 tile_colour = texture2D(page_colour_texture, tile_coor); \n" " vec2 atlas_coor = fract(coor) *local2 + tile.xwww; \n" |