voxel long

This commit is contained in:
alexei-zebra 2024-01-09 18:58:58 +03:00
parent 3542a00445
commit 0175a8b76c
54 changed files with 615 additions and 593 deletions

View file

@ -8,7 +8,7 @@ Texture::Texture(uint id, int width, int height)
: id(id), width(width), height(height) {
}
Texture::Texture(u_char8* data, int width, int height, uint format)
Texture::Texture(u_char* data, int width, int height, uint format)
: width(width), height(height) {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
@ -30,7 +30,7 @@ void Texture::bind(){
glBindTexture(GL_TEXTURE_2D, id);
}
void Texture::reload(u_char8* data){
void Texture::reload(u_char* data){
glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *) data);
@ -48,5 +48,5 @@ Texture* Texture::from(const ImageData* image) {
default:
throw std::runtime_error("unsupported image data format");
}
return new Texture((u_char8*)data, width, height, format);
return new Texture((u_char*)data, width, height, format);
}