Apparently I'm an idiot because, for the life of me, I cannot figure out how to draw a triangle! Can someone help me out here?

Well let's say I want to do it given the center of the triangle. I'm making a cursor that is going to be used ala Etch-A-Sketch. So no printf's.

What? you mean draw with text? Why the fuck would you do that? Look into the Windows GDI if you are not making a game, if you are making a game I would suggest DirectDraw 7, or, do like I do and use D3D 9 using textured quads for sprite based graphics.

It's not in text. This is actually for a Gameboy Advance. I need to do this from scratch, with no libraries, so that's why I'm scratching my head. It's really easy to draw a square haha.

how do you draw a square? or a line for that matter? the basics of geomtry will allow you to draw a triangle if you can draq a line.

It's very simple to draw a line given a start and endpoint. But how do you construct a triangle with lines? That is, FILL IT IN, not just draw the edges.

/* Method for drawing a rectangle */ void fillRect(u16 row, u16 col, u16 height, u16 width, u16 color) { int r, c; for (r=row; r<row+width; r++) { for (c=col; c < col+height; c++) { videoBuffer[OFFSET(r,c)] = color; } } }//end fillRect

what type of triangle are you expecting to be drawing? if you just want to do equilateral triangles or a constant type of triangle then the calculations can be simpler. do you have a prototype that you want to use for the function? like if it was an equilateral triangle all you would need is something like void fillTriangle(u16 x, u16 y, u16 length) x,y for the center of the triangle on the screen and length would be the length of the sides

Scan it from top to bottom, filling it with horizontal lines. Say you have the triangle (-10,-10),(10,-10),(0,10) and you use each of those coordinates for the endpoint of a line... you are likely using the bressenham line drawing algorithm, so you start at the top most y value and left most x value, draw a horizontal line to the right most x value, you then move down one line, scan back left to find the left most value on that line, then draw a horizontal line to the right most value, repeat that process until you reach the bottom right most pixel that falls within the triangle

I dont know if you figured this out yet or not but I found something relevant in my computer graphics course notes http://www.cs.sunyit.edu/~daviss2/CS450/2007-10-05.pdf look at page 16 and on of the PDF document

You can always use a toolkit to do anything for you but it is nice knowing how it is actually accomplished behind the scenes