/*
    Open1560 - An Open Source Re-Implementation of Midtown Madness 1 Beta
    Copyright (C) 2020 Brick

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

class agiCardState;
class agiCardStateStruct;
union agiVtx;
class DLP;

class agiRenderer
{
public:
    // ??0agiRenderer@@QAE@XZ
    ARTS_IMPORT agiRenderer();

protected:
    virtual ~agiRenderer() = default;

public:
    virtual void BeginGroup() = 0;

    virtual void Draw(DLP* arg1, i32 arg2) = 0;

    virtual void DrawCard(Vector3& arg1) = 0;

    virtual void EndGroup() = 0;

    virtual void BeginDraw(i32 arg1) = 0;

    virtual void Verts(agiVtx* arg1, i32 arg2) = 0;

    virtual void Points(agiVtx* arg1, i32 arg2) = 0;

    virtual void DrawTri(i32 arg1, i32 arg2, i32 arg3) = 0;

    virtual void DrawLine(i32 arg1, i32 arg2) = 0;

    virtual void DrawLabel(agiVtx& arg1, char* arg2) = 0;

    virtual void EndDraw() = 0;

    void AddRef()
    {
        ++ref_count_;
    }

    i32 Release()
    {
        const u32 refs = --ref_count_;

        if (refs == 0)
        {
            delete this;
        }

        return refs;
    }

protected:
    i32 light_mask_ {1};
    i32 ref_count_ {1};
};

check_size(agiRenderer, 0xC);

// ?agiCurCardState@@3VagiCardState@@A
ARTS_IMPORT extern agiCardState agiCurCardState;

// ?agiLastCardState@@3UagiCardStateStruct@@A
ARTS_IMPORT extern agiCardStateStruct agiLastCardState;
