im currently making a gui plot for drawing functions and stuff,
when i move the window around, the view of my plot get distorted due to clipping to rendertargetsize.
This is not what i expect, pls help! Also when the clipping leads to zero pixels within, the whole viewport call fails -> renders to normal screen not within the gui element.
here example project with exe ( dll has only opengl driver, dont know whats happening in D3D )
pls tell me this is not wanted behaviour. Atleast make an if, that does no clipping when rendertarget is the normal screen.
thx
http://benjaminhampe.be.ohost.de/homepa ... GUIPlot.7z
Reign of Error
Code: Select all
// this code was sent in by Oliver Klems, thank you! (I modified the glViewport
// method just a bit.
void COpenGLDriver::setViewPort(const core::rect<s32>& area)
{
if (area == ViewPort)
return;
core::rect<s32> vp = area;
core::rect<s32> rendert(0,0, getCurrentRenderTargetSize().Width, getCurrentRenderTargetSize().Height);
vp.clipAgainst(rendert);
if (vp.getHeight()>0 && vp.getWidth()>0)
{
glViewport(vp.UpperLeftCorner.X,
getCurrentRenderTargetSize().Height - vp.UpperLeftCorner.Y - vp.getHeight(),
vp.getWidth(), vp.getHeight());
ViewPort = vp;
}
}
distorted
complete fail ( window border visible at bottom )