|
| 10 Apr 2012 01:43 PM |
Well not really an engine, its actually a library in C++. I'm building it on top of Allegro. I got the main stuff down, like opening a window, putting text on the screen, making shapes and putting it on the screen. I'm planning on adding a sprite loader next. When I'm done with that I'm probably gonna release it as a beta. But I have a problem, its not a major problem but its really been bugging me. Say you have a main.cpp, someotherfile.h, someotherfile.cpp. So to access the functions in the file of someotherfile.cpp, you gotta make an object and use that object to access the functions. The problem is that you have to do that in main.cpp but I don't want the user to type out such a weird thing. Hope that's clear but if it's not here's an example. #include iostream using namespace std; class something() { public: void somefunction() { cout << "Hey there" << endl; } }; int main() { something some; some.somefunction(); // I dont wanna do it in this file, is there } // anywhere else where I can put this besides // this file Thanks in advance |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 01:57 PM |
| why would someone use a game engine from someone clearly new to C++ |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Apr 2012 02:04 PM |
| You're using class as library? qq |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 02:37 PM |
I just made this class to show you what I meant. And I'm using classes for my library, through a OOP approach. Trappingnoobs, I'd like to see you do better. And I bet you're just trying to troll and have no idea what I'm talking about. Why don't you just leave the forum because you're obviously not helping anyone |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 10 Apr 2012 02:47 PM |
| I'm also learning C++ to, so this may not be accurate, but maybe you can try and put the class in the header file and include the header file?? |
|
|
| Report Abuse |
|
|
| |
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 10 Apr 2012 02:58 PM |
| omg yeah, i like namespaces better. but i dont understand why anyone wud use a header file and not a namespace. <_> |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 03:04 PM |
"And I bet you're just trying to troll and have no idea what I'm talking about."
correct and incorrect
actually no not really.
If you don't know the basic of C++ don't distribute game engines you make because they'll probably be inefficient and laggy, and some fool might download it and think it's great and then when it starts messing up, think it's his/her fault. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 04:33 PM |
| trappingnoobs, ok I didn't distribute it yet because its not done. And why do you keep saying I don't even know the basics of how to use C++. I've been using it for 9 months and am at the advanced topics. I know how to use classes, pointers, address operators, arrow member selection operator, templates, polymorphism, and other things. Also if you don't know the basics of C++, you wouldn't even know how to get started on making a game library. Also when you said "when it starts messing up", what starts messing up? The compiler? Nothing would mess up, its on a pre-built library so why would anything mess up? |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 04:51 PM |
| Since when are pointers and classes even remotely considered advanced C++? |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:17 PM |
| I'm trying so hard not to laugh at you. I mean seriously do you even hear what you are saying? Without pointers and classes, there would be no games made in C++. I mean you don't hear of a person beginning C++ learning about pointers or classes. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:17 PM |
| Ergo they're a basic of C++. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:18 PM |
| classes are the first step in learning OOP. they ARE needed. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:22 PM |
"Without pointers and classes, there would be no games made in C++"
And he tries asserting I'm stupid.
1- I was asserting they're a basic essential of C++, rather than 'advanced' 2- It's more than possible to create a game without pointers or classes. It's been done. A lot. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:24 PM |
| trapping is correct. pointers and classes are just the basic fundementels of OOP in C++. besides ive seen trapping program C#, he is good, too bad he doesnt anymore. :f |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:26 PM |
"too bad he doesnt anymore."
wiltedchameleon.wordpress
thanks btw ("he is good") but how have you seen me programming in it? O.o |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:29 PM |
| Well, I have seen your YouTube channel and watched a few of your videos. It doesn't directly show you coding, but it does show what you have coded. So I guess I haven't seen you coding, but I have seen your code. And you explained it, so it's not like you copied it. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:31 PM |
I do livestream once in a while too :P
Btw if you go on my blog, the bottom post is the relevant one. I'm posting more C# stuff soon hopefully :D |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:46 PM |
| Ok both you guys make a point but still trappingnoobs you keep acting like I don't know a thing about this stuff. I don't go around saying that you don't know anything about programming so you shouldn't either unless you know for a fact that I don't know anything about something. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 05:50 PM |
I do know:
1- Lack of decent terminology in the question, making it almost impossible to understand what the problem is 2- I'm guessing the problem is something to do with you not understanding how to use a header file correctly, meaning no you don't know the basics. If not, I apologise (depending on what the problem actually is) and ask you to elaborate. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 06:00 PM |
Sigh.. that's why I put an example. Whatever, I'll just rewrite the .h file and just use the functions. P.S No offence but if I didn't know the basics, I wouldn't be able to make a game library, now would I. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 06:06 PM |
"I wouldn't be able to make a game library"
Wrapping OpenGL isn't hard. I did it with the LWJGL (Practically bare-bones OpenGL port) on my first day of learning Java. ;) |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 06:43 PM |
| I'm not wrapping opengl though.. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 06:44 PM |
So you've just done a 2D physics engine?
That's even easier, unless it supports rotating bodies and stuff like that.
If not, then I'm guessing it's just a bare-bones state management system, in which case that's not even worth mentioning
If not please tell specifically what it is |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 08:05 PM |
| You know what just forget it, I came to the forum to ask a simple question and now you're making me just answer all these miscellaneous questions that I don't care about so just forget it. |
|
|
| Report Abuse |
|
|