Exemplo n.º 1
0
void Sprite::drawBox()
{	
	glLineWidth(6);
	if (_pos_state == CORRECT)
		drawBox(Color8u(0,255,0));
	else if (_pos_state == HALF)
		drawBox(Color8u(255,0,0), 3);
}
Exemplo n.º 2
0
Circle::Circle(){
	radius = 0.0f;
	center_x = 0.0f;
	center_y = 0.0f;
	Color8u color = Color8u(0,0,0);
	dataArray = NULL;
}
VerticalLine::VerticalLine(){
	dataArray = NULL;
	y1 = 0;
	y2 = 0;
	x = 0;
	color = Color8u(0,0,0);
}
Exemplo n.º 4
0
void homework2App::generateShapes(){
	ListNode* currentNode;
	Color8u color;
	Shape* s;

	srand(time(NULL));
	color =  Color8u(rand()%255,rand()%255,rand()%255);
	s = new Square(100,100,rand()%100,color);
	headNode_ = new ListNode(s);
	currentNode = headNode_;
	
	for(int iShape=0; iShape<NUM_SHAPES; ++iShape){
		color =  Color8u(255*rand(),255*rand(),255*rand());
		s = new Square(rand()%780,rand()%580,rand()%100+20,color);
		currentNode->addAfter(new ListNode(s));
		currentNode = currentNode->next_;
	}
}
Exemplo n.º 5
0
void RoyalSocietyApp::setup() {
	mySurface_ = new Surface(appWidth, appHeight, false);
	help_ = true;
	helpMenu();
	my_List_ = new List;
	// Creates sentinel_ node
	my_List_->sentinel_ = new Node;
    my_List_->sentinel_->next_ = my_List_->sentinel_;
    my_List_->sentinel_->prev_ = my_List_->sentinel_;
	// Inserts new nodes
	Node* lastNode;
	Rect* r;
	r = new Rect(100, 100, 50, 50, Color8u(255, 0, 0));
	lastNode = my_List_->insertAfter(my_List_->sentinel_, r);
	r = new Rect(100, 100, 50, 50, Color8u(0, 255, 0));
	lastNode = my_List_->insertAfter(lastNode, r);
	r = new Rect(100, 100, 50, 50, Color8u(0, 0, 255));
	lastNode = my_List_->insertAfter(lastNode, r);
}
Exemplo n.º 6
0
ColorT<uint8_t> svgNameToRgb( const char *name, bool *found )
{
	std::string value = boost::to_lower_copy( std::string( name ) );
	int minIdx = 0, maxIdx = sTotalColors - 1;
	while( minIdx <= maxIdx ) {
		int curIdx = ( minIdx + maxIdx ) / 2;
		int cmp = strcmp( value.c_str(), sColorNames[curIdx] );
		if( cmp == 0 ) {
			if( found )
				*found = true;
			return Color8u( sColorValues[curIdx][0], sColorValues[curIdx][1], sColorValues[curIdx][2] );
		}
		else if( cmp < 0 )
			maxIdx = curIdx - 1;
		else
			minIdx = curIdx + 1;
	}
	if( found )
		*found = false;
	return Color8u( 0, 0, 0 );
}
Exemplo n.º 7
0
void Circle::draw(int frameCount)
{
	if(is_hole_)
	{
		gl::color(Color8u(55,55,55));
		gl::drawSolidCircle(pos_, radius_-3);
	}
	else
	{
		//This layer adds the glowing animation to the lights using transparency
		gl::color(ColorA(color_.r, color_.g, color_.b, .25f));
		gl::drawSolidCircle(pos_, radius_-2+sin(frameCount*.1)*2);

		gl::color(ColorA(color_.r, color_.g, color_.b, .5f));
		gl::drawSolidCircle(pos_, radius_*.75);

		gl::color(ColorA(color_.r, color_.g, color_.b, .75f));
		gl::drawSolidCircle(pos_, radius_*.5);

		gl::color(color_);
		gl::drawSolidCircle(pos_, radius_*.25);
	}
}
Exemplo n.º 8
0
Color8u getBodyColor( uint64_t index )
{
    switch ( index ) {
    case 0:
        return Color8u::black();
    case 1:
        return Color8u( 0xFF, 0x00, 0x00 );
    case 2:
        return Color8u( 0x00, 0xFF, 0x00 );
    case 3:
        return Color8u( 0x00, 0x00, 0xFF );
    case 4:
        return Color8u( 0xFF, 0xFF, 0x00 );
    case 5:
        return Color8u( 0x00, 0xFF, 0xFF );
    case 6:
        return Color8u( 0xFF, 0x00, 0xFF );
    default:
        return Color8u::white();
    }
}
Exemplo n.º 9
0
locationMarker::locationMarker(){
	center_ = Vec2f(0,0);
	color_ = Color8u(0,0,0);
	radius_ = 0;
}
Exemplo n.º 10
0
void Shape::draw(){
	gl::color(Color8u(255,215,0));
	gl::drawSolidCircle(center_, radius_);
	gl::color(Color8u(255,0,0));
	gl::drawSolidCircle(center_, radius_-8);
}