parent
08f3a03547
commit
926f7cf115
|
@ -823,6 +823,9 @@ Texture CGL21Device::CreateTexture(ImageData *data, const TextureCreateParams &p
|
|||
PreparedTextureData texData = PrepareTextureData(data, params.format);
|
||||
result.alpha = texData.alpha;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, texData.actualSurface->pitch / texData.actualSurface->format->BytesPerPixel);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texData.actualSurface->w, texData.actualSurface->h,
|
||||
0, texData.sourceFormat, GL_UNSIGNED_BYTE, texData.actualSurface->pixels);
|
||||
|
||||
|
@ -894,6 +897,9 @@ void CGL21Device::UpdateTexture(const Texture& texture, Math::IntPoint offset, I
|
|||
|
||||
PreparedTextureData texData = PrepareTextureData(data, format);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, texData.actualSurface->pitch / texData.actualSurface->format->BytesPerPixel);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, offset.x, offset.y, texData.actualSurface->w, texData.actualSurface->h,
|
||||
texData.sourceFormat, GL_UNSIGNED_BYTE, texData.actualSurface->pixels);
|
||||
|
||||
|
|
|
@ -852,6 +852,9 @@ Texture CGL33Device::CreateTexture(ImageData *data, const TextureCreateParams &p
|
|||
PreparedTextureData texData = PrepareTextureData(data, params.format);
|
||||
result.alpha = texData.alpha;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, texData.actualSurface->pitch / texData.actualSurface->format->BytesPerPixel);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texData.actualSurface->w, texData.actualSurface->h,
|
||||
0, texData.sourceFormat, GL_UNSIGNED_BYTE, texData.actualSurface->pixels);
|
||||
|
||||
|
@ -921,6 +924,9 @@ void CGL33Device::UpdateTexture(const Texture& texture, Math::IntPoint offset, I
|
|||
|
||||
PreparedTextureData texData = PrepareTextureData(data, format);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, texData.actualSurface->pitch / texData.actualSurface->format->BytesPerPixel);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, offset.x, offset.y, texData.actualSurface->w, texData.actualSurface->h,
|
||||
texData.sourceFormat, GL_UNSIGNED_BYTE, texData.actualSurface->pixels);
|
||||
|
||||
|
|
|
@ -725,6 +725,9 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
|
|||
PreparedTextureData texData = PrepareTextureData(data, params.format);
|
||||
result.alpha = texData.alpha;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, texData.actualSurface->pitch / texData.actualSurface->format->BytesPerPixel);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texData.actualSurface->w, texData.actualSurface->h,
|
||||
0, texData.sourceFormat, GL_UNSIGNED_BYTE, texData.actualSurface->pixels);
|
||||
|
||||
|
@ -826,6 +829,9 @@ void CGLDevice::UpdateTexture(const Texture& texture, Math::IntPoint offset, Ima
|
|||
|
||||
PreparedTextureData texData = PrepareTextureData(data, format);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, texData.actualSurface->pitch / texData.actualSurface->format->BytesPerPixel);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, offset.x, offset.y, texData.actualSurface->w, texData.actualSurface->h,
|
||||
texData.sourceFormat, GL_UNSIGNED_BYTE, texData.actualSurface->pixels);
|
||||
|
||||
|
|
Loading…
Reference in New Issue