Esempio n. 1
0
GuLatex* latex_init(void)
{
  GuLatex* l = g_new0(GuLatex, 1);
  l->compilelog = NULL;
  l->modified_since_compile = FALSE;

  l->tex_version = texlive_init();
  rubber_init();
  latexmk_init();

  /* TODO: Temp hard set of compilation options for migrating configs */
  if (strlen(config_get_value("typesetter")) == 0)
    config_set_value("typesetter", "pdflatex");
  if (strlen(config_get_value("compile_steps")) == 0)
    config_set_value("compile_steps", "texpdf");

  return l;
}
Esempio n. 2
0
/////////////////////////////////////////////////////////
// renderShape
//
/////////////////////////////////////////////////////////
void rubber :: renderShape(GemState *state)
{
  int k, i, j;

  if (GemShape::m_texType && GemShape::m_texNum>=3) {

    if ((xsize  != GemShape::m_texCoords[1].s) ||
        (ysize  != GemShape::m_texCoords[1].t) ||
        (ysize0 != GemShape::m_texCoords[2].t))
      m_alreadyInit = 0;

    if (!m_alreadyInit)  {
      xsize  = GemShape::m_texCoords[1].s;
      ysize0 = GemShape::m_texCoords[2].t;
      ysize  = GemShape::m_texCoords[1].t;

      rubber_init();
      m_alreadyInit = 1;
    }

    k = 0;
    for (i = 0; i < m_grid_sizeX - 1; i++)  {
      for (j = 0; j < m_grid_sizeY - 1; j++){
        glBegin(GL_POLYGON);

        glTexCoord2fv( m_mass[k].t);
        glVertex3f( m_mass[k].x[0]*m_size, m_mass[k].x[1]*m_size, m_mass[k].x[2] );
        glTexCoord2fv( m_mass[k + 1].t );
        glVertex3f( m_mass[k + 1].x[0]*m_size, m_mass[k + 1].x[1]*m_size, m_mass[k + 1].x[2] );
        glTexCoord2fv( m_mass[k + m_grid_sizeY + 1].t );
        glVertex3f( m_mass[k + m_grid_sizeY + 1].x[0]*m_size,
					m_mass[k + m_grid_sizeY + 1].x[1]*m_size,
					m_mass[k + m_grid_sizeY + 1].x[2] );
        glTexCoord2fv( m_mass[k + m_grid_sizeY].t );
        glVertex3f( m_mass[k + m_grid_sizeY].x[0]*m_size,
					m_mass[k + m_grid_sizeY].x[1]*m_size,
					m_mass[k + m_grid_sizeY].x[2] );
        glEnd();
        k++;
      }
      k++;
    }
    rubber_dynamics();
  } else {
    if (!m_alreadyInit) {
      rubber_init();
      m_alreadyInit = 1;
    }

    k = 0;
    for (i = 0; i < m_grid_sizeX - 1; i++)  {
      for (j = 0; j < m_grid_sizeY - 1; j++){
        glBegin(m_drawType);
        glTexCoord2fv( m_mass[k].t );
        glVertex3f( m_mass[k].x[0]*m_size, m_mass[k].x[1]*m_size, m_mass[k].x[2] );
        glTexCoord2fv( m_mass[k + 1].t );
        glVertex3f( m_mass[k + 1].x[0]*m_size, m_mass[k + 1].x[1]*m_size, m_mass[k + 1].x[2] );
        glTexCoord2fv( m_mass[k + m_grid_sizeY + 1].t );
        glVertex3f( m_mass[k + m_grid_sizeY + 1].x[0]*m_size,
					m_mass[k + m_grid_sizeY + 1].x[1]*m_size,
					m_mass[k + m_grid_sizeY + 1].x[2] );
        glTexCoord2fv( m_mass[k + m_grid_sizeY].t );
        glVertex3f( m_mass[k + m_grid_sizeY].x[0]*m_size,
					m_mass[k + m_grid_sizeY].x[1]*m_size,
					m_mass[k + m_grid_sizeY].x[2] );
        glEnd();
        k++;
      }
      k++;
    }
    rubber_dynamics();
    /*      for (k = 0; k < spring_count; k++)
            {
            glBegin(GL_LINES);
            glVertex3fv(mass[spring[k].i].x);
            glVertex3fv(mass[spring[k].j].x);
            glEnd();
            }
            }
    */
  }
}