cs1ime / blacksun-framework

blacksun framework for QEMU/KVM game cheat development
MIT License
220 stars 84 forks source link

绘制实心矩形失败 #7

Closed DouNai996 closed 1 year ago

DouNai996 commented 1 year ago

尝试在DrawAll()绘制主线程中添加一个实心矩形,但是在渲染层并没有成功渲染出来。 麻烦大佬指导一下嘛

void DrawAll()
{
    rendsender *ctx = m_backend->rend();

    ctx->FillRect(0, 0, 100, 100, ImColor(255, 255, 255).Get());  //这里是添加的实心矩形

    DrawPlayers(ctx);
    if (Vars::AimPlayer)
    {
        vec2_t center;
        center.x = m_width / 2;
        center.y = m_height / 2;
        vec3_t spos = {};
        if (w2s(Vars::AimPlayer->aimpart, spos))
        {
            ctx->AddLine(center.x, center.y, spos.x, spos.y, ImColor(255, 255, 255).Get());
        }
    }
    ctx->PresentToTask();
}
cs1ime commented 1 year ago

I only processed the metadata for drawing lines. Just implement the metadata passed from the backend here.

https://github.com/cs1ime/blacksun-framework/blob/189524a2a60c35c2bdf2d6a1b09abd8ffc9f50ec/framework/moonlight-mydrawer/gui.cpp#L144