MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / SetSourceDecal

Method SetSourceDecal

extensions/olcPGEX_Shaders.h:627–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625 }
626
627 int32_t Shade::SetSourceDecal(olc::Decal* pDecal, const uint32_t nSlot, const olc::vf2d& vSourcePos, const olc::vf2d& vSourceSize)
628 {
629 if (pDecal == nullptr)
630 {
631 slotSource[nSlot] = { false, dummyTex.Decal()->id, {0.0f, 0.0f}, {1.0f, 1.0f} };
632 }
633 else
634 {
635 slotSource[nSlot].bInUse = true;
636 slotSource[nSlot].nTargetResID = pDecal->id;
637 slotSource[nSlot].vPos = vSourcePos;
638 slotSource[nSlot].vSize = vSourceSize;
639 }
640
641 locActiveTexture(0x84C0); // TODO
642 glBindTexture(GL_TEXTURE_2D, slotSource[nSlot].nTargetResID);
643 return 0;
644 }
645
646 int32_t Shade::SetTargetDecal(olc::Decal* pDecal, const uint32_t nSlot)
647 {

Callers

nothing calls this directly

Calls 1

DecalMethod · 0.80

Tested by

no test coverage detected