1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 06:04:59 +00:00
serenity/Userland/Libraries/LibSoftGPU/Buffer
Jelle Raaijmakers 8c9fa50c61 LibSoftGPU: Apply regular cartesian coordinate system
Currently, LibSoftGPU is still OpenGL-minded in that it uses a
coordinate system with the origin of `(0, 0)` at the lower-left of
textures, buffers and window coordinates. Because we are blitting to a
`Gfx::Bitmap` that has the origin at the top-left, we need to flip the
Y-coordinates somewhere in the rasterization logic.

We used to do this during conversion of NDC-coordinates to window
coordinates. This resulted in some incorrect behavior when
rasterization did not pass through the vertex transformation logic,
e.g. when calling `glDrawPixels`.

This changes the coordinate system to OpenGL's throughout, only to blit
the final color buffer upside down to the target bitmap. This fixes
drawing to the depth buffer directly resulting in upside down images.
2022-02-22 23:48:59 +00:00
..
FrameBuffer.h LibSoftGPU: Generalize pixel buffers and standardize on BGRA8888 2022-02-22 23:48:59 +00:00
Typed2DBuffer.h LibSoftGPU: Apply regular cartesian coordinate system 2022-02-22 23:48:59 +00:00
Typed3DBuffer.h LibSoftGPU: Generalize pixel buffers and standardize on BGRA8888 2022-02-22 23:48:59 +00:00