Reputation
698
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
7 17
Newest
 Yearling
Impact
~40k people reached

  • 0 posts edited
  • 0 helpful flags
  • 60 votes cast
Feb
11
comment How do I implement a LWJGL orthogonal matrix?
You need to implement a matrix class. opengl.org/sdk/docs/man2/xhtml/glOrtho.xml
Dec
13
awarded  Yearling
Dec
1
comment What game development tool can I use on a computer that does not support shaders?
Shader support in OpenGL has been around since about 2004. Get a new computer.
Dec
1
awarded  Notable Question
Nov
30
revised What is GLEW and how does it work?
added 342 characters in body
Nov
30
revised What is GLEW and how does it work?
added 342 characters in body
Nov
30
revised What is GLEW and how does it work?
added 3 characters in body
Nov
30
revised What is GLEW and how does it work?
added 3 characters in body
Nov
30
answered What is GLEW and how does it work?
Sep
30
comment OpenGL 3.3 tilemap rendering techniques?
You aren't going to know how well it works on other hardware regardless of what method you're using. I'd recommend trying out what you had running but draw everything and see how well it performs.
Sep
30
comment OpenGL 3.3 tilemap rendering techniques?
Have you actually tried to implement any of the aforementioned methods yet? It might be useful to know how well they actually perform before coming up with crazy ideas.
Sep
2
awarded  Popular Question
Jul
29
comment How to manage a vector of “Component” base class?
@Marco13 and this would cause memory invalidation when returning references (otherwise, if possible without headaches, (const) references should be preferred). If he did that it would yield extremely messy code. References shouldn't be the only thing referring to an object on the heap.
Jul
29
comment How to manage a vector of “Component” base class?
@Marco13 You need pointers for polymorphism, the smart pointers are likely there simply to alleviate the need for deleteing them in a constructor .
Jul
29
comment How to manage a vector of “Component” base class?
@Marco13 Sorry for the almost-same comment above. I accidentally deleting my original so I wrote a new one.
Jul
29
comment How to manage a vector of “Component” base class?
@Marco13 If you call a function to obtain a component, it's much better to receive a nice reference to it's original instance type without any pointer hassle. I feel like having a function to do both checking for the existence of or returning a specific component type is a bad idea. Throwing an exception is not a bad thing, it will likely crash the program, but I consider that a good, because it means you have a bug in your code. If you're going to do something nonsensical like ask for a component that you have not checked that it even exists yet, what stops you from using a null pointer?
Jul
29
comment How to manage a vector of “Component” base class?
@Marco13 But if you could've find the component, what then? Return a shared_ptr referring to a null pointer? References are much more elegant and don't promote using shared_ptr for the wrong reasons (in this case, there is no need more more than one pointer sounique_ptr should've been used, and you can't return a unique_ptr). The proper solution is the ensure the calling code should check if the component exists before calling the function to get the component. If it's called anyways, throw an exception, which is how the standard library deals with these exact situations.
Jul
29
comment How to manage a vector of “Component” base class?
I recommend researching and learning how to use RTTI. It should make understanding how to use templates for component identification much easier.
Jul
29
comment How to manage a vector of “Component” base class?
Take a look at EntityX's source code for a working example it. I haven't taken a full look at it, but I've tried it before and it uses template types. There are a few ways to do it, but with typeid you could do something like this: template<typename T> hasComponent() { for (auto comp : components) if (typeid(comp)) == typeid(T) return true; return false; } so you could simply do: if (entity_manager.doesEntityHaveComponent<SomeComponent>(id)) { .... }'.
Jul
29
revised How to manage a vector of “Component” base class?
added 160 characters in body