Difference between revisions of "Graphics (Chili Framework)"
Line 1: | Line 1: | ||
− | This class take care of all the Direct3D setup bullshit and provides an interface to the graphical output of the application. Use <code>Graphics</code> to draw on the screen, anything you like, even dicks (''especially'' dicks). <code>PutPixel()</code> is generally how this is gone about, although later on more sophisticated dick-drawing routines are created based on <code>PutPixel()</code>. You can also use <code>Graphics::ScreenWidth</code> etc. to make sure you keep your dicks inside the screen boundaries | + | This class take care of all the Direct3D setup bullshit and provides an interface to the graphical output of the application. Use <code>Graphics</code> to draw on the screen, anything you like, even dicks (''especially'' dicks). <code>PutPixel()</code> is generally how this is gone about, although later on more sophisticated dick-drawing routines are created based on <code>PutPixel()</code>. You can also use <code>Graphics::ScreenWidth</code> etc. to make sure you keep your dicks inside the screen boundaries. |
== Members == | == Members == |
Revision as of 12:59, 13 July 2016
This class take care of all the Direct3D setup bullshit and provides an interface to the graphical output of the application. Use Graphics
to draw on the screen, anything you like, even dicks (especially dicks). PutPixel()
is generally how this is gone about, although later on more sophisticated dick-drawing routines are created based on PutPixel()
. You can also use Graphics::ScreenWidth
etc. to make sure you keep your dicks inside the screen boundaries.
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.