X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Fdevice_backend.h;h=491f1b3173a3aefc3a4da3d07b0123a7c69d64e6;hp=dfa16653167d979d40279026fb743c57a0f75a3b;hb=a6d84d93ce8c0adde41679a6c6852335e19ada17;hpb=b23a9af95c65c01d949153fc49e5091aaa7c3d30 diff --git a/source/backends/opengl/device_backend.h b/source/backends/opengl/device_backend.h index dfa16653..491f1b31 100644 --- a/source/backends/opengl/device_backend.h +++ b/source/backends/opengl/device_backend.h @@ -1,16 +1,33 @@ #ifndef MSP_GL_DEVICE_BACKEND_H_ #define MSP_GL_DEVICE_BACKEND_H_ +#include #include #include namespace Msp { namespace GL { +class OpenGLBuffer; +class OpenGLPipelineState; +class OpenGLTexture; + +struct OpenGLDeviceState +{ + const OpenGLPipelineState *last_pipeline = 0; + std::vector bound_tex_targets; + std::vector 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 &); @@ -19,6 +36,9 @@ protected: void fill_info(); Graphics::GLContext &get_context() { return context; } + +public: + OpenGLDeviceState &get_state() { return state; } }; using DeviceBackend = OpenGLDevice;