Winter091 / Peanut

OpenGL/Dx11 C++ Game Engine
MIT License
0 stars 0 forks source link

Refactor abstractions around render context #37

Open Winter091 opened 2 years ago

Winter091 commented 2 years ago

Now RenderContext encapsulate dx11 device, dx11 device context and swapchain. Because of that, you're forced to query those interfaces every time you want to do something renderwise. And in case of binding framebuffers, you're forced to have code inside RenderContext, because the code has to have an ability to set default framebuffer, and default framebuffer is swapchain, and swapchain is contained inside RenderContext.

The idea to make stuff better is to move dx11 related code to RenderContext class, that way we won't be having to query dx11 device context in many parts of engine.

If we do that, RenderCommand class will be a thin wrapper above RenderContext, and possibly won't even be needed