What does this code mean?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Randi
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 50
Joined: Sat Apr 24, 2010 1:32 pm
Location: Noobville

What does this code mean?

Post by Randi »

SDL_FillRect(buffer, &buffer->clip_rect, 0x666666);

I think it means make a rectagle (the size of the buffer, the positon of the buffer, the color); am I close?
User avatar
lotios611
Chaos Rift Regular
Chaos Rift Regular
Posts: 160
Joined: Sun Jun 14, 2009 12:05 pm
Current Project: Game engine for the PC, PSP, and maybe more.
Favorite Gaming Platforms: Gameboy Micro
Programming Language of Choice: C++

Re: What does this code mean?

Post by lotios611 »

You should really learn to use google. So far, almost everything that you've asked about would be easily answerable using google. To answer your question, it fills in an SDL_Rect with the color that you tell it to. The first argument tells it where to fill in the rectangle. The second argument tells it how big of a rectangle to fill in. The third argument specifies the color to fill the rectangle with. In this case, it is filling the whole buffer with a grayish color.
"Why geeks like computers: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep." - Unknown
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: What does this code mean?

Post by avansc »

Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: What does this code mean?

Post by LeonBlade »

Oh god... PLEASE don't post if you're just going to ask a simple question like this.
Learn to use Google, it is your best friend.
There's no place like ~/
Post Reply