[Feat] (...): Handle pixel store correctly.

This commit is contained in:
BZLZHH
2025-11-01 19:52:33 +08:00
parent bcb947235d
commit d652645346
11 changed files with 406 additions and 73 deletions
@@ -109,6 +109,17 @@ namespace MobileGL {
Unknown = -1
};
struct PixelStoreParameters {
Bool SwapBytes = false;
Bool LSBFirst = false;
Int RowLength = 0;
Int ImageHeight = 0;
Int SkipPixels = 0;
Int SkipRows = 0;
Int SkipImages = 0;
Int Alignment = 4;
};
namespace MG_State {
namespace GLState {
class RenderState {
@@ -147,6 +158,7 @@ namespace MobileGL {
// Pixel Store
void SetPixelStoreParam(PixelStoreParam param, Int value);
Int GetPixelStoreParam(PixelStoreParam param) const;
PixelStoreParameters GetPixelStoreParameters(Bool isUnpack) const;
// Cull Face
void SetCullFaceMode(CullFaceMode mode);
@@ -180,7 +192,8 @@ namespace MobileGL {
Float m_clearDepth = 1.0f;
// Pixel Store
Array<Int, static_cast<SizeT>(PixelStoreParam::PixelStoreParamCount)> m_pixelStoreParams;
PixelStoreParameters m_packParameters;
PixelStoreParameters m_unpackParameters;
// Cull Face
Bool m_cullFaceEnabled = false;