void vsx_widget_profiler_thread::i_draw()
{
  vsx_vector3<> parentpos = get_pos_p();
  glBegin(GL_QUADS);
    vsx_widget_skin::get_instance()->set_color_gl(1);
    glVertex3f(parentpos.x-size.x*0.5f, parentpos.y+size.y*0.5f,pos.z);
    glVertex3f(parentpos.x+size.x*0.5f, parentpos.y+size.y*0.5f,pos.z);
    glVertex3f(parentpos.x+size.x*0.5f, parentpos.y+-size.y*0.5f,pos.z);
    glVertex3f(parentpos.x-size.x*0.5f, parentpos.y+-size.y*0.5f,pos.z);
  glEnd();
  vsx_widget_skin::get_instance()->set_color_gl(0);
  draw_box_border(vsx_vector3<>(parentpos.x-size.x*0.5,parentpos.y-size.y*0.5f), vsx_vector3<>(size.x,size.y), dragborder);

  glColor4f(1,1,1,1);
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
    glLoadIdentity();

    glTranslatef( 0, parentpos.y + size.y * 0.5, 0.0 );
    profiler->sub_begin("draw vbo bucket");

    draw_bucket.output();
    profiler->sub_end();

    // green timeline
    glColor4f(0,1,0,1);
    glBegin(GL_LINES);
      glVertex2f( - 1000.0, -chunk_height + 0.001);
      glVertex2f(   1000.0, -chunk_height + 0.001);
    glEnd();



  if (selected_chunk != 0x0)
  {
    float depth = -(selected_chunk->depth + 1.0) * chunk_height;

    float cts = (selected_chunk->time_start ) * time_scale::get_instance()->time_scale_x + time_scale::get_instance()->time_offset;
    float cte = (selected_chunk->time_end )   * time_scale::get_instance()->time_scale_x + time_scale::get_instance()->time_offset;

    glColor4f(1, 0.25,0.25,0.95);
    glBegin(GL_LINES);
      glVertex2f( cts, depth);
      glVertex2f( cts, depth - chunk_height );

      glVertex2f( cts, depth - chunk_height );
      glVertex2f( cte, depth - chunk_height );

      glVertex2f( cte, depth - chunk_height );
      glVertex2f( cte, depth );

      glVertex2f( cte, depth );
      glVertex2f( cts, depth);
    glEnd();

  }
  draw_tags();
  glPopMatrix();
  vsx_widget::i_draw();
}
void vsx_widget_profiler_plot::i_draw()
{
  vsx_vector3<> parentpos = get_pos_p();
  glBegin(GL_QUADS);
    vsx_widget_skin::get_instance()->set_color_gl(1);
    glVertex3f(parentpos.x-size.x*0.5f, parentpos.y+size.y*0.5f,pos.z);
    glVertex3f(parentpos.x+size.x*0.5f, parentpos.y+size.y*0.5f,pos.z);
    glVertex3f(parentpos.x+size.x*0.5f, parentpos.y+-size.y*0.5f,pos.z);
    glVertex3f(parentpos.x-size.x*0.5f, parentpos.y+-size.y*0.5f,pos.z);
  glEnd();
  vsx_widget_skin::get_instance()->set_color_gl(0);
  draw_box_border(vsx_vector3<>(parentpos.x-size.x*0.5,parentpos.y-size.y*0.5f), vsx_vector3<>(size.x,size.y), dragborder);

  glColor4f(1,1,1,1);
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
    glLoadIdentity();

    glTranslatef( 0, parentpos.y + size.y * 0.5, 0.0 );
    profiler->sub_begin("draw vbo bucket");

    draw_bucket_a.output();
    draw_bucket_b.output();
    profiler->sub_end();


  glPopMatrix();
  vsx_widget::i_draw();
}
Example #3
0
void vsx_widget_checkbox::i_draw()
{
  recalculate_sizes();
  draw_box_gradient(
        get_pos_p() - vsx_vector3f(size.x * 0.5f, size.y * 0.5f),
        size.x, size.y,
        vsx_widget_skin::get_instance()->get_color(1), vsx_widget_skin::get_instance()->get_color(1),
        vsx_widget_skin::get_instance()->get_color(1), vsx_widget_skin::get_instance()->get_color(1)
        );
}
Example #4
0
vsx_vector3<> vsx_widget_panel::calc_pos() {
  vsx_vector3<> p = get_pos_p();
  if (pos_from_parent) {
    p.x += target_pos.x;
    p.y += target_pos.y;
  }
  p.x -= target_size.x*0.5f;
  p.y -= target_size.y*0.5f;
  if (render_type == render_3d) {
    p.z = pos.z;
  } else {
    p.z = 0.0f;
  }
  return p;
}
void vsx_widget_sequence_editor::i_draw()
{
  parentpos = get_pos_p();
  glBegin(GL_QUADS);
  vsx_widget_skin::get_instance()->set_color_gl(1);
    glVertex3f(parentpos.x-size.x*0.5f, parentpos.y+size.y*0.5f,pos.z);
    glVertex3f(parentpos.x+size.x*0.5f, parentpos.y+size.y*0.5f,pos.z);
    glVertex3f(parentpos.x+size.x*0.5f, parentpos.y+-size.y*0.5f,pos.z);
    glVertex3f(parentpos.x-size.x*0.5f, parentpos.y+-size.y*0.5f,pos.z);
  glEnd();
  vsx_widget_skin::get_instance()->set_color_gl(0);

  draw_box_border(vsx_vector3<>(parentpos.x-size.x*0.5,parentpos.y-size.y*0.5f), vsx_vector3<>(size.x,size.y), dragborder);

  font.color = vsx_color<>(1.0f,1.0f,1.0f,0.7f);
//  font.print(vsx_vector3<>(parentpos.x-size.x*0.5+0.3f,parentpos.y+size.y*0.5f-0.018f), name,0.01);
  font.color = vsx_color<>(1.0f,1.0f,1.0f,1.0f);

  vsx_widget::i_draw();
}
Example #6
0
void vsx_widget_2d_pager::i_draw() {
  if (!visible) return;
  //myf.color = vsx_color(1.0f,1.0f,1.0f,1.0f);
  if (max_pages == 0) cur_page = -1;
	myf.print_center(get_pos_p(), "<< "+i2s(cur_page+1)+" / "+i2s(max_pages)+" >>",size.y*0.6);
}
Example #7
0
void vsx_widget_button::i_draw() {
	//if (type == 0) return;
	if (!visible) return;

	vsx_vector p = get_pos_p();
	if (coord_type == VSX_WIDGET_COORD_CENTER) {
		p.x -= size.x*0.5;
		p.y += size.y*0.5;
		//p.z = 1.1f;
	}
	//printf("p.z %f\n",p.z);
	//if (render_type == VSX_WIDGET_RENDER_2D) {
//      p.z = 0.0f;
//    }
	float font_size_smaller = 1.0f;
	if ((m_focus == this) && (!outside)) {
		font_size_smaller = 0.75f;
		skin_color[0].gl_color();
	}
	else
		skin_color[6].gl_color();

	glBegin(GL_QUADS);
			glVertex3f((p.x+border)*screen_aspect, p.y-size.y+border, p.z);
			glVertex3f((p.x+border)*screen_aspect, p.y-border, p.z);
			glVertex3f((p.x+size.x-border)*screen_aspect, p.y-border, p.z);
			glVertex3f((p.x+size.x-border)*screen_aspect, p.y-size.y+border, p.z);

	if ((m_focus == this) && (!outside))
	skin_color[1].gl_color();
	else
	skin_color[4].gl_color();

			// left
			glVertex3f(p.x, p.y-border, p.z);
			glVertex3f((p.x+border), p.y-border, p.z);
			glVertex3f((p.x+border), p.y-size.y+border, p.z);
			glVertex3f(p.x,p.y-size.y+border, p.z);

			// right
			glVertex3f((p.x+size.x-border), p.y-border, p.z);
			glVertex3f((p.x+size.x), p.y-border, pos.z);
			glVertex3f((p.x+size.x), p.y-size.y+border, p.z);
			glVertex3f((p.x+size.x-border),p.y-size.y+border, p.z);

			glVertex3f(p.x, p.y, p.z);
			glVertex3f((p.x+size.x), p.y, p.z);
			glVertex3f((p.x+size.x), p.y-border, p.z);
			glVertex3f(p.x,p.y-border, p.z);

			glVertex3f(p.x, p.y-size.y+border, p.z);
			glVertex3f((p.x+size.x), p.y-size.y+border, p.z);
			glVertex3f((p.x+size.x), p.y-size.y, p.z);
			glVertex3f(p.x,p.y-size.y, p.z);
	glEnd();
	//glColor3f(1,1,1);
	float dd;
	if ((m_focus == this) && (!outside))
	dd = size.y*0.05;
	else
	dd = 0;

	myf.print_center(vsx_vector((p.x+size.x/2+dd),p.y-size.y+size.y*0.25), title,size.y*0.4f*font_size_smaller);
}
Example #8
0
void vsx_widget_2d_pager::i_draw()
{
  req(visible > 0.0f);
  if (max_page == 0) cur_page = -1;
  font.print_center(get_pos_p(), "<< "+vsx_string_helper::i2s(cur_page+1)+" / "+vsx_string_helper::i2s(max_page)+" >>", size.y*0.6f);
}
Example #9
0
/*******************************************************************************
        _               _
       (_)             | |
  _  _  _            _ | |  ____   ____  _ _ _
 (_)(_)| |          / || | / ___) / _  || | | |
  _  _ | | _______ ( (_| || |    ( ( | || | | |
 (_)(_)|_|(_______) \____||_|     \_||_| \____|
********************************************************************************/
void vsx_widget_base_edit::i_draw() {
  if (!lines.size()) return;

  allow_move_y = allow_move_x = false;
  //base_draw();
  scroll_x = round(scrollbar_pos_x*(longest_line-characters_width));
  if (scroll_x < 0) scroll_x = 0;
  float ff = longest_y - characters_height;
  if (ff < 0) ff = 0;
  scroll_y = round(scrollbar_pos_y*(ff));
  vsx_vector p = get_pos_p();
  p.x -= target_size.x*0.5;
  p.y -= target_size.y*0.5;
  if (render_type == VSX_WIDGET_RENDER_3D) {
    p.z = pos.z;
  } else {
    p.z = 0.0f;
  }
  skin_color[18].gl_color();
  draw_box(p, target_size.x, target_size.y);
  //int ypos = 0;
  p.y += target_size.y-font_size;
  calculate_scroll_size();
  bool run = true;

  int num_visible_found = 0;
  int real_line = 0;
  while (num_visible_found < scroll_y && real_line < (int)(lines.size()-1)) {
    //printf("traversing visible found\n");
    if (lines_visible[real_line] == 0) num_visible_found++;
    real_line++;
  }
  while (lines_visible[real_line] != 0 && real_line < (int)(lines.size()-1)) real_line++;

  int curline = real_line;
  vsx_vector pp = p;
  //std::vector<vsx_string>::iterator it = lines.begin();
  myf.syntax_colors[0] = skin_color[14];
  int cur_render_line = 0;
  if (selected_line_highlight) myf.color = skin_color[14];
  if (scroll_y < lines.size())
  if (curline < (int)lines.size())
  while (run)
  {
    if (lines_visible[curline] == 0)
    {
      //printf("rendering %d\n",curline);
      // save current size for speed in a variable
      long cursize = (long)lines[curline].size();
      //printf("scroll_x: %d\n",scroll_x);
      //printf("curline: %d\n",curline);
      //printf("cursize: %d\n",cursize);
      if (selected_line_highlight && curline == selected_line)
      {
        skin_color[15].gl_color();
        myf.syntax_colors[0] = skin_color[16]; // base color
        draw_box(pp,target_size.x,font_size);
      }
      if (cursize-(long)scroll_x >= (long)characters_width) {
        myf.print(pp,lines[curline].substr((int)scroll_x,(int)characters_width),font_size,lines_p[curline].substr((int)scroll_x,(int)characters_width));
      } else
      if (scroll_x < cursize)
      myf.print(pp,lines[curline].substr((int)scroll_x,(int)(lines[curline].size()-floor(scroll_x))),font_size,lines_p[curline].substr((int)scroll_x,(int)(lines[curline].size()-scroll_x)));

      if (enable_line_action_buttons)
      {
        if (cur_render_line+1 > (int)action_buttons.size())
        {
          vsx_widget* new_action_button = add(new vsx_widget_button,"ab_"+i2s(cur_render_line));
          new_action_button->init();
          new_action_button->set_size( vsx_vector(0.005f, font_size) );
          new_action_button->coord_related_parent = false;
          new_action_button->render_type = this->render_type;
          new_action_button->title = "x";
          new_action_button->commands.adds(4,"","action",i2s(cur_render_line));
          action_buttons.push_back(new_action_button);
        }
        action_buttons[cur_render_line]->set_pos(pp + vsx_vector(target_size.x-0.0025f,font_size*0.5f));
        action_buttons[cur_render_line]->visible = 1.0f;
      }

      pp.y -= font_size;

      if (selected_line_highlight && curline == selected_line)
      {
        myf.syntax_colors[0] = skin_color[14]; // base color
      }
      cur_render_line++;
    }
//    ++it;
    ++curline;
    //printf("%d %d %d %d\n",cur_render_line,(int)(characters_height-1), (int)curline, (lines.size()-1));
    if (cur_render_line > (long)characters_height-1 || (long)curline > (long)lines.size()-1)
    run = false;
  //  if (it == lines.end()) run = false;
  }
  if (k_focus == this && editing_enabled) {
    pp.x = p.x+(float)caretx*font_size*0.37;
    pp.y = p.y-font_size*(float)(carety);
    float tt = (float)((int)(time*3000) % 1000)*0.001;
    if (selected_line_highlight) myf.color = skin_color[17];
    myf.color.a = 1-tt;
    myf.print(pp,"_",font_size);
    myf.color.a = 1;
  }
  myf.color = vsx_color__(1,1,1,1);
}