Skip to content

Instantly share code, notes, and snippets.

@Andrej123456789
Created December 28, 2021 15:21
Show Gist options
  • Save Andrej123456789/572e28876a5a85aadb110775e6081e26 to your computer and use it in GitHub Desktop.
Save Andrej123456789/572e28876a5a85aadb110775e6081e26 to your computer and use it in GitHub Desktop.
void Draw()
{
if (MousePosition.X < 0) MousePosition.X = 0;
if (MousePosition.X > GlobalRenderer->TargetFramebuffer->Width-1) MousePosition.X = GlobalRenderer->TargetFramebuffer->Width-1;
if (MousePosition.Y < 0) MousePosition.Y = 0;
if (MousePosition.Y > GlobalRenderer->TargetFramebuffer->Height-1) MousePosition.Y = GlobalRenderer->TargetFramebuffer->Height-1;
GlobalRenderer->DrawOverlayMouseCursor(cursor, MousePosition, 0xffffffff);
if (MousePacket[0] & PS2Leftbutton)
{
/*uint32_t colour = GlobalRenderer->Colour;
GlobalRenderer->Colour = 0x0ff00ff0;
GlobalRenderer->PutChar('a', MousePosition.X, MousePosition.Y);
GlobalRenderer->Colour = colour;*/
if (MousePosition.Y >= 1000 && MousePosition.X <= 100)
{
if (StartMenuStuff->status == 1)
{
//clear start menu
}
else
{
StartMenuStuff->DrawStartMenu(30, 0xff00ffff);
StartMenuStuff->status = 1;
}
}
}
if (MousePacket[0] & PS2Middlebutton)
{
/*uint32_t colour = GlobalRenderer->Colour;
GlobalRenderer->Colour = 0xffff0000;
GlobalRenderer->PutChar('a', MousePosition.X, MousePosition.Y);
GlobalRenderer->Colour = colour;*/
/*GlobalRenderer->Print((to_string(MousePosition.Y)));
GlobalRenderer->Print("|");
GlobalRenderer->Print((to_string(MousePosition.X)));
GlobalRenderer->Print(" ");*/
}
if (MousePacket[0] & PS2Rightbutton)
{
/*uint32_t colour = GlobalRenderer->Colour;
GlobalRenderer->Colour = 0x0000ff00;
GlobalRenderer->PutChar('a', MousePosition.X, MousePosition.Y);
GlobalRenderer->Colour = colour;*/
}
MousePacketReady = false;
MousePositionOld = MousePosition;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment