From: Mikko Rasa Date: Mon, 25 Jan 2021 01:21:00 +0000 (+0200) Subject: Add another constructor to RenderTarget to resolve an ambiguity X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0679a0fff9c5541a2dacce12058f5bd20b838280;p=libs%2Fgl.git Add another constructor to RenderTarget to resolve an ambiguity RenderOutput looks like an unsigned more than a RenderTargetFormat so the compiler would resolve it to the multisample overload. --- diff --git a/source/rendertarget.cpp b/source/rendertarget.cpp index 239180f5..ea8bb0c8 100644 --- a/source/rendertarget.cpp +++ b/source/rendertarget.cpp @@ -95,6 +95,11 @@ PixelFormat get_output_pixelformat(unsigned char o) } +RenderTarget::RenderTarget(unsigned w, unsigned h, RenderOutput o) +{ + init(w, h, 0, o); +} + RenderTarget::RenderTarget(unsigned w, unsigned h, const RenderTargetFormat &f) { init(w, h, 0, f); diff --git a/source/rendertarget.h b/source/rendertarget.h index 2138d9ce..7d796a3c 100644 --- a/source/rendertarget.h +++ b/source/rendertarget.h @@ -63,6 +63,7 @@ private: Framebuffer fbo; public: + RenderTarget(unsigned, unsigned, RenderOutput); RenderTarget(unsigned, unsigned, const RenderTargetFormat & = (RENDER_COLOR, RENDER_DEPTH)); RenderTarget(unsigned, unsigned, unsigned, const RenderTargetFormat & = (RENDER_COLOR, RENDER_DEPTH)); private: