I do know 'c++', well 'c' anyway
learnt it a college along with other languages
html
javascript
pascal
forth
assembly
and a little bit of delphi (i think its called that)
and still have all the workbooks and stuff.
yet i choose to use tgf to make games. Its way quicker and easier and less frustrating.
i mean do you want to spend half of your time trying to figure out why the program you've spent an hour on wont even start. and then find out its ONE spelling mistake in 5000 words?
----------------------
struct object {
int field1,field2;
}
object * obj1 = new object;
object * obj2 = new object;
----------------------
Edited by the Author.
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Isn't "struct from C?
C++ uses classes.
Here's a theoretical class that can be used for sprites.
Class Sprite
{
public:
Sprite(int startX, int startY, int spritetype)
{
X=startX;
Y=startY;
type=spritetype;
}
~Sprite()
{
}
int X;
int Y;
int valA;
int valB;
int valC;
int valD;
//...all other MMF alterable values....
bool flag1;
bool falg2;
//....more flags.....
int Type;
bool Visible;
// sprite image thing getter here(I don't know how to call images in C++)
void Draw(int hotspotX, int hotspotY)
{
if(Visible)
{
//whatever code is used to render a sprite's image
}
}
//all other properties of a sprite object...
}
I need to find a book that actually tells how to program graphics...
structs and classes are almost identical. the only difference is that members of structs are public by default
If you wanna draw graphics, you need an API. There are two main choices: GDI (slow, but doesn't need a graphics card) or DirectX (for games). SDL and Allegro are both wrappers for DirectX, so you need to get either one of them (Or you could just code in DirectX, but... just don't go there)
Edited by the Author.
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Kris: Classes give you functions, and you can also use base classes to make different classes with the same function names but work differently. Where do you think C++ got its OOP from?
It's not like iterating through loads of object instances is hard - use a for loop...
I'm coding in DirectX, and I'm also programming ATL. I might just get a gun and shoot various Windows API programmers.
I read an entire long chapter dedicated to static member functions, and I was left confused. Now I read the short tutorial on static functions, and now I know exactly what they are. Arg! Why can't the books on C++ get to the point?!
html is an internet explorer complatible browser type recognition code, basicly limited to a web page... now i could learn C++ but i won't being as im terribly lazy... mmf is easy, anyone ever hack mmfusion.exe though? it sounds illegal... you can 'edit' it though on one computer, according to the lisence agreement thingy
chris, you can have functions in structs as well. dunno about all that base stuff (I dont bother with it) but i'm sure structs can have them too
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G