summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSoftGPU/DepthBuffer.h
blob: 4fb6f078b5c3868b6505a06a000259e3478553ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGfx/Rect.h>
#include <LibGfx/Size.h>

namespace SoftGPU {

class DepthBuffer final {
public:
    DepthBuffer(Gfx::IntSize const&);
    ~DepthBuffer();

    float* scanline(int y);

    void clear(float depth);
    void clear(Gfx::IntRect bounds, float depth);

private:
    Gfx::IntSize m_size;
    float* m_data { nullptr };
};

}