1 #ifndef MSP_GL_DEVICE_BACKEND_H_
2 #define MSP_GL_DEVICE_BACKEND_H_
5 #include <msp/core/noncopyable.h>
6 #include <msp/graphics/glcontext.h>
12 class OpenGLPipelineState;
15 struct OpenGLDeviceState
17 const OpenGLPipelineState *last_pipeline = 0;
18 std::vector<int> bound_tex_targets;
19 std::vector<char> bound_uniform_blocks;
20 unsigned restart_index = 0;
21 unsigned n_clip_distances = 0;
22 const OpenGLBuffer *scratch_buffer = 0;
23 const OpenGLTexture *scratch_texture = 0;
26 class OpenGLDevice: public NonCopyable
29 Graphics::GLContext context;
30 OpenGLDeviceState state;
32 OpenGLDevice(Graphics::Window &, const Graphics::GLOptions &);
34 static Graphics::GLOptions create_default_options();
38 Graphics::GLContext &get_context() { return context; }
41 OpenGLDeviceState &get_state() { return state; }
44 using DeviceBackend = OpenGLDevice;
45 using DeviceOptions = Graphics::GLOptions;