OROCHI
 
Loading...
Searching...
No Matches
GxResTexture.h
Go to the documentation of this file.
1//===========================================================================
12//===========================================================================
13#pragma once
14
15GX_CORE_NAMESPACE_BEGIN()
16
17#include "jpeglib.h"
18
19//===========================================================================
21//===========================================================================
22class GxResTexture : public GxResBase
23{
24 //-----------------------------------------------------------
26 //-----------------------------------------------------------
28public:
29 // RTTI定義
30 GX_RTTI_RESOURCE_NAME_ICON(GxResTexture, GxResBase, "テクスチャリソース", GxRtti::ICON_TYPE::IMAGE)
31 // ClassBaseReference継承クラス用禁止宣言
33
34
39protected:
40 // リソースバージョン
41 static const u32 RESOURCE_VERSION;
42
44 static constexpr u32 TEXTURE_BITCOUNT_8 = GxMath::VALUE_8;
46 static constexpr u32 TEXTURE_BITCOUNT_16 = GxMath::VALUE_16;
48 static constexpr u32 TEXTURE_BITCOUNT_24 = 24;
50 static constexpr u32 TEXTURE_BITCOUNT_32 = GxMath::VALUE_32;
51public:
54 {
55 //-----------------------------------------------------------
57 //-----------------------------------------------------------
59 public:
60 // RTTI定義
62
63
64 static constexpr u32 ARRAY_LEVEL_2D = GxMath::VALUE_1;
66 static constexpr u32 ARRAY_LEVEL_3D = GxMath::VALUE_1;
68 static constexpr u32 ARRAY_LEVEL_CUBE = 6;
70 static constexpr u32 MIPMAP_LEVEL_MIN = GxMath::VALUE_1;
72 static constexpr u32 MIPMAP_LEVEL_MAX = GxMath::VALUE_16;
73
75 //-----------------------------------------------------------
77 //-----------------------------------------------------------
79 public:
95
97 //-----------------------------------------------------------
99 //-----------------------------------------------------------
101 public:
103 constexpr u32 getWidth(void) const { return _width; }
105 constexpr u32 getHeight(void) const { return _height; }
107 constexpr u32 getDepth(void) const { return _textureType == RENDER_TEXTURE_TYPE::_3D ? _depthOrArrayCount : 1; }
109 constexpr RENDER_TEXTURE_TYPE getTextureType(void) const { return _textureType; }
111 constexpr u32 getArrayLevel(void) const { return _textureType == RENDER_TEXTURE_TYPE::_3D ? 1 : _depthOrArrayCount; }
113 constexpr u32 getMipmapLevel(void) const { return _mipmapLevel; }
115 constexpr u32 getOriginalMipmapLevel(void) const { return _originalMipmapLevel; }
117 constexpr RENDER_ATTRIBUTE getAttribute(void) const { return static_cast<RENDER_ATTRIBUTE>(_attribute); }
119 constexpr RENDER_FORMAT getPixelFormat(void) const { return _pixelFormat; }
121 constexpr u32 getOriginalWidth(void) const { return _width << (_originalMipmapLevel - _mipmapLevel); }
123 constexpr u32 getOriginalHeight(void) const { return _height << (_originalMipmapLevel - _mipmapLevel); }
124
126 constexpr void getWidthProperty(void* const pValue) const { *static_cast<u32*>(pValue) = getWidth(); }
128 constexpr void getHeightProperty(void* const pValue) const { *static_cast<u32*>(pValue) = getHeight(); }
130 constexpr void getMipmapLevelProperty(void* const pValue) const { *static_cast<u32*>(pValue) = getMipmapLevel(); }
132 constexpr void getOriginalWidthProperty(void* const pValue) const { *static_cast<u32*>(pValue) = getOriginalWidth(); }
134 constexpr void getOriginalHeightProperty(void* const pValue) const { *static_cast<u32*>(pValue) = getOriginalHeight(); }
136 constexpr void getOriginalMipmapLevelProperty(void* const pValue) const { *static_cast<u32*>(pValue) = getOriginalMipmapLevel(); }
138 void getPixelFormatProperty(void* const pValue) const;
139
141 //-----------------------------------------------------------
143 //-----------------------------------------------------------
145 public:
146 u32 _width : 16;
147 u32 _height : 16;
148 u32 _attribute : 32;
151 u32 _mipmapLevel : 4;
155 u32 _reserved : 7;
156
158 };
159
160#if GX_DEVELOP
162 struct GxImportSetting : public GxStructBase
163 {
164 //-----------------------------------------------------------
166 //-----------------------------------------------------------
168 public:
169 // RTTI定義
170 GX_RTTI_STRUCT(GxResTexture::GxImportSetting)
171
172
173 enum class COMPRESS
174 {
175 NONE,
176 DXT1,
177 DXT3,
178 DXT5,
179 R8,
180 MAX,
181 };
182#if GX_DEVELOP
184 GX_ENUM_TABLE_MAX(COMPRESS)
185#endif //GX_DEVELOP
186
188 //-----------------------------------------------------------
190 //-----------------------------------------------------------
192
194 GxImportSetting(void) : _compressFormat(COMPRESS::NONE), _isSRGB(false){}
195
197 //-----------------------------------------------------------
199 //-----------------------------------------------------------
201 public:
202 COMPRESS _compressFormat;
203 b32 _isSRGB;
204
206 };
207#endif // GX_DEVELOP
208
210 //-----------------------------------------------------------
212 //-----------------------------------------------------------
214public:
216 GxResTexture(void) : _pTexture(nullptr), _pBuffer(nullptr){}
218 void cleanup(void) override;
219
221 //-----------------------------------------------------------
223 //-----------------------------------------------------------
225public:
227 b32 load(GxStream& stream, u32 dataSize);
228#if GX_DEVELOP
230 b32 save(GxStream& stream);
232 void resizeBuffer(const GxSize& size);
234 void writeBuffer(void* pBuffer, const GxRect& rect);
236 GxRtti* getUnitRtti( void ) override;
237#endif // GX_DEVELOP
238
240 b32 setTexture(GxRenderTexture* pRenderTexture);
245
247 static b32 saveAsBmp(GX_CSTR fileName, u32* pImage, s32 width, s32 height, u32 bytePerPixel);
249 static b32 saveAsPng(GX_CSTR fileName, u32* pImage, s32 width, s32 height, u32 bytePerPixel);
250#if GX_USE_DX11 || GX_USE_DX12
252 static void nativeToRGBA32(u32* pMemory, u32 width, u32 height);
254 static void addChromaRGBA32(u32* pMemory, u32 width, u32 height, GxColor chromaKeyColor);
255#endif //GX_USE_DX11 || GX_USE_DX12
256
258 static b32 writeAsPng(GxStreamWriter& writer, u32* pImage, s32 pitch, s32 width, s32 height, u32 bytePerPixel);
260 static GxResTexture* loadFromFile(const GxRttiResource& resRtti, GX_CSTR fileName);
261
262#if GX_EDITOR
264 void getToolRtti(GxArray& arrayTool) const override;
265#endif // GX_EDITOR
266
267protected:
269 b32 createTexture(void);
273 b32 loadTextureMainMemory(GxStream& stream, u32 dataSize);
274#if GX_DEVELOP
276 b32 saveTexture(GxStreamWriter& writer);
277#endif // GX_DEVELOP
279 void createCallback(void* pUser);
280
281private:
283 virtual b32 loadHeader(GxStreamReader& reader);
285 virtual b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel);
286#if GX_DEVELOP
288 virtual b32 saveHeader(GxStreamWriter& writer);
290 virtual b32 saveTextureMappingData(GxStreamWriter& writer, u32 arrayIndex, u32 mipmapLevel);
292 void saveImportSetting(void);
294 f32 convertToSRGB(f32 value);
295#endif // GX_DEVELOP
296
298 //-----------------------------------------------------------
300 //-----------------------------------------------------------
302public:
304 constexpr GxRenderTexture* getTexture(void) const { return _pTexture; }
306 GX_FORCE_INLINE const GxTextureInformation& getInformation(void) const { return _textureInformation; }
308 GX_FORCE_INLINE void* getBuffer(void) const { return _pBuffer; }
309
311 GX_FORCE_INLINE void setIsNoResFinalized(b32 state) { _textureInformation._isNoResFinalized = static_cast<u32>(state); }
313 GX_FORCE_INLINE b32 isNoResFinalized(void) const { return static_cast<b32>(_textureInformation._isNoResFinalized); }
314private:
315#if GX_DEVELOP
317 static void getImportSettingPath(GxString& path, GX_CSTR resourcePath);
318#endif // GX_DEVELOP
319
321 //-----------------------------------------------------------
323 //-----------------------------------------------------------
325protected:
328 void* _pBuffer;
329#if GX_DEVELOP
330 GxImportSetting _importSetting;
331#endif //GX_DEVELOP
332
334};
335
336//===========================================================================
338//===========================================================================
340{
341 //-----------------------------------------------------------
343 //-----------------------------------------------------------
345public:
346 // RTTI定義
347 GX_RTTI_RESOURCE_NAME(GxResTextureBmp, GxResTexture, "BMPテクスチャリソース")
348 // ClassBaseReference継承クラス用禁止宣言
350
351private:
353 enum class BMP_FORMAT
354 {
355 TRUE_COLOR_24 = 24,
356 TRUE_COLOR_32 = 32
357 };
358
360 static constexpr u32 BMP_MIPMAP_LEVEL = GxMath::VALUE_1;
361
363 struct BmpFileHeader
364 {
365 u8 _type[2];
366 u32 _size;
367 u16 _reserved[2];
368 u32 _imageOffset;
369 };
370
372 struct BmpInformationHeader
373 {
374 //-----------------------------------------------------------
376 //-----------------------------------------------------------
378 public:
380 RENDER_FORMAT getBmpTextureFormat(void);
381
383 //-----------------------------------------------------------
385 //-----------------------------------------------------------
387
388 u32 _headerSize;
389 s32 _width;
390 s32 _height;
391 u16 _planes;
392 u16 _bitPerPixel;
393 u32 _compression;
394 u32 _imageSize;
395 s32 _pixelPerMeterX;
396 s32 _pixelPerMeterY;
397 u32 _colorUsed;
398 u32 _colorImportant;
399
401 };
402
404 //-----------------------------------------------------------
406 //-----------------------------------------------------------
408protected:
411 {
412 GX_MEMSET(&_fileHeader, 0, sizeof(BmpFileHeader));
413 GX_MEMSET(&_informationHeader, 0, sizeof(BmpInformationHeader));
414 }
415
417 //-----------------------------------------------------------
419 //-----------------------------------------------------------
421protected:
423 b32 loadHeader(GxStreamReader& reader) override;
425 b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel) override;
426
428 //-----------------------------------------------------------
430 //-----------------------------------------------------------
432private:
433 BmpFileHeader _fileHeader;
434 BmpInformationHeader _informationHeader;
435
437};
438
439//===========================================================================
441//===========================================================================
443{
444 //-----------------------------------------------------------
446 //-----------------------------------------------------------
448public:
449 GX_RTTI_RESOURCE_NAME(GxResTextureDds, GxResTexture, "DDSテクスチャリソース")
450 // ClassBaseReference継承クラス用禁止宣言
452
453private:
455 enum DDSD
456 {
457 DDSD_CAPS = 0x00000001,
458 DDSD_HEIGHT = 0x00000002,
459 DDSD_WIDTH = 0x00000004,
460 DDSD_PITCH = 0x00000008,
461 DDSD_PIXELFORMAT = 0x00001000,
462 DDSD_MIPMAPCOUNT = 0x00020000,
463 DDSD_LINEARSIZE = 0x00080000,
464 DDSD_DEPTH = 0x00800000
465 };
467 enum DDPF
468 {
469 DDPF_ALPHAPIXELS = 0x00000001,
470 DDPF_ALPHA = 0x00000002,
471 DDPF_FOURCC = 0x00000004,
472 DDPF_PALETTEINDEXED4 = 0x00000008,
473 DDPF_PALETTEINDEXED8 = 0x00000020,
474 DDPF_RGB = 0x00000040,
475 DDPF_LUMINANCE = 0x00020000,
476 DDPF_BUMPDUDV = 0x00080000
477 };
479 enum DDSCAPS1
480 {
481 DDSCAPS1_ALPHA = 0x00000002,
482 DDSCAPS1_COMPLEX = 0x00000008,
483 DDSCAPS1_TEXTURE = 0x00001000,
484 DDSCAPS1_MIPMAP = 0x00040000
485 };
487 enum DDSCAPS2
488 {
489 DDSCAPS2_CUBEMAP = 0x00000200,
490 DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400,
491 DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800,
492 DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000,
493 DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000,
494 DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000,
495 DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000,
496 DDSCAPS2_VOLUME = 0x00200000
497 };
499 enum class DDSFORMAT
500 {
501 R16F = 111,
502 G16R16F = 112,
503 A16B16G16R16F = 113,
504 R32F = 114,
505 G32R32F = 115,
506 A32B32G32R32F = 116,
507 };
509 enum class DXT10FORMAT
510 {
511 R32G32B32A32_FLOAT = 2,
512 R16G16B16A16_FLOAT = 10,
513 R10G10B10A2_UNORM = 24,
514 R11G11B10_FLOAT = 26,
515 R8G8B8A8_UNORM = 28,
516 R8G8B8A8_UNORM_SRGB = 29,
517 R16G16_FLOAT = 34,
518 D32_FLOAT = 40,
519 R32_FLOAT = 41,
520 D16_UNORM = 55,
521 R16_UNORM = 56,
522 R8_UNORM = 61,
523 BC1_UNORM = 71,
524 BC1_UNORM_SRGB = 72,
525 BC2_UNORM = 74,
526 BC2_UNORM_SRGB = 75,
527 BC3_UNORM = 77,
528 BC3_UNORM_SRGB = 78,
529 BC4_UNORM = 80,
530 BC4_SNORM = 81,
531 BC5_UNORM = 83,
532 BC5_SNORM = 84,
533 BC6H_UF16 = 95,
534 BC6H_SF16 = 96,
535 BC7_UNORM = 98,
536 BC7_UNORM_SRGB = 99,
537 };
539 struct DdsFileHeader
540 {
541 u32 _magic;
542 };
543
545 struct DdsPixelFormat
546 {
547 u32 _size;
548 u32 _flags;
549 u32 _fourcc;
550 u32 _rgbBitCount;
551 u32 _redBitMask;
552 u32 _greenBitMask;
553 u32 _blueBitMask;
554 u32 _alphaBitMask;
555 };
557 struct DdsCaps
558 {
559 u32 _caps1;
560 u32 _caps2;
561 u32 _reserved[2];
562 };
564 struct DdsFormatHeader
565 {
566 //-----------------------------------------------------------
568 //-----------------------------------------------------------
570
571 static constexpr u32 RESERVED1_SIZE = 11;
572 static constexpr u32 RESERVED2_SIZE = GxMath::VALUE_1;
573
576 {
577 //-----------------------------------------------------------
579 //-----------------------------------------------------------
581
584
586 //-----------------------------------------------------------
588 //-----------------------------------------------------------
590
596
598 };
599
601 //-----------------------------------------------------------
603 //-----------------------------------------------------------
605 public:
607 RENDER_FORMAT getDdsTextureFormat(void);
609 RENDER_TEXTURE_TYPE getDdsTextureType(void);
610
612 //-----------------------------------------------------------
614 //-----------------------------------------------------------
616
617 u32 _headerSize;
618 u32 _flags;
619 u32 _height;
620 u32 _width;
621 u32 _pitchOrLinearSize;
622 u32 _depth;
623 u32 _mipmapCount;
624 u32 _reserved1[RESERVED1_SIZE];
625 DdsPixelFormat _pixelFormat;
626 DdsCaps _caps;
627 u32 _reserved2[RESERVED2_SIZE];
628 DdsFormatHeaderDXT10 _dxt10Format;
629
631 };
632
634 //-----------------------------------------------------------
636 //-----------------------------------------------------------
638protected:
640 GxResTextureDds(void){ GX_MEMSET(&_fileHeader, 0, sizeof(DdsFileHeader)); GX_MEMSET(&_formatHeader, 0, sizeof(DdsFormatHeader)); }
641
643 //-----------------------------------------------------------
645 //-----------------------------------------------------------
647protected:
649 b32 loadHeader(GxStreamReader& reader) override;
651 b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel) override;
652
654 //-----------------------------------------------------------
656 //-----------------------------------------------------------
658private:
659 DdsFileHeader _fileHeader;
660 DdsFormatHeader _formatHeader;
661
663};
664
665//===========================================================================
667//===========================================================================
669{
670 //-----------------------------------------------------------
672 //-----------------------------------------------------------
674public:
675 // RTTI定義
676 GX_RTTI_RESOURCE_NAME(GxResTextureSdds, GxResTextureDds, "DDS(SRGB)テクスチャリソース")
677 // ClassBaseReference継承クラス用禁止宣言
679
680
681 //-----------------------------------------------------------
683 //-----------------------------------------------------------
685protected:
688
690 //-----------------------------------------------------------
692 //-----------------------------------------------------------
694protected:
696 b32 loadHeader(GxStreamReader& reader) override;
697
699};
700
701//===========================================================================
703//===========================================================================
705{
706 //-----------------------------------------------------------
708 //-----------------------------------------------------------
710public:
711 GX_RTTI_RESOURCE_NAME(GxResTexturePng, GxResTexture, "PNGテクスチャリソース")
712 // ClassBaseReference継承クラス用禁止宣言
714
715
716 //-----------------------------------------------------------
718 //-----------------------------------------------------------
720protected:
723
725 //-----------------------------------------------------------
727 //-----------------------------------------------------------
729protected:
731 b32 loadHeader(GxStreamReader& reader) override;
732
734 b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel) override;
735
737 //-----------------------------------------------------------
739 //-----------------------------------------------------------
741private:
742 void* _pRead; // png_structp
743 void* _pReadInformation; // png_infop
744 void* _pEnd; // png_infop
745
747};
748
749//===========================================================================
751//===========================================================================
753{
754 //-----------------------------------------------------------
756 //-----------------------------------------------------------
758public:
759 // RTTI宣言
760 GX_RTTI_RESOURCE_NAME(GxResTextureJpeg, GxResTexture, "JPEGテクスチャリソース")
761 // ClassBaseReference継承クラス用禁止宣言
763
764
765 //-----------------------------------------------------------
767 //-----------------------------------------------------------
769protected:
771 GxResTextureJpeg(void) : _pRawBuffer(nullptr){}
772
774 //-----------------------------------------------------------
776 //-----------------------------------------------------------
778protected:
780 b32 loadHeader(GxStreamReader& reader) override;
782 b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel) override;
783
785 //-----------------------------------------------------------
787 //-----------------------------------------------------------
789private:
790 jpeg_decompress_struct _jpegInformation;
791 jpeg_error_mgr _jpegError;
792 u8* _pRawBuffer;
793
795};
796
797//===========================================================================
799//===========================================================================
801{
802 //-----------------------------------------------------------
804 //-----------------------------------------------------------
806public:
807 // RTTI定義
808 GX_RTTI_RESOURCE_NAME(GxResTexturePvr, GxResTexture, "PVRテクスチャリソース")
809 // ClassBaseReference継承クラス用禁止宣言
811
812
813 //-----------------------------------------------------------
815 //-----------------------------------------------------------
817protected:
820
822 //-----------------------------------------------------------
824 //-----------------------------------------------------------
826protected:
828 b32 loadHeader(GxStreamReader& reader) override;
829
831 b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel) override;
832
834};
835
836//===========================================================================
838//===========================================================================
840{
841 //-----------------------------------------------------------
843 //-----------------------------------------------------------
845public:
846 // RTTI定義
847 GX_RTTI_RESOURCE_NAME(GxResTextureTga, GxResTexture, "TGAテクスチャリソース")
848 // ClassBaseReference継承クラス用禁止宣言
850
851private:
853 enum class TGA_FORMAT
854 {
855 TRUE_COLOR_24 = 24,
856 TRUE_COLOR_32 = 32
857 };
858
860 static constexpr u32 TGA_MIPMAP_LEVEL = GxMath::VALUE_1;
861
863 struct TgaInformationHeader
864 {
865 //-----------------------------------------------------------
867 //-----------------------------------------------------------
869 public:
871 RENDER_FORMAT getTgaTextureFormat(void);
872
874 //-----------------------------------------------------------
876 //-----------------------------------------------------------
878
879 s32 _width;
880 s32 _height;
881 u16 _bitPerPixel;
882 b32 _isRLE;
883 b32 _isFlip;
884
886 };
887
889 //-----------------------------------------------------------
891 //-----------------------------------------------------------
893protected:
896
898 //-----------------------------------------------------------
900 //-----------------------------------------------------------
902protected:
904 b32 loadHeader(GxStreamReader& reader) override;
906 b32 loadTextureMappingData(GxStreamReader& reader, u32 arrayIndex, u32 mipmapLevel) override;
907
909 //-----------------------------------------------------------
911 //-----------------------------------------------------------
913private:
914 TgaInformationHeader _informationHeader;
915
917};
918
919GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
@ MAX
定義数
@ NONE
何もしない
RENDER_ATTRIBUTE
バッファの属性
Definition GxRender.h:158
RENDER_FORMAT
フォーマット
Definition GxRender.h:269
@ UNKNOWN
未定義
RENDER_TEXTURE_TYPE
テクスチャ形式
Definition GxRender.h:405
配列クラス
Definition GxArray.h:18
算術演算クラス
Definition GxMath.h:84
static constexpr u32 VALUE_32
32
Definition GxMath.h:124
static constexpr u32 VALUE_16
16
Definition GxMath.h:123
static constexpr u32 VALUE_1
1
Definition GxMath.h:119
static constexpr u32 VALUE_8
8
Definition GxMath.h:122
テクスチャクラス
Definition GxRenderTexture.h:19
リソース基底クラス
Definition GxResBase.h:23
Bmpテクスチャリソース
Definition GxResTexture.h:340
GxResTextureBmp(void)
コンストラクタ
Definition GxResTexture.h:410
b32 loadTextureMappingData(GxStreamReader &reader, u32 arrayIndex, u32 mipmapLevel) override
テクスチャマッピングデータ読み込み
Definition GxResTexture.cpp:1554
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み (BMPファイル)
Definition GxResTexture.cpp:1446
Ddsテクスチャリソース
Definition GxResTexture.h:443
b32 loadTextureMappingData(GxStreamReader &reader, u32 arrayIndex, u32 mipmapLevel) override
テクスチャマッピングデータ読み込み
Definition GxResTexture.cpp:1878
GxResTextureDds(void)
コンストラクタ
Definition GxResTexture.h:640
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み (DDSファイル)
Definition GxResTexture.cpp:1694
テクスチャリソース
Definition GxResTexture.h:23
static constexpr u32 TEXTURE_BITCOUNT_24
テクスチャビット数:24
Definition GxResTexture.h:48
GxResTexture(void)
コンストラクタ
Definition GxResTexture.h:216
void deleteTextureFromVideoMemory(void)
VRAMから破棄
Definition GxResTexture.cpp:371
static constexpr u32 TEXTURE_BITCOUNT_16
テクスチャビット数:16
Definition GxResTexture.h:46
static b32 saveAsBmp(GX_CSTR fileName, u32 *pImage, s32 width, s32 height, u32 bytePerPixel)
bmpファイル形式で保存
Definition GxResTexture.cpp:1093
void cleanup(void) override
解放
Definition GxResTexture.cpp:103
constexpr GxRenderTexture * getTexture(void) const
テクスチャ管理クラス取得
Definition GxResTexture.h:304
GX_FORCE_INLINE void setIsNoResFinalized(b32 state)
loadFromFile() で作成されたかを設定(内部使用)
Definition GxResTexture.h:311
static b32 saveAsPng(GX_CSTR fileName, u32 *pImage, s32 width, s32 height, u32 bytePerPixel)
pngファイル形式で保存
Definition GxResTexture.cpp:1183
b32 createTexture(void)
テクスチャ作成
Definition GxResTexture.cpp:381
GX_FORCE_INLINE void * getBuffer(void) const
メインメモリ退避用バッファを取得
Definition GxResTexture.h:308
static b32 writeAsPng(GxStreamWriter &writer, u32 *pImage, s32 pitch, s32 width, s32 height, u32 bytePerPixel)
pngファイル形式で書き込み
Definition GxResTexture.cpp:1212
static constexpr u32 TEXTURE_BITCOUNT_8
テクスチャビット数:8
Definition GxResTexture.h:44
GxTextureInformation _textureInformation
テクスチャ情報
Definition GxResTexture.h:327
void * _pBuffer
メインメモリ退避用バッファ
Definition GxResTexture.h:328
static GxResTexture * loadFromFile(const GxRttiResource &resRtti, GX_CSTR fileName)
ファイルからリソースを作る便利関数
Definition GxResTexture.cpp:1369
b32 loadTexture(GxStreamReader &reader)
テクスチャ読み込み
Definition GxResTexture.cpp:450
GX_FORCE_INLINE b32 isNoResFinalized(void) const
loadFromFile() で作成されたかを取得(内部使用)
Definition GxResTexture.h:313
b32 uploadTextureToVideoMemory(void)
VRAMへ転送
Definition GxResTexture.cpp:348
b32 loadTextureMainMemory(GxStream &stream, u32 dataSize)
メインメモリにテクスチャ読み込み
Definition GxResTexture.cpp:519
static constexpr u32 TEXTURE_BITCOUNT_32
テクスチャビット数:32
Definition GxResTexture.h:50
GxRenderTexture * _pTexture
テクスチャ管理
Definition GxResTexture.h:326
b32 setTexture(GxRenderTexture *pRenderTexture)
既存テクスチャの設定
Definition GxResTexture.cpp:316
b32 load(GxStream &stream, u32 dataSize)
リソース読み込み
Definition GxResTexture.cpp:119
GX_FORCE_INLINE const GxTextureInformation & getInformation(void) const
テクスチャ情報取得
Definition GxResTexture.h:306
Jpegテクスチャリソース
Definition GxResTexture.h:753
GxResTextureJpeg(void)
デフォルトコンストラクタ
Definition GxResTexture.h:771
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み
Definition GxResTexture.cpp:2894
b32 loadTextureMappingData(GxStreamReader &reader, u32 arrayIndex, u32 mipmapLevel) override
テクスチャマッピングデータ読み込み
Definition GxResTexture.cpp:2950
Pngテクスチャリソース
Definition GxResTexture.h:705
b32 loadTextureMappingData(GxStreamReader &reader, u32 arrayIndex, u32 mipmapLevel) override
テクスチャマッピングデータ読み込み
Definition GxResTexture.cpp:2770
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み (PNGファイル)
Definition GxResTexture.cpp:2486
GxResTexturePng(void)
コンストラクタ
Definition GxResTexture.h:722
PVRテクスチャリソース
Definition GxResTexture.h:801
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み (PVRファイル)
Definition GxResTexture.cpp:3037
b32 loadTextureMappingData(GxStreamReader &reader, u32 arrayIndex, u32 mipmapLevel) override
テクスチャマッピングデータ読み込み
Definition GxResTexture.cpp:3050
GxResTexturePvr(void)
コンストラクタ
Definition GxResTexture.h:819
Dds (SRGB) テクスチャリソース
Definition GxResTexture.h:669
GxResTextureSdds(void)
コンストラクタ
Definition GxResTexture.h:687
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み
Definition GxResTexture.cpp:2437
Tgaテクスチャリソース
Definition GxResTexture.h:840
GxResTextureTga(void)
コンストラクタ
Definition GxResTexture.h:895
b32 loadHeader(GxStreamReader &reader) override
ヘッダー読み込み (Tgaファイル)
Definition GxResTexture.cpp:3105
b32 loadTextureMappingData(GxStreamReader &reader, u32 arrayIndex, u32 mipmapLevel) override
テクスチャマッピングデータ読み込み
Definition GxResTexture.cpp:3175
実行時型情報クラス
Definition GxRtti.h:154
リソース実行時型情報クラス
Definition GxRttiResource.h:188
ストリーム基礎クラス
Definition GxStream.h:20
ストリーム読み込みクラス
Definition GxStreamReader.h:19
ストリーム書き込みクラス
Definition GxStreamWriter.h:19
Definition GxColor.h:21
矩形
Definition GxStruct.h:951
リソース作成時コールバックの引数情報
Definition GxResTexture.h:36
u32 _attribute
属性
Definition GxResTexture.h:37
テクスチャヘッダー情報構造体
Definition GxResTexture.h:54
RENDER_TEXTURE_TYPE _textureType
テクスチャタイプ
Definition GxResTexture.h:149
u32 _mipmapLevel
ミップマップレベル
Definition GxResTexture.h:151
constexpr RENDER_FORMAT getPixelFormat(void) const
ピクセルフォーマット取得
Definition GxResTexture.h:119
static constexpr u32 ARRAY_LEVEL_2D
2Dテクスチャ配列数
Definition GxResTexture.h:64
~GxTextureInformation(void)
デストラクタ
Definition GxResTexture.h:94
u32 _attribute
属性(RENDER_ATTRIBUTE)
Definition GxResTexture.h:148
u32 _width
Definition GxResTexture.h:146
constexpr u32 getOriginalMipmapLevel(void) const
オリジナルミップマップレベル取得
Definition GxResTexture.h:115
constexpr u32 getMipmapLevel(void) const
ミップマップレベル取得
Definition GxResTexture.h:113
constexpr void getOriginalWidthProperty(void *const pValue) const
オリジナル幅取得
Definition GxResTexture.h:132
constexpr u32 getArrayLevel(void) const
配列レベル取得
Definition GxResTexture.h:111
constexpr void getMipmapLevelProperty(void *const pValue) const
ミップマップレベル取得
Definition GxResTexture.h:130
static constexpr u32 ARRAY_LEVEL_3D
2Dテクスチャ配列数
Definition GxResTexture.h:66
constexpr RENDER_TEXTURE_TYPE getTextureType(void) const
テクスチャタイプ取得
Definition GxResTexture.h:109
u32 _originalMipmapLevel
オリジナルのミップマップレベル (リダクションされていない場合のミップマップ段数)
Definition GxResTexture.h:153
constexpr RENDER_ATTRIBUTE getAttribute(void) const
描画属性取得
Definition GxResTexture.h:117
constexpr u32 getOriginalWidth(void) const
オリジナル幅取得
Definition GxResTexture.h:121
RENDER_FORMAT _pixelFormat
ピクセルフォーマット
Definition GxResTexture.h:152
u32 _depthOrArrayCount
テクスチャ配列数(CUBEの場合は6枚, 3Dテクスチャの場合は深度)
Definition GxResTexture.h:150
constexpr u32 getDepth(void) const
深さ取得
Definition GxResTexture.h:107
constexpr void getOriginalMipmapLevelProperty(void *const pValue) const
オリジナルミップマップレベル取得
Definition GxResTexture.h:136
constexpr void getHeightProperty(void *const pValue) const
高さ取得
Definition GxResTexture.h:128
constexpr u32 getHeight(void) const
高さ取得
Definition GxResTexture.h:105
void getPixelFormatProperty(void *const pValue) const
ピクセルフォーマット取得
Definition GxResTexture.cpp:884
static constexpr u32 MIPMAP_LEVEL_MIN
ミップマップ段数最低値
Definition GxResTexture.h:70
static constexpr u32 ARRAY_LEVEL_CUBE
キューブマップテクスチャ配列数 (CUBE → 6面)
Definition GxResTexture.h:68
u32 _height
高さ
Definition GxResTexture.h:147
u32 _isNoResFinalized
描画リソースとして loadFromFile() で作成されたか
Definition GxResTexture.h:154
constexpr void getWidthProperty(void *const pValue) const
幅取得
Definition GxResTexture.h:126
u32 _reserved
予約領域
Definition GxResTexture.h:155
static constexpr u32 MIPMAP_LEVEL_MAX
ミップマップ段数最高値
Definition GxResTexture.h:72
constexpr void getOriginalHeightProperty(void *const pValue) const
オリジナル高さ取得
Definition GxResTexture.h:134
constexpr u32 getWidth(void) const
幅取得
Definition GxResTexture.h:103
constexpr u32 getOriginalHeight(void) const
オリジナル高さ取得
Definition GxResTexture.h:123
DXT10フォーマットヘッダ
Definition GxResTexture.h:576
RENDER_FORMAT getDdsTextureFormat(void)
テクスチャフォーマット取得
Definition GxResTexture.cpp:2353
u32 _miscFlags2
フラグ
Definition GxResTexture.h:595
u32 _arraySize
配列サイズ
Definition GxResTexture.h:594
u32 _miscFlag
フラグ
Definition GxResTexture.h:593
u32 _dxgiFormat
フォーマット(DXGI_FORMAT)
Definition GxResTexture.h:591
u32 _resourceDimension
次元(D3D10_RESOURCE_DIMENSION)
Definition GxResTexture.h:592
サイズ
Definition GxStruct.h:730
文字列型クラス
Definition GxString.h:18
Definition GxBase.h:24
32bitブーリアン
Definition GxDefine.h:173