mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-11 09:49:05 +00:00
Fix issue with render target in OpenGL when size not specified
This commit is contained in:
parent
ac4c9b7fc4
commit
dade08fd31
1 changed files with 6 additions and 1 deletions
|
@ -2314,11 +2314,16 @@ bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width
|
||||||
|
|
||||||
if(tex->isBloomTexture() && supportBloomEffect())
|
if(tex->isBloomTexture() && supportBloomEffect())
|
||||||
{
|
{
|
||||||
|
// NOTE: No support for mip map level here!
|
||||||
|
|
||||||
uint32 w, h;
|
uint32 w, h;
|
||||||
getWindowSize(w, h);
|
getWindowSize(w, h);
|
||||||
|
|
||||||
getViewport(_OldViewport);
|
getViewport(_OldViewport);
|
||||||
|
|
||||||
|
if (!width) width = tex->getWidth();
|
||||||
|
if (!height) height = tex->getHeight();
|
||||||
|
|
||||||
CViewport newVP;
|
CViewport newVP;
|
||||||
newVP.init(0, 0, ((float)width/(float)w), ((float)height/(float)h));
|
newVP.init(0, 0, ((float)width/(float)w), ((float)height/(float)h));
|
||||||
setupViewport(newVP);
|
setupViewport(newVP);
|
||||||
|
@ -2401,7 +2406,7 @@ bool CDriverGL::copyTargetToTexture (ITexture *tex,
|
||||||
bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height)
|
bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height)
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CDriverGL_getRenderTargetSize)
|
H_AUTO_OGL(CDriverGL_getRenderTargetSize)
|
||||||
NLMISC::CSmartPtr<ITexture> tex = _TextureTarget ? _TextureTarget : (_RenderTargetFBO ? _RenderTargetFBO : NULL);
|
NLMISC::CSmartPtr<ITexture> tex = _RenderTargetFBO ? _RenderTargetFBO : (_TextureTarget ? _TextureTarget : NULL);
|
||||||
if (tex)
|
if (tex)
|
||||||
{
|
{
|
||||||
width = tex->getWidth();
|
width = tex->getWidth();
|
||||||
|
|
Loading…
Reference in a new issue