upload type
parent
04665fa5c7
commit
f821c7c8d1
|
@ -171,7 +171,7 @@ namespace blt::gfx
|
||||||
texture_gl2D(int width, int height, GLint colorMode = GL_RGBA8);
|
texture_gl2D(int width, int height, GLint colorMode = GL_RGBA8);
|
||||||
|
|
||||||
void upload(void* data, GLint dataColorMode = GL_RGBA, int level = 0, int x_offset = 0, int y_offset = 0, int sub_width = -1,
|
void upload(void* data, GLint dataColorMode = GL_RGBA, int level = 0, int x_offset = 0, int y_offset = 0, int sub_width = -1,
|
||||||
int sub_height = -1) const;
|
int sub_height = -1, GLint dataMode = GL_UNSIGNED_BYTE) const;
|
||||||
|
|
||||||
void upload(const texture_file& tex_file) const;
|
void upload(const texture_file& tex_file) const;
|
||||||
|
|
||||||
|
|
|
@ -95,14 +95,15 @@ void blt::gfx::texture_gl::setDefaults() const
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void blt::gfx::texture_gl2D::upload(void* data, GLint dataColorMode, int level, int x_offset, int y_offset, int sub_width, int sub_height) const
|
void blt::gfx::texture_gl2D::upload(void* data, GLint dataColorMode, int level, int x_offset, int y_offset, int sub_width, int sub_height,
|
||||||
|
GLint dataMode) const
|
||||||
{
|
{
|
||||||
if (sub_width < 0)
|
if (sub_width < 0)
|
||||||
sub_width = m_width;
|
sub_width = m_width;
|
||||||
if (sub_height < 0)
|
if (sub_height < 0)
|
||||||
sub_height = m_height;
|
sub_height = m_height;
|
||||||
bind();
|
bind();
|
||||||
glTexSubImage2D(textureBindType, level, x_offset, y_offset, sub_width, sub_height, dataColorMode, GL_UNSIGNED_BYTE, data);
|
glTexSubImage2D(textureBindType, level, x_offset, y_offset, sub_width, sub_height, dataColorMode, dataMode, data);
|
||||||
unbind();
|
unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue