DepthBuffer.h 483 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Rect.h>
  8. #include <LibGfx/Size.h>
  9. namespace SoftGPU {
  10. class DepthBuffer final {
  11. public:
  12. DepthBuffer(Gfx::IntSize const&);
  13. ~DepthBuffer();
  14. float* scanline(int y);
  15. void clear(float depth);
  16. void clear(Gfx::IntRect bounds, float depth);
  17. private:
  18. Gfx::IntSize m_size;
  19. float* m_data { nullptr };
  20. };
  21. }