   RenderWindow + GBuffer + Events
Hi all,I have a RenderWindow class who is inherited by renderer (D3D11 and OGL4).In each of them they have a GBuffer instance and have an array to get events.What i'm saying in my head is, only one GBuffer is needed and so it can be managed by the render window.Same for the ortho matrix, only one is needed so it can be managed by the render window.Is it a correct design to handle that ? My second question is :Do you have a nice design to handle event ? Actually I have a callback in IGameState and the MainLoop sendseach event stored for the active RenderWindow and the application manage each one. Thanks
What i'm saying in my head is, only one GBuffer is needed and so it can be managed by the render window. Are you implying to GBuffer here as some sort of class, that keeps/manages the GBuffer render targets? If so, I generally don't see any need for this, a gbuffer is nothing more than said render targets, your render architecture determines when they are set/cleared, and the effects pick them as input texture if they need to, at least I('d) design it that way, maybe someone with more experience has an even better idea. Same for the ortho matrix, only one is needed so it can be managed by the render window.Is it a correct design to handle that ? I wouldn't say that there only needs to be one ortho matrix. There can be many needs for more than one: Rendering non-screenspace pre-transformed sprites, shadow mapping, etc... all of whose are going to need a different ortho matrix. I haven't figured a scalable design for this out myself, so I can't give you a hint here, sorry! I'm just thinking that you might be restricting yourself if you have the render window completely handle the ortho matrix. I have my render window in my 3d editor keep its own camera (view+ortho-matrix), but thats about it...