void cBaseWindow::Update( int x, int y, sGUIVertex* VertexBuffer )
{
x += m_x;
y += m_y;
if ( m_permissions.m_isVisible )
{
// render this window
AddToVB( x, y, VertexBuffer );
}
// render the children
int numChildren = m_children.size();
for ( int i = numChildren - 1; i >= 0; i--)
m_children->Update( x, y, VertexBuffer );
}
Polymorphism question
Hello,
I have an unexpected development which has confused me.
In my GUI, I have a class cBaseWindow.
My button class cButton inherits from this. When buttons are made, pointers are stored in the GUI in a parent/child relationship.
To render the button:
This works fine for cButtons. AddToVB() is overridden by cButton in a polymorphic way.
Now, I have another class, cTextButton. This inherits from cButton and has support for text labelling ( as opposed to an icon, which is cIconButton ).
When I now call cBaseWindow::AddToVB(), the cTextButton calls the cButton::AddToVB() version, not the cTextButton::AddToVB()
Why isnt cTextButton::AddToVB() called instead?
Any ideas gratefully received...
Thanks
Simon
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement