Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 May 2012
Online Last Active Today, 01:15 PM

#5184654 LOL - I wrote a poem about OpenGL

Posted by Irlan on 02 October 2014 - 04:20 PM

Good one.

Now, write  one about DirectX 11... Bye, I'll be back next year.

#5184176 Problem with DirectX 11 Vertex Layout

Posted by Irlan on 30 September 2014 - 05:34 PM


NORMAL1 = 16 (POSITION0) + 8 (TEXCOORD0) + 16 (NORMAL0) = 40 


Since you don't need to specify these offsets at all to solve your problem this is pretty tangential to the solution, but I'm with kauna in asking why would NORMAL0 create an offset of 16 and not 12?


Yeah you're right. I need to take a sleep a little. he correct is:


NORMAL0 = 16 (POSITION0) + 8 (TEXCOORD0) = 24
NORMAL1 = 16 (POSITION0) + 8 (TEXCOORD0) + 12 (NORMAL0) = 36

#5156088 Topdown wall collision, not working

Posted by Irlan on 26 May 2014 - 01:50 PM

Search for AABB Collision Detection. The Real Time Collision Detection Book by Christer Ericson goes deep on the subject.

#5148941 Game Engine using SDL 2

Posted by Irlan on 23 April 2014 - 06:43 AM

If you use C++ go with SFML instead.

#5142146 Statistics Books for Games?

Posted by Irlan on 25 March 2014 - 05:28 PM

Just google "best statistics book" and you'll find one smile.png .

#5142144 Entity Component System questions/tips

Posted by Irlan on 25 March 2014 - 05:25 PM

You have to remember the other systems that will be involved in your game like the AI System etc.
The simple case of Actor/Game Object/Component/ class is just a way to generalize the way you organize a Scene/GameWorld.
The book Game Engine Architeture goes in detail about that and if you've not read I recommend you do cool.png . 

#5132075 OpenGL Lighting Issue

Posted by Irlan on 17 February 2014 - 11:51 AM

If you keep editing your original post without noting the changes (which is bad form), it's a bit difficult to help you. Better to post revised code snippets.

Ok. Edit no more.

#5130620 Win32 API and Petzold - still relevant?

Posted by Irlan on 11 February 2014 - 03:08 PM

It is important but not a priority. It takes time to note that a Win32 loop is very very similar to an Engine. The variables sometimes confuses. Like INT_PTR CALLBACK, MSG, etc. The first time I've looked to this I said: what the hell? But it's like a game. It has a space inside the code to handle and dispatch messages/actions/input a update function to refresh data variables and a paint command to render stuff (just a eg.). 

#5129991 glDrawElements Patches Crashing

Posted by Irlan on 08 February 2014 - 08:21 PM

A little bit off-topic but If you are starting to OpenGL, you can follow the right path and try to not put OpenGL code inside the shape class itself. Create some wrapper class that encapsulates the OpenGL Objects and some Renderer that owns them (manages its life/creates/destroy/consult).

Other advice: load the model from a file. Hardcode nothing that can be loaded from stream.



Irlan Robson

#5129680 Advice on Component Based System

Posted by Irlan on 07 February 2014 - 02:14 PM

What are Actor and RigidBody? Are those components?


This means that there is some outside code that knows specifically about a PhysicsSystem, and more importantly that entities with Actor and RigidBody should be added via PhysicsSystem.PushSync.


Instead, I would think this logic would exist in the PhysicsSystem. e.g. systems in general implement a common interface that has methods for adding/removing entities. When it's called, the PhysicsSystem itself knows that it's interested in entities with Actor and Rigid body, and can then add them to some internal list. That way you don't need outside logic that knows about the PhysicsSystem (other than a single line of code that says, "create a PhysicsSystem and add it to the list of systems") and that it depends on Actor & RigidBody.


1. Yes

2. Was just a simple way of saying...

3. I completely agree with you in that case. Now, following your method, becomes:

class Entity {
template <class T> 
T* GetComponent(const std::string& _id)
std::map<std::string, Component*>::iterator it = component.find(_id);
if (it != component.end()) {
return static_cast<T>(it->second);
} else {
return 0;
class PhysicsSystem {
PushComponent(Entity* _entity)
Actor* actor = _entity->GetComponent<Actor*>("Actor");
RigidBody* rbody = _entity->GetComponent<RigidBody*>("RigidBody");

if (rbody && actor)  {
PhysicsSync sync(actor, body);

#5124230 Tips when learning a Graphics API like OGL and DX11?

Posted by Irlan on 16 January 2014 - 03:54 PM

Start with DX not with OpenGL. Read Frank De Luna's book (DX11).

#5119299 How can I gain a deeper understanding of C/C++?

Posted by Irlan on 26 December 2013 - 09:08 AM

I said the More Effective/Effective C++ books because those are the books that every C++ programmer should read. Like the front cover says: the objective of the book is improve your code design and efficiency as well.

#5119297 Best way for a complete beginner to learn Open GL.

Posted by Irlan on 26 December 2013 - 08:57 AM

IMHO: don't lose your time with fixed-function pipeline (I've lost 6 months studying that) because your lines of codes will grow exponentially, and with shaders, you will learn  interesting stuffs at the same time knowing that you are in the right way of learning OpenGL. Also, never hardcode geometry (use OBJ models or something for the job). cool.png  

#5119243 How can I gain a deeper understanding of C/C++?

Posted by Irlan on 25 December 2013 - 08:16 PM

More effective/Effective C++.

#5119200 Best way for a complete beginner to learn Open GL.

Posted by Irlan on 25 December 2013 - 10:05 AM

Use shaders.