Sorry for the delay: here is a solution for your problem:
Replace the BeginMax2D() code block in your code with this:
Replace the BeginMax2D() code block in your code with this:
BeginMax2D() ' MiniB3D function glViewport(0,0,TGlobal.Width,TGlobal.Height) glScissor(0,0,TGlobal.Width,TGlobal.Height)