C++ general questions

Started by
11 comments, last by nfries88 13 years, 3 months ago
Hi all,

few random questions I thought you guys could help me out with.

-What is a game engine? I know people say "game engine" and use the word all the time, but what IS it? Is it the entire game itself? or is it a "logic" applicator? or... can somebody clarify that for me? (no links please :/)

-In your opinions, Visual Studio 2010 or Dev-c++? I heard the latter is in bad shape anymore, but i also hear people still recommending it

-What is the difference in the 'includer's in C++? You know, the '#include"'s at the top of the screen. For instance, i've seen people use all of #include <iostream>, #include <iostream.h>, and even #include "iostream". Whats the difference in those three, besides the obvious formatting of text in front of us?

It's greatly greatly appreciated! Merci beaucoup!
::Get your paw on::
Advertisement

-What is a game engine? I know people say "game engine" and use the word all the time, but what IS it? Is it the entire game itself? or is it a "logic" applicator? or... can somebody clarify that for me? (no links please :/)


It's the part of your game that you strip out to use in your next game. Don't worry about it until you finish a game



-In your opinions, Visual Studio 2010 or Dev-c++? I heard the latter is in bad shape anymore, but i also hear people still recommending it


Dec-c++ is over 10 years old and terrible. Visual Studio is pretty much the industry standard and a really awesome IDE. You can get it free, just google "Visual Studio Express Edition"

-me
thanks mate. also, is Visual Studio compatible with Allegro?
::Get your paw on::
The pre-built allegro binaries at the allegro website are distributed in versions for MSVC 8, 9 and 10.

It's the part of your game that you strip out to use in your next game. Don't worry about it until you finish a game


Totally agree with this (don't worry about making an engine until you finish a game), but let me try to flesh out what an engine in the general sense is. An engine is basically the game agnostic part of your code that takes game data (character models, animations, etc.) and then does the heavy lifting to get it on screen. For example, generally speaking you don't want to write custom code to render every model in your game piece by piece manually, so you write code that can take data for any model generated by an artist in a tool (such as Maya) and then render that. That's the engine part. You then bolt on game specific code to do high level stuff like position the model, react to events, etc., but the actual act of rendering is the same for all models, you configure the engine with the game specific code and let the engine do its thing.

There are many different kinds and components to engines, such as physics engines, animation engines, and particle engines, but they all follow the same basic principle. Code reuse is good, so we write engines to handle common problems and then configure those engines with game specific code and data.

[size=2]What is the difference in the &#39;includer&#39;s in C++? You know, the &#39;#include&quot;&#39;s at the top of the screen. For instance, i&#39;ve seen people use all of #include &lt;iostream&gt;, #include &lt;iostream.h&gt;, and even #include &quot;iostream&quot;. Whats the difference in those three, besides the obvious formatting of text in front of us?<br /> <br /> <br /> <br /> You should use <span style="font-weight:bold;"> #include &lt;iostream&gt; </span>. <span style="font-weight:bold;"> iostream.h </span> is depreciated. And for library files, like <span style="font-weight:bold;"> iostream , cmath … </span> use the angle brackets &lt;library file name&gt;. The angle brackets tells the compiler to look for the file where it keeps all the library files, and if its not there then it checks your project folder to see if you have defined it. And the <span style="font-weight:bold;"> &quot;file name &quot; </span> tells the compiler to check your source folder and if its not there then<br /> check the folder with the library files. Both work, but you should use the angle brackets for the library file name and the quotations for user defined file name.
Edge cases will show your design flaws in your code!
Visit my site
Visit my FaceBook
Visit my github


What is the difference in the &#39;includer&#39;s in C++? You know, the &#39;#include&quot;&#39;s at the top of the screen. For instance, i&#39;ve seen people use all of #include &lt;iostream&gt;, #include &lt;iostream.h&gt;, and even #include &quot;iostream&quot;. Whats the difference in those three, besides the obvious formatting of text in front of us?<br /> <br /> </blockquote><br /> <br /> You should use <span style="font-weight:bold;"> #include &lt;iostream&gt; </span>. <span style="font-weight:bold;"> iostream.h </span> is depreciated. And for library files, like <span style="font-weight:bold;"> iostream , cmath … </span> use the angle brackets &lt;library file name&gt;. The angle brackets tells the compiler to look for the file where it keeps all the library files, and if its not there then it checks your project folder to see if you have defined it. And the <span style="font-weight:bold;"> &quot;file name &quot; </span> tells the compiler to check your source folder and if its not there then<br /> check the folder with the library files. Both work, but you should use the angle brackets for the library file name and the quotations for user defined file name.<br /> <br /> First, the correct word would be &#39;deprecated&#39;. &#39;Depreciated&#39; is something else entirely. Second, it wasn&#39;t deprecated. That is, it was never a part of the C++ standard although it was used. Before the C++ language was standardized. If you see anything other than #include &lt;iostream&gt; there is a good chance the code you are looking at was written for one of those older compilers. Or by someone that doesn&#39;t know what they&#39;re doing <img src='http://public.gamedev.net/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />. The usage of a header file name without an extension in C++ code indicates a header file of the C++ Standard Library. Some C libraries were included in C++, these had names like math.h. To differentiate between the original C header file name and the C++ version the header file was renamed to begin with c and the extension was removed creating, for example, cmath.<br /> <br /> The difference between the usage of angled brackets (&lt; &amp; &gt;) and double quotes (&quot;) with #include should be explained by any decent introductory C++ text but they are basically instructions for the compiler on where/what order to look for the filename given.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!


Dec-c++ is over 10 years old and terrible. Visual Studio is pretty much the industry standard and a really awesome IDE. You can get it free, just google "Visual Studio Express Edition"


If you are a student you can also get Visual Studio 2010 Pro for free at www.dreamspark.com

+1 on Palidine's opinion.
Header files by convention are used to place function and class definitions.
The #include <filename> vs #include "filename" is complex by definition but generally in almost all implementations it means:

#include "<filename>" will search the current directory (and those defined in the project as additional search locations) for the filename specified. Then it grabs the contents of the file, runs it through the preprocessor and then place the contents directly in the current place in the file.

#include <filename> will search the system header directories rather than the project defined ones.

Now in reality what it means is the following (copy and paste from: http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename)

[font=Arial,]

In the C standard (find N1124.PDF), section 6.10.2 paragraphs 2 to 4 state:

2) A preprocessing directive of the form

<h2>#include<h2> <h2>&lt;<h2>h<h2>-<h2>char<h2>-<h2>sequence<h2>&gt;<h2> <h2>new<h2>-<h2>line<br /> <h2>searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the &lt; and &gt; delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.<br /> <br /> <h2>3) A preprocessing directive of the form<br /> <br /> <h2># include &quot;q-char-sequence&quot; new-line<h2><br /> <h2>causes the replacement of that directive by the entire contents of the source file identified by the specified sequence between the &quot; delimiters. The named source file is searched for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read<br /> <br /> <h2># include &lt;h-char-sequence&gt; new-line<h2><br /> <h2>with the identical contained sequence (including &gt; characters, if any) from the original directive.<br /> <br /> <h2>4) A preprocessing directive of the form<br /> <br /> <h2># include pp-tokens new-line<h2><br /> <h2>(that does not match one of the two previous forms) is permitted. The preprocessing tokens after include in the directive are processed just as in normal text. (Each identifier currently defined as a macro name is replaced by its replacement list of preprocessing tokens.) The directive resulting after all replacements shall match one of the two previous forms.145) The method by which a sequence of preprocessing tokens between a &lt; and a &gt; preprocessing token pair or a pair of &quot; characters is combined into a single header name preprocessing token is implementation-defined.<br /> <br /> <h2>h-char: any member of the source character set except the new-line character and &gt;<br /> <br /> <h2>q-char: any member of the source character set except the new-line character and &quot;<br /> <br />


+1 on Palidine's opinion.


They have a button for that now, just so you know! :D

This topic is closed to new replies.

Advertisement