Модификация класса текстуры
This commit is contained in:
@@ -78,6 +78,21 @@ Texture::Texture(GLuint width, GLuint height, GLuint attachment, GLuint texType,
|
||||
handler_count[handler] = 1;
|
||||
}
|
||||
|
||||
// Конструктор текстуры заданного размера без привязки к буферу с загрузкой пикселей по указателю
|
||||
Texture::Texture(GLuint width, GLuint height, void* data, GLuint texType, GLint internalformat, GLint format, GLenum dataType)
|
||||
{
|
||||
type = texType;
|
||||
// Генерация текстуры заданного размера
|
||||
glGenTextures(1, &handler);
|
||||
glBindTexture(GL_TEXTURE_2D, handler);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalformat, width, height, 0, format, dataType, data);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
// Создаем счетчик использований дескриптора
|
||||
handler_count[handler] = 1;
|
||||
}
|
||||
|
||||
// Конструктор копирования
|
||||
Texture::Texture(const Texture& other)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user