[Solved] CS2261 Lab1-Drawing Triangles

$25

File Name: CS2261_Lab1-Drawing_Triangles.zip
File Size: 273.18 KB

SKU: [Solved] CS2261 Lab1-Drawing Triangles Category: Tag:
5/5 - (1 vote)

In this lab, you will be completing TODOs to finish writing two functions:

  • void setPixel(int row,int col,unsigned short color)
    • Fills the pixel at the specified row and column with the specified color
  • void drawTriangle(int row,int col)
    • Draws a triangle at the specified row and column

May be any color, either filled in or not (your choice)

May NOT be hardcoded. You may not just call setPixel for every colored-in dot on your triangle. You must use iteration to do so.

After writing the two functions, call the drawTriangle function at least three times in your main function, with different parameters. The output of your program should look something like this(next page):

Your triangles may be any size, shape, color, rotation, or position you want, as long as we can see that you drew three of them. If you want, you can add parameters to the function to control color, size, or shape. After you have completed all the TODOs and your output looks correct, you are finished with the lab after you submit it.

Tips

  • If your code is not compiling, make sure that your Makefile has c as

SOURCES

  • For-loops are really great for drawing lines.
  • The GBA screen size is 240 pixels wide and 160 pixels tall
  • If you add parameters to your drawTriangle function, you must change its prototype

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS2261 Lab1-Drawing Triangles
$25