]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/device_backend.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / backends / opengl / device_backend.h
index f3a8e48029b0b807e7484a6a5a9ab4b9c0130298..2583d5822173af93ce0bb92882c72f5e392aa124 100644 (file)
@@ -1,22 +1,45 @@
 #ifndef MSP_GL_DEVICE_BACKEND_H_
 #define MSP_GL_DEVICE_BACKEND_H_
 
+#include <vector>
 #include <msp/core/noncopyable.h>
 #include <msp/graphics/glcontext.h>
 
 namespace Msp {
 namespace GL {
 
+class OpenGLBuffer;
+class OpenGLPipelineState;
+class OpenGLTexture;
+
+struct OpenGLDeviceState
+{
+       const OpenGLPipelineState *last_pipeline = 0;
+       std::vector<int> bound_tex_targets;
+       std::vector<char> bound_storage_textures;
+       std::vector<char> bound_uniform_blocks;
+       unsigned restart_index = 0;
+       unsigned n_clip_distances = 0;
+       const OpenGLBuffer *scratch_buffer = 0;
+       const OpenGLTexture *scratch_texture = 0;
+};
+
 class OpenGLDevice: public NonCopyable
 {
 protected:
        Graphics::GLContext context;
+       OpenGLDeviceState state;
 
        OpenGLDevice(Graphics::Window &, const Graphics::GLOptions &);
 
+       static Graphics::GLOptions create_default_options();
+
        void fill_info();
 
        Graphics::GLContext &get_context() { return context; }
+
+public:
+       OpenGLDeviceState &get_state() { return state; }
 };
 
 using DeviceBackend = OpenGLDevice;