mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Fix] (MG_State/Texture): implement GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_PIXELS, fixing non-unicode fonts
This commit is contained in:
@@ -624,11 +624,16 @@ namespace MG_GL::GL {
|
||||
return;
|
||||
}
|
||||
|
||||
auto rowLength = TextureState::GetUnpackParam_(GL_UNPACK_ROW_LENGTH);
|
||||
auto rowLength = MG_State::QueryPixelStoreInt(GL_UNPACK_ROW_LENGTH);
|
||||
rowLength = ((rowLength > 0) ? rowLength : width);
|
||||
auto skipRows = MG_State::QueryPixelStoreInt(GL_UNPACK_SKIP_ROWS);
|
||||
auto skipPixels = MG_State::QueryPixelStoreInt(GL_UNPACK_SKIP_PIXELS);
|
||||
auto bpp = GetBytesPerPixel(format, type);
|
||||
char* pixelStart = (char*)pixels + bpp * (rowLength * skipRows + skipPixels);
|
||||
|
||||
Diligent::TextureSubResData SubResData;
|
||||
SubResData.pData = pixels;
|
||||
SubResData.Stride = ((rowLength > 0) ? rowLength : width) * GetBytesPerPixel(format, type);
|
||||
SubResData.Stride = rowLength * bpp;
|
||||
SubResData.pData = pixelStart;
|
||||
|
||||
Diligent::Box UpdateBox;
|
||||
UpdateBox.MinX = xoffset;
|
||||
|
||||
Reference in New Issue
Block a user