コード例 #1
0
ファイル: drawer.cpp プロジェクト: sujithvg/CGoGN
int Drawer::begin(GLenum mode)
{
	int res = int(m_begins.size());

	if (mode == GL_POINTS)
		m_begins.push_back(PrimParam(uint32(m_dataPos.size()), mode, m_currentSize));
	else
		m_begins.push_back(PrimParam(uint32(m_dataPos.size()), mode, m_currentWidth));

	return res;
}
コード例 #2
0
ファイル: drawer.cpp プロジェクト: untereiner/CGoGN_2
void DisplayListDrawer::begin(GLenum mode)
{
	switch (mode)
	{
	case GL_POINTS:
		if (current_ball_)
		{
			begins_balls_.push_back(PrimParam(data_pos_.size(), mode, current_size_, false));
			current_begin_ = &begins_balls_;
		}
		else if (current_size_ > 2.0f)
		{
			begins_round_point_.push_back(PrimParam(data_pos_.size(), mode, current_size_, current_aa_));
			current_begin_ = &begins_round_point_;
		}
		else
		{
			begins_point_.push_back(PrimParam(data_pos_.size(), mode, current_size_, false));
			current_begin_ = &begins_point_;
		}
		break;
	case GL_LINES:
	case GL_LINE_STRIP:
	case GL_LINE_LOOP:
		if (current_size_ > 1.0f)
		{
			begins_bold_line_.push_back(PrimParam(data_pos_.size(), mode, current_size_, current_aa_));
			current_begin_ = &begins_bold_line_;
		}
		else
		{
			begins_line_.push_back(PrimParam(data_pos_.size(), mode, 1.0f, current_aa_));
			current_begin_ = &begins_line_;
		}
		break;
	default:
		begins_face_.push_back(PrimParam(data_pos_.size(), mode, 1.0f, false));
		current_begin_ = &begins_face_;
		break;
	}
}