mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
LibGL: Implement glTexSubImage2D
This commit is contained in:
parent
1aed453d8c
commit
e7d3483618
7 changed files with 63 additions and 19 deletions
|
@ -35,8 +35,8 @@ public:
|
|||
|
||||
virtual bool is_texture_2d() const override { return true; }
|
||||
|
||||
void upload_texture_data(GLenum target, GLint lod, GLint internal_format, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels, size_t pixels_per_row);
|
||||
void replace_sub_texture_data(GLint lod, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* data);
|
||||
void upload_texture_data(GLuint lod, GLint internal_format, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels, size_t pixels_per_row);
|
||||
void replace_sub_texture_data(GLuint lod, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels, size_t pixels_per_row);
|
||||
|
||||
MipMap const& mipmap(unsigned lod) const;
|
||||
|
||||
|
@ -44,6 +44,9 @@ public:
|
|||
Sampler2D const& sampler() const { return m_sampler; }
|
||||
Sampler2D& sampler() { return m_sampler; }
|
||||
|
||||
int width_at_lod(unsigned level) const { return (level >= m_mipmaps.size()) ? 0 : max(1, m_mipmaps.at(level).width() >> level); }
|
||||
int height_at_lod(unsigned level) const { return (level >= m_mipmaps.size()) ? 0 : max(1, m_mipmaps.at(level).height() >> level); }
|
||||
|
||||
private:
|
||||
template<typename TCallback>
|
||||
void swizzle(Vector<u32>& pixels, TCallback&& callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue