Difference between revisions of "Graphics (Chili Framework)"

From Chilipedia
Jump to: navigation, search
(Members)
(Screen Dimensions)
Line 14: Line 14:
 
=== Screen Dimensions ===
 
=== Screen Dimensions ===
  
<code>static constexpr unsigned int Graphics::ScreenWidth = 1280u</code>
+
<code>static constexpr unsigned int Graphics::ScreenWidth = 1280u</code><br />
 +
 
 
<code>static constexpr unsigned int Graphics::ScreenHeight = 720u</code>
 
<code>static constexpr unsigned int Graphics::ScreenHeight = 720u</code>
  
 
These values tell you the maximum size dick you can draw on the screen. Since they are <code>static</code> members, you can access them with, for example, <code>Graphics::ScreenWidth</code> (you can do <code>gfx.ScreenWidth</code> too if you really wanna). Changing the default values from 1280 and 720 to something different gives you a bigger canvas to draw on. Neato.
 
These values tell you the maximum size dick you can draw on the screen. Since they are <code>static</code> members, you can access them with, for example, <code>Graphics::ScreenWidth</code> (you can do <code>gfx.ScreenWidth</code> too if you really wanna). Changing the default values from 1280 and 720 to something different gives you a bigger canvas to draw on. Neato.

Revision as of 11:15, 6 July 2016

Graphics is a class in the Chili Framework that you *spoilers* use to draw to the screen. Since Chili has a big ole chubby for graphics theory, we screw around in this class a lot over the course of the tutorials. "My name is Simon, and I like to do drawrings." - Simon

Members

PutPixel

void Graphics::PutPixel(int x,int y,int r,int g,int b)
void Graphics::PutPixel(int x,int y,Color c)

This little number lets you set the color any pixel on the screen (actually streamer, it sets the pixels in a buffer residing in system memory, which then is copied to a texture in graphics memory and drawn to the backbuffer, which is subsequently presented to a region of the screen corresponding to the client area of the application window YEAH OKAY FUCK OFF NOW), which means you can pretty much create any image you want with this function, even Teletubbie porn.

As you might expect, x and y specify the coordinates on the screen ((0,0) being the top left, (width-1,height-1) being the bottom right), and r, g, and b specify the color (0 being lowest and 255 being highest). If you try and draw outside of the screen space, you might get F'ed in the A. So don't do that.

Screen Dimensions

static constexpr unsigned int Graphics::ScreenWidth = 1280u

static constexpr unsigned int Graphics::ScreenHeight = 720u

These values tell you the maximum size dick you can draw on the screen. Since they are static members, you can access them with, for example, Graphics::ScreenWidth (you can do gfx.ScreenWidth too if you really wanna). Changing the default values from 1280 and 720 to something different gives you a bigger canvas to draw on. Neato.