Hi, I have a question. How can I use "PostRender" in c++ for drawing a rectangle like this lua script? I did but, screen is flickering. I think this is must be in PostRender
--This function will be called after the world is rendered, before the screen is refreshed.
--Use this to perform any 2D drawing you want the entity to display.
function Script:PostRender(context)
local window = context:GetWindow()
context:SetBlendMode(Blend.Alpha)
--draw selection rectangle
if ( self.beginSelectPos ~= nil and self.endSelectPos ~= nil ) then
context:SetColor(1,0,0,0.5)
context:DrawRect(self.beginSelectPos.x, self.beginSelectPos.y, self.endSelectPos.x-self.beginSelectPos.x, self.endSelectPos.y-self.beginSelectPos.y)
context:SetColor(0,0,0,0)
end