1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

LibGL: Use Texture Units in Rasterizer and Context

The Context and Software Rasterizer now gets the array of texture units
instead of a single texture object. _Technically_, we now support some
primitive form of multi-texturing, though I'm not entirely sure how well
it will work in its current state.
This commit is contained in:
Jesse Buhagiar 2021-05-30 21:39:31 +10:00 committed by Linus Groh
parent 573c1c82f7
commit 8298e406a4
5 changed files with 38 additions and 27 deletions

View file

@ -17,14 +17,16 @@ public:
void bind_texture_to_target(GLenum texture_target, const RefPtr<Texture>& texture);
void unbind_texture(GLenum texture_target);
const RefPtr<Texture>& get_bound_texture() const { return m_currently_bound_texture; }
RefPtr<Texture2D>& bound_texture_2d() const { return m_texture_target_2d; }
RefPtr<Texture>& bound_texture() const { return m_currently_bound_texture; }
GLenum currently_bound_target() const { return m_currently_bound_target; }
bool is_bound() const { return m_currently_bound_texture != nullptr; }
bool is_bound() const { return !m_currently_bound_texture.is_null(); }
private:
RefPtr<Texture2D> m_texture_target_2d { nullptr };
RefPtr<Texture> m_currently_bound_texture { nullptr };
mutable RefPtr<Texture2D> m_texture_target_2d { nullptr };
mutable RefPtr<Texture> m_currently_bound_texture { nullptr };
GLenum m_currently_bound_target;
};