Changeset 2090


Ignore:
Timestamp:
Nov 19, 2012, 1:45:41 AM (7 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.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2085 r2090  
    106106AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
    107107AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
    108 AC_CHECK_LIB(util, forkpty, UTIL_LIBS="${UTIL_LIBS} -lutil")
     108
     109AC_CHECK_LIB(util, forkpty,
     110 [UTIL_LIBS="${UTIL_LIBS} -lutil"
     111  dnl  Override future forkpty detection
     112  ac_cv_func_forkpty="yes"])
     113AC_CHECK_FUNCS(forkpty)
    109114
    110115dnl Are we on the PS3?
     
    357362
    358363dnl  Can we build neercs?
    359 AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no" -a "${ac_cv_header_glob_h}" = "yes")
     364AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no")
    360365
    361366
  • trunk/tools/neercs/old/attach.c

    r1660 r2090  
    1717#endif
    1818
    19 #if !defined _WIN32
     19#if !defined _WIN32 && defined HAVE_GLOB_H
    2020
    2121#include <errno.h>
  • trunk/tools/neercs/old/effects.c

    r1656 r2090  
    2222#include <string.h>
    2323#include <time.h>
     24#include <endian.h>
    2425#include <sys/wait.h>
    2526#include <sys/types.h>
  • trunk/tools/neercs/old/grab.c

    r1656 r2090  
    1515#endif
    1616
    17 #if !defined _WIN32
     17#if !defined _WIN32 && defined HAVE_GLOB_H
    1818
    1919#define _XOPEN_SOURCE 500       /* getsid() */
  • trunk/tools/neercs/term/pty.cpp

    r2005 r2090  
    1515#endif
    1616
    17 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     17#if defined HAVE_FORKPTY
    1818#   define _XOPEN_SOURCE
    1919#   include <stdlib.h>
     
    5454Pty::~Pty()
    5555{
    56 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     56#if defined HAVE_FORKPTY
    5757    delete[] m_unread_data;
    5858
     
    6666void Pty::Run(char const *command, ivec2 size)
    6767{
    68 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     68#if defined HAVE_FORKPTY
    6969    int fd;
    7070    pid_t pid;
     
    113113size_t Pty::ReadData(char *data, size_t maxlen)
    114114{
    115 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     115#if defined HAVE_FORKPTY
    116116    /* Do we have data from previous call? */
    117117    if (m_unread_len)
     
    173173void Pty::UnreadData(char *data, size_t len)
    174174{
    175 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     175#if defined HAVE_FORKPTY
    176176    char *new_data;
    177177
     
    194194size_t Pty::WriteData(char const *data, size_t len)
    195195{
    196 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     196#if defined HAVE_FORKPTY
    197197    /* FIXME: can we be more naive than that? */
    198198    return write((int)m_fd, data, len);
     
    204204void Pty::SetWindowSize(ivec2 size, int64_t fd /* = -1 */)
    205205{
    206 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
     206#if defined HAVE_FORKPTY
    207207    if (m_size == size)
    208208        return;
  • 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}
  • trunk/tools/neercs/video/text-render.h

    r1627 r2090  
    2121
    2222    TileSet *m_font;
     23
    2324    Shader *m_shader;
    2425    ShaderAttrib m_coord, m_color, m_char;
    25     ShaderUniform m_texture, m_transform;
     26    ShaderUniform m_texture, m_transform, m_pointsize;
    2627    VertexDeclaration *m_vdecl;
    2728    VertexBuffer *m_vbo1, *m_vbo2, *m_vbo3;
     29
    2830    FrameBuffer *m_fbo;
    2931};
  • trunk/tools/neercs/video/text.lolfx

    r1976 r2090  
    1616varying vec2 pass_UV;
    1717
    18 uniform mat4 in_Transform;
     18uniform float u_PointSize;
     19uniform mat4 u_Transform;
    1920
    2021void main()
     
    5758
    5859    // This only works with glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
    59     //gl_PointSize = 40;
     60    gl_PointSize = u_PointSize;
    6061
    61     gl_Position = in_Transform * vec4(in_Position, 0.0, 1.0);
     62    gl_Position = u_Transform * vec4(in_Position, 0.0, 1.0);
    6263}
    6364
     
    7071varying vec2 pass_UV;
    7172
    72 uniform sampler2D in_Texture;
     73uniform sampler2D u_Texture;
    7374
    7475void main(void)
    7576{
    7677    vec2 c = gl_PointCoord * (1.0 / 32.0) + pass_UV;
    77     float t = texture2D(in_Texture, c).x;
     78    float t = texture2D(u_Texture, c).x;
    7879    gl_FragColor = mix(pass_Background, pass_Foreground, t);
    7980}
Note: See TracChangeset for help on using the changeset viewer.