fesoliveira014 / yanve

0 stars 0 forks source link

Framebuffer #5

Closed fesoliveira014 closed 4 years ago

fesoliveira014 commented 4 years ago

Currently we have an AbstractFramebuffer class that will serve as base to implementing the Framebuffer class. The DefaultFramebuffer is a special framebuffer that represents the default draw context in an application.

fesoliveira014 commented 4 years ago

Mostly done, but needs some testing. Tried to implement a simple depth map, but it is too late and I probably messed it up :)

fesoliveira014 commented 4 years ago

Finally works, problem was in AbstractTexture class constructor. Instead of using glCreateTextures, it called glGenTextures, causing the generated texture ids to not being allocated in the GPU memory before other operations. This is a consequence of using Direct State Access (DSA) in OpenGL, which requires the textures to be allocated prior to calling memory managing modifiers. In non-DSA calls, this is done at the first binding of a texture handle, and is not usually a problem since every modification to the texture requires it to be bound.