Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 27 Nov 2013
Offline Last Active Jun 29 2015 11:58 AM

Posts I've Made

In Topic: Why do you need the .h .cpp AND .lib files?

16 June 2015 - 03:01 AM

Let's explain it low level. You can have all of this in a single cpp file. But if you would do that, you would get a huge file filled with code and not that easy to read and understand. If you split that cpp in headers and .cpp files wouldn't it be  more easy to manage?
Let's say you wrote few math functions and few sorting functions and you use it in your code. If you wanted to use the same functions in another project you have to go there and copy-paste it. But if you put these functions in a header, you can just simply get that .h/hpp file and use all the function. Project management, code reuse and a clean code policy are the most important factors. Among many others.


Thanks, yes I think I understand the use of .h and .cpp for code reause and maintainability...


But I am confused about the actual difference of a .lib and a .cpp file. Since if I make a .h and .cpp file, and I want to include it into another project, I can just add the .h and .cpp file to it (I don't need multiple files, all my projects can link to the same .h and .cpp file), but where does the .lib come into play during all of this?

In Topic: Why do you need the .h .cpp AND .lib files?

16 June 2015 - 02:48 AM

^ Thanks, i (think) i understand some what of that.



but what I am confused is about the fact that it has both the header and cpp files? In your analogy, isint the .h file the phone number and the .cpp file the actual person? I cant understand the difference between a .lib and a .cpp implementation file...

In Topic: DirectXTK Audio not work

13 May 2015 - 08:04 AM

From my DirectXTK experience, the error "abort() has been called", usually means you haven't included this bit of code

m_audEngine.reset(new AudioEngine(eflags));

before working with your AudioEngine object.






edit: didn't read that it was the official sample that wasn't working... odd it works for me.

In Topic: Adding non ECS features in an ECS engine (tilemap)?

09 May 2015 - 06:38 AM

Thanks for the discussion guys, took me a while to get my head around these replies hence the late post...


Your post makes a lot of sense, thanks for taking the time to write that.

"So, question is to which layer(s) do Game::render and RenderSystem::update belong to?"
Game::render() is called from game::run() so yes I guess it is the top level of rendering.

"If "sprite" is your graphic primitive of choice for both ground and entities, then you will have a ground renderer and an entity renderer in the end, the first using a ground representation as input and the latter using game objects as input, and both yielding in sprites as output."

I think this is where I am confused.

I don't fully understand how Game::render works on scene objects (are objects things in game that *Do* stuff eg my player spaceship and enemy ship..?) Is the way I currently have it? Where by it calls m_systemManager.update<RenderSystem>(frameTime) correct..?

"It may iterate all drawables in the scene and invoke their render() method. That render() methods will be the second layer of rendering and perhaps already output the sprite primitives."
Can you give me an example of what you mean by this?

"and RenderSystem::update(time) should not exists as such."

Thanks I have removed that. I understand that the logic updates need a delay time to work out the correct movements, but for some reason thought the renderer did it, but I forgot that the game engine will be kept at my chosen fps, and therefore it will not matter if I pass in the time.


Are you saying basically label nothing as an actual entity, but just use components and systems to do the work? In this case I can't understand how to get the data into systems? Because so far I only understand the method of "for (entityx::Entity entity : entities.entities_with_components(component1,component2,etc))" for actually getting the entity data into systems...

@L. Spiro

I understand what you're saying and agree. If I had read that post before going down this route I would have stuck with how I was doing it, but I have spent months getting this working and now I feel if I turn back it does me more harm than good... either way I have learnt a lot so I feel it was not entirely a waste.

haha thanks

So rather than my old engine where a TILE was essentially a sprite that had a tile.draw() function, I will pass the data to a renderer that has something like drawTile(tile[1][2])? The other thing I am a bit stuck with was in the old approach I would put the tiles where they need to go using tile.setX(), tile.setY(), which updated the underlying spriteData structure which was sent to directXTK to draw. This way, if tiles are plain old data, how do I specify these additional needs, such as tile position X and Y.

Thanks all

In Topic: Adding non ECS features in an ECS engine (tilemap)?

03 May 2015 - 02:35 AM

Why do you need to use ECS to accomplish your goal (a game)?

Why does every class member start with “m_” except the “graphics” class member?  What kind of sloppiness is this?



L. Spiro



I love your posts Spiro. They are always incredibly helpful, but also strike the fear of god into me...


Why do you need to use ECS to accomplish your goal (a game)?


To be honest I am not good enough at C++ to know what I do or do not need... but when I was working with my original OOP game and wanted to start adding in enemies with different guns and shields and all sorts of fancy ideas in my head, posts that I found (not just on gamedev) kept saying ECS this ECS this ECS this so I wanted to see what the fuss is about and give it a go.


Why does every class member start with “m_” except the “graphics” class member?  What kind of sloppiness is this?


Well spotted, I did not even realize that lol.. I do not really want to use the m_ prefix at all. But I found when I was initializing objects in their constructor using initialized lists, I kept getting confused about the private member I was trying to initialize, and the passed in variable or object I was initializing it with... so I say in my head (m_ goes Outside the brackets...)