Пример #1
0
void test_reflect()
{
	tKernel::getSinglePtr()->registerClass(GETCLASS(Shape));
	tKernel::getSinglePtr()->registerClass(GETCLASS(Rect));
	tKernel::getSinglePtr()->registerClass(GETCLASS(Square));

	Shape* pRect= (Shape*)tKernel::getSinglePtr()->newNode("Rect","root/","rect");
	pRect->draw();
	Square* pSquare = (Square*)(tKernel::getSinglePtr()->newNode("Square","root/rect/","square"));
	pSquare->draw();
}
Пример #2
0
int main() {
	Square square;
	square.draw();
	square.virtual_draw();
	std::cout << std::endl;

	Shape* triangle = new Triangle();
	triangle->draw();
	triangle->virtual_draw();
	std::cout << std::endl;

	WeirdShape weird;
	weird.virtual_draw();


	system("PAUSE");
	return EXIT_SUCCESS;
}
Пример #3
0
void HW_02App::draw()
{
	gl::clear( Color( 0, 0, 0 ), true );
	
	if((frame_number_ <=1) || mDrawImage){
		mDrawImage = true;
		gl::clear( Color( 0, 0, 0 ), true );
		gl::drawString("Welcome to The Royal Society for Putting Things on Top of Other Things", Vec2f (20,200), Color(0.0f,1.0f,0.0f), *f);				
		gl::drawString("Press '?' to continue...", Vec2f (20,230), Color(0.0f,1.0f,0.0f), *f);			
	
	}
	else{
		Square* cur = mSquare_;		
		if(cur != NULL){
			do {
				cur->draw();
				cur = cur->next_;
			} while (cur != mSquare_);
		}
	}
}