MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
renderer_backend.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #include <mbgl/util/image.hpp>
5 #include <mbgl/util/size.hpp>
6 #include <mbgl/util/util.hpp>
7 
8 namespace mbgl {
9 namespace gl {
10 
11 using ProcAddress = void (*)();
12 using FramebufferID = uint32_t;
13 
15 public:
17  ~RendererBackend() override;
18 
20  virtual void updateAssumedState() = 0;
21 
22 protected:
23  std::unique_ptr<gfx::Context> createContext() override;
24 
28  virtual ProcAddress getExtensionFunctionPointer(const char*) = 0;
29 
32 
34  static constexpr const FramebufferID ImplicitFramebufferBinding =
36 
40  void assumeViewport(int32_t x, int32_t y, const Size&);
41  void assumeScissorTest(bool);
42 
45 
46 public:
50  void setViewport(int32_t x, int32_t y, const Size&);
51  void setScissorTest(bool);
52 };
53 
54 } // namespace gl
55 } // namespace mbgl
void setFramebufferBinding(FramebufferID fbo)
bool implicitFramebufferBound()
Returns true when assumed framebuffer binding hasn't changed from the implicit binding.
virtual ProcAddress getExtensionFunctionPointer(const char *)=0
void assumeViewport(int32_t x, int32_t y, const Size &)
std::unique_ptr< gfx::Context > createContext() override
void assumeFramebufferBinding(FramebufferID fbo)
RendererBackend(gfx::ContextMode)
PremultipliedImage readFramebuffer(const Size &)
Reads the color pixel data from the currently bound framebuffer.
virtual void updateAssumedState()=0
Called prior to rendering to update the internally assumed OpenGL state.
void setViewport(int32_t x, int32_t y, const Size &)
static constexpr const FramebufferID ImplicitFramebufferBinding
A constant to signal that a framebuffer is bound, but with an unknown ID.
uint32_t FramebufferID
void(*)() ProcAddress
std::enable_if_t< std::is_integral_v< T >, T > max(T a, T b)
Definition: minmax.hpp:11
Definition: actor.hpp:15