mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
vulkan: fix canvas rendering
Sometimes canvas commands wouldn't get executed. This was because when the window gets resized, the command buffers would get recreated, and would thus lose the recorded commands.
This commit is contained in:
@@ -149,8 +149,6 @@ namespace love {
|
||||
this->pixelHeight = pixelheight;
|
||||
|
||||
resetProjection();
|
||||
|
||||
recreateSwapChain();
|
||||
}
|
||||
|
||||
bool Graphics::setMode(void* context, int width, int height, int pixelwidth, int pixelheight, bool windowhasstencil, int msaa) {
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace love {
|
||||
VkPolygonMode currentPolygonMode = VK_POLYGON_MODE_FILL;
|
||||
|
||||
VkFormat currentFramebufferOutputFormat = VK_FORMAT_UNDEFINED;
|
||||
Texture* renderTargetTexture = nullptr;
|
||||
Texture* renderTargetTexture;
|
||||
float currentViewportWidth = 0;
|
||||
float currentViewportHeight = 0;
|
||||
};
|
||||
|
||||
@@ -63,10 +63,10 @@ namespace love {
|
||||
std::vector<uint8> defaultPixels;
|
||||
defaultPixels.reserve(width * height * 4);
|
||||
for (size_t i = 0; i < width * height; i++) {
|
||||
// transparent white
|
||||
defaultPixels.push_back(255);
|
||||
defaultPixels.push_back(255);
|
||||
defaultPixels.push_back(255);
|
||||
// transparent black
|
||||
defaultPixels.push_back(0);
|
||||
defaultPixels.push_back(0);
|
||||
defaultPixels.push_back(0);
|
||||
defaultPixels.push_back(255);
|
||||
}
|
||||
Rect rect = { 0, 0, width, height };
|
||||
|
||||
Reference in New Issue
Block a user