Ignore:
Timestamp:
Nov 19, 2012, 1:45:41 AM (10 years ago)
Author:
sam
Message:

neercs: added a better check for forkpty(), and moved the GL_POINTS
size and texture logic to the vertex shader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/text-render.cpp

    r2049 r2090  
    5151    m_char = m_shader->GetAttribLocation("in_Char",
    5252                                         VertexUsage::Color, 1);
    53     m_texture = m_shader->GetUniformLocation("in_Texture");
    54     m_transform = m_shader->GetUniformLocation("in_Transform");
     53    m_texture = m_shader->GetUniformLocation("u_Texture");
     54    m_transform = m_shader->GetUniformLocation("u_Transform");
     55    m_pointsize = m_shader->GetUniformLocation("u_PointSize");
    5556    m_vdecl
    5657      = new VertexDeclaration(VertexStream<vec2>(VertexUsage::Position),
     
    129130    glViewport(0, 0, m_fbo_size.x, m_fbo_size.y);
    130131    glDisable(GL_DEPTH_TEST);
     132#if !defined HAVE_GLES_2X
    131133    glEnable(GL_POINT_SPRITE);
    132134    //glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
    133135    glDisable(GL_POINT_SMOOTH);
    134     glPointSize((float)max(m_font_size.x, m_font_size.y));
     136#endif
     137    glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
     138    glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
    135139    m_shader->Bind();
    136140    m_font->Bind();
    137141    m_shader->SetUniform(m_texture, 0);
    138142    m_shader->SetUniform(m_transform, xform);
     143    m_shader->SetUniform(m_pointsize, (float)max(m_font_size.x, m_font_size.y));
    139144    m_vdecl->SetStream(m_vbo1, m_coord);
    140145    m_vdecl->SetStream(m_vbo2, m_color);
     
    145150    m_font->Unbind();
    146151    m_shader->Unbind();
     152#if !defined HAVE_GLES_2X
    147153    glDisable(GL_POINT_SPRITE);
     154#endif
    148155    m_fbo->Unbind();
    149156}
Note: See TracChangeset for help on using the changeset viewer.