mirror of
https://github.com/aap/librw.git
synced 2025-02-19 18:55:19 +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 h = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1409,8 +1412,12 @@ rasterRenderFast(Raster *raster, int32 x, int32 y)
|
||||
case Raster::CAMERA:
|
||||
setActiveTexture(0);
|
||||
glBindTexture(GL_TEXTURE_2D, natdst->texid);
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y,
|
||||
src->width/dpiScale.x, src->height/dpiScale.y, src->width, src->height);
|
||||
if(dpiScale.x != 1 || dpiScale.y != 1)
|
||||
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]);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user