Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Error 2 error C2504: 'CComponent' : base class undefined ..\source\core\GameObject.h 11 1 CComponent #ifndef CCOMPONENT #define CCOMPONENT #include "GameObject.h" class GameObject; class CComponent { public: CComponent(); CComponent(GameObject* parent); ~CComponent(); int ID; GameObject* parent; virtual void Init() = 0; virtual void Update() = 0; virtual void Draw() = 0 ; bool enabled; }; #endif GameObject #ifndef GAMEOBJECT #define GAMEOBJECT #include "Leadwerks.h" #include <list> #include "CComponent.h" class CComponent; class GameObject : public CComponent { public: GameObject(); GameObject(GameObject* parent); ~GameObject(); void Init(); void Update(); void Draw(); void RemoveComponent(CComponent* component); void AddComponent(CComponent* component); //holds all the components of that game object list<CComponent*> components; }; #endif
  2. thanks for the help Rick. I got rid of the error in the CComponent class, but the one in GameObject is still there. This is how the GameObject looks now: #include "CComponent.h" class CComponent; class GameObject : public CComponent { @furbolg: This lies at the core for my own component based engine that runs on top of leadwerks. For its design it is important that they know about each other. But I agree that it is smarter to stay away from them.
  3. Onto the next issue. I have two classes that both depend on each other. One of the classes even inherits from the other. I learned that I can use ifndef to prevent multiple including, but I am running into an issue: 'CComponent' : base class undefined I am not sure why it says this since I am uncluding it. Can someone explain to me how this works? GameObject #ifndef GAMEOBJECT #define GAMEOBJECT #include "Leadwerks.h" #include "CComponent.h" using namespace Leadwerks; class GameObject : public CComponent { public: GameObject(); GameObject(GameObject* parent); Component #ifndef CCOMPONENT #define CCOMPONENT #include "GameObject.h" class CComponent { public: CComponent(); CComponent(GameObject* parent);
  4. Yeah I found that weird as well. I thought that filters were just a way to organize your project. The location of the app.c and app.h remained in the same folder.
  5. Ok I got it. I placed the app.h and app.cpp in a filter inside visual studio. I placed them back in the root filter and now it works again. Note that it was just a filter, not an actual folder.
  6. I think this is a welcome feature for the public API.
  7. I am just using the interfaceof 2012. The compiler is still 2010. *edit With 2010,I have the same problem
  8. #include "Leadwerks.h" class Game { public: Game(); ~Game(); void Update(); Leadwerks::Window* window; Leadwerks::Context* context; Leadwerks::World* world; Leadwerks::Camera* cam; };
  9. I checked and both context and world aren't NULL. The game stops at context->Sync(false); If I look at the stack it says the following: > Test.debug.exe!Leadwerks::OpenGL2Camera::DrawOcclusionQueries() Line 333 C++
  10. I am trying to create a new class that encapsulates the default creation of a window, context and world. However as soon as I try to add a camera, the program no longer works. So the app.cpp looks like this: bool App::Start() { game = new Game(); return true; } bool App::Loop() { game->Update(); return true; } The game.cpp looks like this (some code is removed to keep it clean): Game::Game() { //Create a window window = Leadwerks::Window::Create("Test 3"); //Create a context context = Leadwerks::Context::Create(window); //Create a world world = Leadwerks::World::Create(); //Create a camera //cam = Leadwerks::Camera::Create(); } void Game::Update() { Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(false); } The program works, but as soon as I add a camera (removing the comments), the program crashes.
  11. Most of my focus lies on C++. I only want to cover the Lua essentials: object scripts and flowgraph.
  12. I don't think this is exposed in the current api. It would be a cool feature though. Something like: Editor::GetCameraPosition(CameraType::Perspective);
  13. Could you explain why it irritated you? Since it is static I figured it wouldn't really matter whether is was public or private. Ah thanks. I actually had a working sample of this in a school project. I simply forgot the class 'Test::' before the static variable in the cpp. I actually don't have to set it NULL. It works perfect like this as well: Leadwerks::Window* Test::window;
  14. I am having a hard time creating a static pointer to a new window. I have the following: //.h public: static Leadwerks::Window* window; //cpp Leadwerks::Window* window; Test::Test() { //Create a window Test::window = Leadwerks::Window::Create("test"); Is this not possible or am I am forgetting something here?
  15. Thanks, I am still fiddling with getting the best audio quality but some noise still remains in the background. I can remove most of it but my own voice gets kind of distorted. I have another tutorial for Lua planned which covers the flowgraph editor. I am holding back on this one, because I think some key features are missing for it right now. Think about zooming in and organizing your flowgraph Better overview. The first post is now a lot more organised. All the tutorials link to the tutorial page instead of Youtube. I also explained a little bit better how you can find source code and media files.
  16. Congratulations rick. Not only are you an inspiration to us all but you also work for a good cause. One purchase you can be sure of.
  17. See the first post for links. You can go the tutorial section of leadwerks to view code and media per tutorial or download everything via git.
  18. Tutorial #10: Introduction to Lua - Tutorial added to the tutorial section - Git repository updated.
  19. When you have an entity property for an object, and you drag an entity in this slot, it still shows a 'false' icon. Though the entity property works and you can drag an object in to it, it is confusing that it shows this icon. It makes it look like it doesn't work. This is the icon I mean: The video attached shows what I mean. icon.zip
  20. What would a class look like in your idea rick?
  21. okay, so everytime we create a new project we need to build the debug as well the release version ourselves. Got it, thanks.
  22. Tutorial #9: The third person camera controller. The git repository has also been updated.
  23. I am still confused with the use of Lua and the script editor. I have created a new Lua project to test out some Lua scripting. The first thing that I wonder about are the run and debug button. There is no C++ code involved, so why are they both looking for an executable while I am building a Lua project?
  24. I agree with this feature. @Pancakes: What he means is when you ctrl+C and ctrl+V, you copy an object. however this new object has an offset to the original object. When you want to copy paste more objects next to each other, you always have to make sure that you align everything correctly again.
  25. Thanks, The git repository has been updated.
×
×
  • Create New...