mirror of
https://github.com/leozide/leocad
synced 2025-02-05 08:45:55 +01:00
Use smaller tiles when saving images with MSAA. Fixes #154.
This commit is contained in:
parent
c5a232b8c9
commit
e4b759009f
1 changed files with 3 additions and 6 deletions
|
@ -633,19 +633,16 @@ bool View::BeginRenderToImage(int Width, int Height)
|
|||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &MaxTexture);
|
||||
|
||||
MaxTexture = qMin(MaxTexture, 2048);
|
||||
MaxTexture /= QGLFormat::defaultFormat().samples();
|
||||
|
||||
int TileWidth = qMin(Width, MaxTexture);
|
||||
int TileHeight = qMin(Height, MaxTexture);
|
||||
|
||||
mWidth = TileWidth;
|
||||
mHeight = TileHeight;
|
||||
mRenderImage = QImage(Width, Height, QImage::Format_ARGB32);
|
||||
|
||||
if (Width > TileWidth || Height > TileHeight)
|
||||
mRenderImage = QImage(Width, Height, QImage::Format_ARGB32);
|
||||
else
|
||||
mRenderImage = QImage(TileWidth, TileHeight, QImage::Format_ARGB32);
|
||||
|
||||
mRenderFramebuffer = mContext->CreateRenderFramebuffer(Width, Height);
|
||||
mRenderFramebuffer = mContext->CreateRenderFramebuffer(TileWidth, TileHeight);
|
||||
mContext->BindFramebuffer(mRenderFramebuffer.first);
|
||||
return mRenderFramebuffer.first.IsValid();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue