Changeset 5f4a155 in git


Ignore:
Timestamp:
14/06/10 05:45:21 (9 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/survex-1_1, svn/tags/1.1.14, svn/tags/1.1.15, svn/tags/1.1.16, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/tags/v1_1_13, svn/trunk, travis-osx
Children:
ecc16fc
Parents:
967723f
Message:

src/fnt.cc: Change back to not using GL_COLOR_INDEX, but with still
being able to set the font texture from a byte array.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@3402 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r967723f r5f4a155  
     1Mon Jun 14 04:44:22 GMT 2010  Olly Betts <olly@survex.com>
     2
     3        * src/fnt.cc: Change back to not using GL_COLOR_INDEX, but with still
     4          being able to set the font texture from a byte array.
     5
    16Mon Jun 14 04:23:22 GMT 2010  Olly Betts <olly@survex.com>
    27
  • src/fnt.cc

    r967723f r5f4a155  
    132132                for (j = 0; j < tex_width; ++j) {
    133133                    if (texbitmap[i * stride + (j >> 3)] & (1 << (j & 7))) {
    134                         teximage[i * tex_width + j] = 1;
     134                        teximage[i * tex_width + j] = 0xff;
    135135                    }
    136136                }
     
    155155    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
    156156    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
    157     static const GLuint map[2] = { 0, 0xffffffff };
    158     glPixelMapuiv(GL_PIXEL_MAP_I_TO_A, 2, map);
    159     glPixelMapuiv(GL_PIXEL_MAP_I_TO_R, 2, map);
    160     glPixelMapuiv(GL_PIXEL_MAP_I_TO_G, 2, map);
    161     glPixelMapuiv(GL_PIXEL_MAP_I_TO_B, 2, map);
    162     glTexImage2D(GL_TEXTURE_2D, 0, 4, tex_width, tex_height, 0 /* Border */,
    163                  GL_COLOR_INDEX, GL_UNSIGNED_BYTE, (GLvoid *)teximage);
     157    glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, tex_width, tex_height, 0 /* Border */,
     158                 GL_ALPHA, GL_UNSIGNED_BYTE, (GLvoid *)teximage);
    164159    delete [] teximage;
    165160
Note: See TracChangeset for help on using the changeset viewer.