]> git.tdb.fi Git - libs/gl.git/commitdiff
Add another constructor to RenderTarget to resolve an ambiguity
authorMikko Rasa <tdb@tdb.fi>
Mon, 25 Jan 2021 01:21:00 +0000 (03:21 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 25 Jan 2021 01:22:26 +0000 (03:22 +0200)
RenderOutput looks like an unsigned more than a RenderTargetFormat so
the compiler would resolve it to the multisample overload.

source/rendertarget.cpp
source/rendertarget.h

index 239180f5e52b9032807a6a9943ecf468e736bc18..ea8bb0c887d0cfc1f4fb85e721851fe375f10d36 100644 (file)
@@ -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);
index 2138d9ce31b202a7a0f896ebf7d0cb6b08d35d6f..7d796a3cefe80540a409f5e6b80a6535aefa87f0 100644 (file)
@@ -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: