Changeset 1585


Ignore:
Timestamp:
Jul 6, 2012, 1:38:25 AM (8 years ago)
Author:
rez
Message:

added function key and renamed some variables

Location:
trunk/tools/neercs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/neercs.cpp

    r1584 r1585  
    6060    m_time += seconds;
    6161
     62    /* draw something */
    6263    caca_set_color_argb(m_caca, 0xfff, 0x222);
    6364    caca_clear_canvas(m_caca);
     
    8687    caca_put_str(m_caca, 0, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    8788    caca_put_str(m_caca, 0, 1, " !\"#$%&'()*+,-./0123456789");
    88 
    89     if (Input::GetButtonState(27 /*SDLK_ESCAPE*/))
    90         Ticker::Shutdown();
    91 
    9289}
    9390
  • trunk/tools/neercs/video/render.cpp

    r1508 r1585  
    4747 */
    4848
    49 int keys[256];             // keyboard array
    5049int active = true;         // window active flag
    5150bool fullscreen = DEBUG?false:true; // fullscreen flag
    52 bool paused = false;       // pause flag
     51bool m_paused = false;       // pause flag
    5352float nearplane = 0.1f;    // nearplane
    5453float farplane = 1000.0f;  // farplane
     
    108107float value, angle, radius, scale, speed;
    109108/* shader variable */
    110 bool shader_flag = true;
     109bool m_shader = true;      /* TO DELETE */
    111110bool shader_blur_flag = true;
    112111bool shader_glow_flag = true;
     
    222221    glCullFace(GL_BACK);      // don't draw front face
    223222
    224     if (shader_flag)
     223    if (m_shader)
    225224    {
    226225        /* Initialise framebuffer objects */
     
    279278}
    280279
    281 int CreateGLWindow(char const *title)
     280int CreateGLWindow()
    282281{
    283282    screen_size = Video::GetSize();
     
    307306Render::Render(caca_canvas_t *caca)
    308307  : m_caca(caca),
    309     m_ready(false)
     308    m_ready(false),
     309    m_shader(true)
    310310{
    311311    text_render = new TextRender(m_caca, font_size);
     
    319319void Render::TickDraw(float seconds)
    320320{
     321    /* keyboard manager */
     322    if (Input::GetButtonState(27/*SDLK_ESCAPE*/))
     323        Ticker::Shutdown();
     324    if (Input::GetButtonState(8 /*SDLK_BACKSPACE*/))
     325        m_paused=!m_paused;
     326    if (Input::GetButtonState(112 /*SDLK_F1*/))
     327        m_shader=!m_shader;
     328
    321329    Entity::TickDraw(seconds);
    322330
    323331    if (!m_ready)
    324332    {
    325         CreateGLWindow("LOL");
     333        CreateGLWindow();
    326334        text_render->Init();
    327335
     
    330338
    331339    // timer
    332     if(!paused)
     340    if(!m_paused)
    333341        main_angle += seconds * 100.0f * PID;
    334342    if(sync_flag)
     
    382390    text_render->Render();
    383391
    384     if(shader_flag)
     392    if(m_shader)
    385393        fbo_back->Bind();
    386394
     
    454462    glDisable(GL_TEXTURE_2D);
    455463    glDisable(GL_BLEND);
     464    glColor3f(0, 1.0f, 0);
    456465    glVertexPointer(2, GL_INT, 0, corner_vtx);
    457466    glLoadIdentity();
     
    472481void Render::Draw3D()
    473482{
    474     if (!shader_flag)
     483    if (!m_shader)
    475484        return;
    476485
  • trunk/tools/neercs/video/render.h

    r1484 r1585  
    2323    caca_canvas_t *m_caca;
    2424    bool m_ready;
     25    bool m_shader;
    2526};
    2627
  • trunk/tools/neercs/video/text.lolfx

    r1483 r1585  
    2323    float D = float((in_Attr >> 18u) & 0x7u) / 7.0;
    2424
    25         float E = float((in_Attr >> 15u) & 0x7u) / 7.0;
    26         float F = float((in_Attr >> 11u) & 0xfu) / 15.0;
    27         float G = float((in_Attr >> 7u) & 0xfu) / 15.0;
    28         float H = float((in_Attr >> 4u) & 0x7u) / 7.0;
     25    float E = float((in_Attr >> 15u) & 0x7u) / 7.0;
     26    float F = float((in_Attr >> 11u) & 0xfu) / 15.0;
     27    float G = float((in_Attr >> 7u) & 0xfu) / 15.0;
     28    float H = float((in_Attr >> 4u) & 0x7u) / 7.0;
    2929
    3030    pass_Background = vec4(B, C, D, 1.0 - A);
Note: See TracChangeset for help on using the changeset viewer.