mirror of
https://github.com/aap/librw.git
synced 2025-02-21 11:45:54 +00:00
Fix missing / hung image on 1.0 dpi
This commit is contained in:
parent
fe9b2c32ee
commit
9629666136
@ -1388,7 +1388,10 @@ static V2d dpiScale(float x, float y)
|
|||||||
int w = 0;
|
int w = 0;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
glfwGetFramebufferSize(glGlobals.window, &w, &h);
|
glfwGetFramebufferSize(glGlobals.window, &w, &h);
|
||||||
v.set(w / x, h / y);
|
if (w && h)
|
||||||
|
v.set(w / x, h / y);
|
||||||
|
else
|
||||||
|
v.set(1,1);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1409,8 +1412,12 @@ rasterRenderFast(Raster *raster, int32 x, int32 y)
|
|||||||
case Raster::CAMERA:
|
case Raster::CAMERA:
|
||||||
setActiveTexture(0);
|
setActiveTexture(0);
|
||||||
glBindTexture(GL_TEXTURE_2D, natdst->texid);
|
glBindTexture(GL_TEXTURE_2D, natdst->texid);
|
||||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y,
|
if(dpiScale.x != 1 || dpiScale.y != 1)
|
||||||
src->width/dpiScale.x, src->height/dpiScale.y, src->width, src->height);
|
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y,
|
||||||
|
src->width/dpiScale.x, src->height/dpiScale.y, src->width, src->height);
|
||||||
|
else
|
||||||
|
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y,
|
||||||
|
0, 0, src->width, src->height);
|
||||||
glBindTexture(GL_TEXTURE_2D, boundTexture[0]);
|
glBindTexture(GL_TEXTURE_2D, boundTexture[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user