修改OpenGl渲染底层之前
This commit is contained in:
@@ -32,6 +32,18 @@ void BaseNode::Update(float deltaTime)
|
||||
}
|
||||
}
|
||||
|
||||
void BaseNode::PreRender()
|
||||
{
|
||||
// 如果有子节点并含有渲染标签,则渲染子节点
|
||||
RefPtr<BaseNode> child = m_BaseNodes.GetFirst();
|
||||
while (child)
|
||||
{
|
||||
if (child->hasTag(Tag::RENDER))
|
||||
child->PreRender();
|
||||
child = child->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
void BaseNode::Render()
|
||||
{
|
||||
// 如果有子节点并含有渲染标签,则渲染子节点
|
||||
@@ -150,6 +162,11 @@ void BaseNode::RemoveChild(RefPtr<BaseNode> child)
|
||||
m_BaseNodes.Remove(child);
|
||||
}
|
||||
|
||||
void BaseNode::RemoveAllChild()
|
||||
{
|
||||
m_BaseNodes.Clear();
|
||||
}
|
||||
|
||||
void BaseNode::OnAdded(BaseNode *node)
|
||||
{
|
||||
m_Parent = node;
|
||||
@@ -197,6 +214,11 @@ VecFPos BaseNode::GetPos()
|
||||
return this->transform.position;
|
||||
}
|
||||
|
||||
VecFPos BaseNode::GetWorldPos()
|
||||
{
|
||||
return this->transform.position + this->transformIter.position;
|
||||
}
|
||||
|
||||
void BaseNode::SetScale(VecFPos scale)
|
||||
{
|
||||
if (scale == this->transform.scale)
|
||||
@@ -261,6 +283,16 @@ bool BaseNode::GetVisible()
|
||||
return this->Visible;
|
||||
}
|
||||
|
||||
void BaseNode::SetAlpha(float alpha)
|
||||
{
|
||||
this->Alpha = alpha;
|
||||
}
|
||||
|
||||
float BaseNode::GetAlpha()
|
||||
{
|
||||
return this->Alpha;
|
||||
}
|
||||
|
||||
void BaseNode::SetIterationPos(VecFPos pos)
|
||||
{
|
||||
if (pos == this->transformIter.position)
|
||||
|
||||
Reference in New Issue
Block a user