/* * Copyright (c) 2021, Jesse Buhagiar * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace SoftGPU { class Clipper final { public: enum class ClipPlane : u8 { Left = 0, Right, Top, Bottom, Near, Far, User, // Within view space }; Clipper() = default; void clip_points_against_frustum(Vector& vertices); bool clip_line_against_frustum(GPU::Vertex& from, GPU::Vertex& to); void clip_triangle_against_frustum(Vector& input_vecs); void clip_triangle_against_user_defined(Vector& input_verts, Vector& user_planes); private: Vector m_vertex_buffer; }; }