Tag Info

Hot answers tagged

63

OpenGL has four different major versions, not counting the versions for mobile devices and embedded systems (OpenGL|ES) and the Web via JavaScript (WebGL). Just like Direct3D 11 has a different way of doing things than Direct3D 8, so does OpenGL 3 have a different way of doing things than OpenGL 1. The big difference is that OpenGL versions are mostly just ...


8

The primary difference is how up-to-date the strategies are. The immediate mode used in the first tutorial: glBegin(GL_QUADS); glColor3f(1, 0, 0); glVertex3f(0, 0, 0); glColor3f(1, 1, 0); glVertex3f(100, 0, 0); glColor3f(1, 0, 1); glVertex3f(100, 100, 0); glColor3f(1, 1, 1); glVertex3f(0, 100, 0); glEnd(); Is outdated and not supported on ...


4

In a "pure" ECS, your entities consist of just a unique ID, which shared among its components. For example you may have these entities: Entity ID 123, it is drawn and moved Entity ID 234, which is only drawn Thus you'll have the following component collections: Drawn components: <123, 234> Moved components: <123> There is no need to filter in ...


4

It's not necessary, in the sense that you can make it work. But your approach is somewhat... awkward. In your approach, the pre-render and post-render work (such as clearing the appropriate render targets, and then presenting the final frame the screen) has to be done before and after getUserInput(): while (game_is_running){ prepareForRender(); ...


2

With a multiplayer >2 game like StarCraft you can do a best out of X to figure out who's lagging. With a 2 player game there is no way to know who's at fault as it's a single connection, its that one connection that is having issue. Again, there is no such thing as player B being disconnected as the one single connection gets broken, both A and B gets ...


1

This is hugely dependent on the type of the game you're creating. For say Chess, the only thing NetworkClient would do is reacting on the move being made and sending that. Some other games might send parts of their state or even the whole state. In general, you might think about splitting the networking part into two smaller components: the transport that ...


1

Lets call everything that happens inside a game an event for the duration of this answer. The events that occur in a game are not "observing" the game model. They happen every x frames. Rendering for instance happens every frame and the view doesn't need to care if the model changed or not since the previous frame. It normally will render every frame. This ...


1

1. component types I am using component bit mask as well and the mask size is only 64 now, maybe too small, but I don't think it would grow to 1000 in any case, that's too much for the types of components. The point of ECS is that you can create unlimited types of "entity" with provided components, so with N types of components you can have a maximum of ...


1

I suppose that you're really asking now, post-edit, how you can use the entity ID's as indices into your component vectors without there being gaps in the component vectors. The simple answer is that you can't. You really want an associative container for your components, like an std::map or std::unordered_map, but barring that, if you insist on storing your ...



Only top voted, non community-wiki answers of a minimum length are eligible