What is the purpose of Chili's Framework

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Kot
Posts: 2
Joined: November 13th, 2014, 4:30 am

What is the purpose of Chili's Framework

Post by Kot » November 13th, 2014, 4:46 am

Hello all,

I am new to game development and I just found Chili's videos. I have watched quite a few of the beginner videos and I think it does a very good job making them. Being new to the game development world, I am not really sure what the purpose of the framework is for. It seems that using this framework, a 800x600 window is automatically created for us? I am sure it is possible to create a game without using this framework but I am guessing it would be a lot harder. I just wanted to get more information on Chili's framework and the functionality of it.

I am not sure but has Chili done videos going over his framework and explaining exactly what each file does? For example, what is the purpose of D3DGraphics.cpp, Game.cpp, Keyboard.cpp, Timer.cpp, Windows.cpp? I know that they are implementations for the header files but why are they necessary?

Also, are there other frameworks which are considered standard for developing 2D/3D games in C++?

albinopapa
Posts: 3982
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: What is the purpose of Chili's Framework

Post by albinopapa » November 13th, 2014, 6:00 am

To understand what each of the files are for, you must understand C++ a bit more and what classes are. The chili framework is just a starting point to teach C++ and some game development. It's not designed to be a full featured framework or for full featured games. He does go over some of the framework in later Intermediate lessons, and as far as the keyboard and mouse, he does alter and add to their functionality in even later lesson of the Intermediate series.

There are definitely other frameworks and also other ways of creating games. GameStudio is one such piece software http://www.3dgamestudio.com/. There's also GameMaker Studio https://www.yoyogames.com/studio. These aren't really frameworks per se, but under the hood do the same thing, just more.

A framework is just a piece of software that takes care of the more tedious and complex stuff, that would/could be used for multiple purposes. It's a starting point. This framework sets up a minimal graphics component and input. This base can be added to to make any type of game or interactive graphical program within reason. There's no 3D stuff in it, there isn't any image import routine and the audio (can't remember what release of the framework had audio support ) is buggy. Nonetheless, it allows chili to teach the principals of C/C++ in a graphical environment as opposed to the usual "Hello world" tutorial that most others use in the console.

All in all, it was a lot more useful to some like myself to be taught in this manner. Hope you plan on sticking with the videos.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Kot
Posts: 2
Joined: November 13th, 2014, 4:30 am

Re: What is the purpose of Chili's Framework

Post by Kot » November 14th, 2014, 12:27 am

I think I understand enough of the basics of C++ to try to understand what is going on here. The part I am confused with is Directx, I have no experience with this and I was wondering how exactly the source files in the framework works. For example D3DGraphics.h includes the header file called "d3d9.h" but this file wasn't included in the framework. Is d3d9.h a standard library?

The reason why I am asking this is because I do not want to start developing a game without understanding what the framework does.

Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: What is the purpose of Chili's Framework

Post by Pindrought » November 14th, 2014, 12:55 am

d3d9.h Is in the DirectX SDK that you downloaded. Chili will go over what the framework does, just keep watching the vids. :)
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

User avatar
cyboryxmen
Posts: 180
Joined: November 14th, 2014, 2:03 am

Re: What is the purpose of Chili's Framework

Post by cyboryxmen » November 14th, 2014, 2:35 am

Well nowadays, graphical functions are done by the graphics card in a computer like drawing pixels on the screen and clearing it. However, there are tons of GPUs out there and they all speak in their own "language". To avoid having programmers set up different codes for each and every GPU out there, APIs(Application Programming Interface) are used a a "common language" between graphics cards.

Enter DirectX, an API designed by microsoft to communicate with graphics cards. To use it, you need to include d3d9.h and write some code contained in D3DGraphics.h and windows.h. windows.h also has code made for...well...Windows. It tells Windows to make a new window where your program will run. You will need these two to actually draw stuff on the screen and run your game in Windows.

There are other graphics API out there that other machines use to communicate with graphics cards such as OpenGL and applications like Word uses a slower internal API to do their drawing functions. Since we're programming in Windows, DirectX is fine but you can switch to OpenGL later if you're looking for cross-platforming.
Zekilk

albinopapa
Posts: 3982
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: What is the purpose of Chili's Framework

Post by albinopapa » November 14th, 2014, 4:53 am

Other graphical API's are GDI/GDI+ and WIC, Windows Imaging Component. These are of course Windows specific, not sure what Linux and Mac use. The chili framework is actually more closely related to the 2 I just mentioned and later in the tutorials chili actually uses GDI+.

Windows, pre win7, uses GDI/GDI+. Windows7, 8 use WIC for most of the gui at least from what I can tell from the msdn website. Then there is a subset of DX called Direct2D, which by itself, is just like GDI/GDI+ in that it used for drawing using "pens". GDI/GDI+ can load files and draw to a window as it's canvas. WIC is mostly used for loading images and video and format conversions.

Direct2D uses GDI/GDI+ or WIC to load images and can draw to a window using a handle to the window (HWND), Device Context (DC), directly to a WIC surface (like what we do in the chili framework for the system buffer setup in the last few beginner vids), or directly to a DXGI/D3D10/11 surface, which is kind of how chili has it setup in the original framework.

As a side not on #include. If the file name is enclosed in <> angle brackets, then the file is considered an external dependency from what I can tell. That means, that the file that you are including is included in the compilers settings or project properties somewhere. If the files are enclosed in " " then the file is being included explicitly and is usually in the same folder as your project, though this doesn't necessarily have to be the case. If you wanted to include all headers within a folder you would want to add the folder to your include settings for the project, whereas if you wanted a single file included with your project, you would include it in the header (.h) or source (.cpp) files.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply