MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / RenderTexture

Method RenderTexture

LuaSTGPlus/AppFrame.h:462–486  ·  view source on GitHub ↗

@brief ��Ⱦ����

Source from the content-addressed store, hash-verified

460
461 /// @brief ��Ⱦ����
462 bool RenderTexture(ResTexture* tex, BlendMode blend, const f2dGraphics2DVertex vertex[])LNOEXCEPT
463 {
464 if (m_GraphType != GraphicsType::Graph2D)
465 {
466 LERROR("RenderTexture: ֻ��2D��Ⱦ������ִ�и÷���");
467 return false;
468 }
469
470 // ���û��
471 updateGraph2DBlendMode(blend);
472
473 // ��������
474 f2dGraphics2DVertex tVertex[4];
475 memcpy(tVertex, vertex, sizeof(tVertex));
476
477 // ����UV��[0,1]����
478 for (int i = 0; i < 4; ++i)
479 {
480 tVertex[i].u /= (float)tex->GetTexture()->GetWidth();
481 tVertex[i].v /= (float)tex->GetTexture()->GetHeight();
482 }
483
484 m_Graph2D->DrawQuad(tex->GetTexture(), tVertex, false);
485 return true;
486 }
487
488 /// @brief ��Ⱦ����
489 bool RenderTexture(const char* name, BlendMode blend, f2dGraphics2DVertex vertex[])LNOEXCEPT

Callers 1

RenderMethod · 0.45

Calls 2

FindTextureMethod · 0.80
GetTextureMethod · 0.45

Tested by

no test coverage detected