mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 21:28:32 +09:00
[Feat] (MG_State/TextureState): Implement TextureState.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include "TextureUnit.h"
|
||||
#include "MG_Util/Types.h"
|
||||
|
||||
namespace MobileGL {
|
||||
namespace MG_State {
|
||||
namespace GLState {
|
||||
TextureUnit::TextureUnit() : m_sampler(nullptr) {
|
||||
for (int i = 0; i < (int)TextureTarget::TextureTargetCount; ++i) {
|
||||
m_slots[i] = BindingSlot<ITextureObject>(static_cast<TextureTarget>(i));
|
||||
}
|
||||
}
|
||||
|
||||
BindingSlot<ITextureObject>& TextureUnit::GetBindingSlot(TextureTarget target) {
|
||||
return m_slots[(int)target];
|
||||
}
|
||||
|
||||
Array<BindingSlot<ITextureObject>, (int)TextureTarget::TextureTargetCount>& TextureUnit::
|
||||
GetAllBindingSlots() {
|
||||
return m_slots;
|
||||
}
|
||||
} // namespace GLState
|
||||
} // namespace MG_State
|
||||
} // namespace MobileGL
|
||||
Reference in New Issue
Block a user