Difference between revisions of "Chili Framework"

From Chilipedia
Jump to: navigation, search
(MainWindow)
(MainWindow)
Line 12: Line 12:
  
 
=== MainWindow ===
 
=== MainWindow ===
Takes care of creating the window and handling the window messages. The message handling involves piping the mouse and keyboard messages to their respective objects. In fact, <code>MainWindow</code> has eaten <code>Keyboard</code> and <code>Mouse</code> alive, and now they live in its belly! So you need to through <code>MainWindow</code> to get your input done, à la <code>wnd.mouse.Read()</code>. You can also use this class to figure out whether the main window is minimized or if it's out of focus, and you can kill the fat bastard with <code>wnd.Kill()</code>.
+
Takes care of creating the window and handling the window messages. The message handling involves piping the mouse and keyboard messages to their respective objects. In fact, <code>MainWindow</code> has eaten <code>Keyboard</code> and <code>Mouse</code> alive, and now they live in its belly. So you need to through <code>MainWindow</code> to get your input done, à la <code>wnd.mouse.Read()</code>. You can also use this class to figure out whether the main window is minimized or if it's out of focus, and you can kill the fat bastard with <code>wnd.Kill()</code>.
  
 
=== Keyboard ===
 
=== Keyboard ===

Revision as of 12:45, 5 July 2016

The Chili Framework is designed as a vehicle to make it fun and easy to learn C++ in a graphical context. It wraps a bunch of pain-in-the-ass WinAPI and Direct3D bullshit giving us direct access to the framebuffer for manipulating screen pixels. This allows us to explore basic graphical concepts at the same time that we are learning the fundamentals of the C++ language. Our research shows that this results in a 69% lower incidence of learners shitting themselves to death out of sheer boredom.

Core Classes

Game

The Game class is where you put the code to make the game do the things. The predefined member functions UpdateModel() and ComposeFrame() are where you put your game logic and your rendering code, respectively. Game is composed of the Graphics object used for drawing and keeps a reference to the MainWindow object to interface with the Windows system (which includes the keyboard and mouse inputs).

Graphics

Main article: Graphics (Chili Framework)

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 (color within the lines kiddies).

MainWindow

Takes care of creating the window and handling the window messages. The message handling involves piping the mouse and keyboard messages to their respective objects. In fact, MainWindow has eaten Keyboard and Mouse alive, and now they live in its belly. So you need to through MainWindow to get your input done, à la wnd.mouse.Read(). You can also use this class to figure out whether the main window is minimized or if it's out of focus, and you can kill the fat bastard with wnd.Kill().

Keyboard

Mouse

Color

Criticisms

Some people resent a proprietary framework being used in the tutorials. Fuck em.