mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-29 01:03:46 +00:00
[drape] Fixed signed/unsigned comparison warning by changing Resize interface to uint32_t
Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
55dc1e17e6
commit
a28d5d15ce
@@ -11,34 +11,34 @@ public:
|
||||
: dp::metal::MetalBaseContext(metalLayer.device, screenSize, [this]{ return [m_metalLayer nextDrawable]; })
|
||||
, m_metalLayer(metalLayer)
|
||||
{}
|
||||
|
||||
void Resize(int w, int h) override
|
||||
|
||||
void Resize(uint32_t w, uint32_t h) override
|
||||
{
|
||||
m_metalLayer.drawableSize = CGSize{static_cast<float>(w), static_cast<float>(h)};
|
||||
ResetFrameDrawable();
|
||||
dp::metal::MetalBaseContext::Resize(w, h);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
CAMetalLayer * m_metalLayer;
|
||||
};
|
||||
|
||||
|
||||
class UploadMetalContext : public dp::metal::MetalBaseContext
|
||||
{
|
||||
public:
|
||||
explicit UploadMetalContext(id<MTLDevice> device)
|
||||
: dp::metal::MetalBaseContext(device, {}, nullptr)
|
||||
{}
|
||||
|
||||
|
||||
void Present() override {}
|
||||
void MakeCurrent() override {}
|
||||
void Resize(int w, int h) override {}
|
||||
void Resize(uint32_t w, uint32_t h) override {}
|
||||
void SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override {}
|
||||
void Init(dp::ApiVersion apiVersion) override
|
||||
{
|
||||
CHECK_EQUAL(apiVersion, dp::ApiVersion::Metal, ());
|
||||
}
|
||||
|
||||
|
||||
void SetClearColor(dp::Color const & color) override {}
|
||||
void Clear(uint32_t clearBits, uint32_t storeBits) override {}
|
||||
void Flush() override {}
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
void MakeCurrent() override;
|
||||
void Present() override;
|
||||
void SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override;
|
||||
void Resize(int w, int h) override;
|
||||
void Resize(uint32_t w, uint32_t h) override;
|
||||
void SetPresentAvailable(bool available) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -81,7 +81,7 @@ void iosOGLContext::SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer)
|
||||
}
|
||||
}
|
||||
|
||||
void iosOGLContext::Resize(int w, int h)
|
||||
void iosOGLContext::Resize(uint32_t w, uint32_t h)
|
||||
{
|
||||
if (m_needBuffers && m_hasBuffers)
|
||||
{
|
||||
@@ -89,7 +89,7 @@ void iosOGLContext::Resize(int w, int h)
|
||||
GLint height = 0;
|
||||
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width);
|
||||
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height);
|
||||
if (width == w && height == h)
|
||||
if (width == static_cast<GLint>(w) && height == static_cast<GLint>(h))
|
||||
return;
|
||||
|
||||
DestroyBuffers();
|
||||
|
||||
Reference in New Issue
Block a user