MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / DrawQuad

Function DrawQuad

engine/src/rendertarget.cpp:121–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void DrawQuad(RenderTarget dst, unsigned int texture, ScreenRect* psrcRect, ScreenRect* pdstRect, unsigned int shader)
122{
123 glBindFramebuffer(GL_FRAMEBUFFER, dst.fbo);
124 glUseProgramObjectARB(shader);
125 glBindTexture(GL_TEXTURE_2D, texture);
126 glBegin(GL_QUADS);
127 glTexCoord2d(psrcRect->fLeft(), psrcRect->fBottom()); glVertex2f(pdstRect->fLeft(), pdstRect->fTop());
128 glTexCoord2d(psrcRect->fRight(), psrcRect->fBottom()); glVertex2f(pdstRect->fRight(), pdstRect->fTop());
129 glTexCoord2d(psrcRect->fRight(), psrcRect->fTop()); glVertex2f(pdstRect->fRight(), pdstRect->fBottom());
130 glTexCoord2d(psrcRect->fLeft(), psrcRect->fTop()); glVertex2f(pdstRect->fLeft(), pdstRect->fBottom());
131 glEnd();
132}

Callers 3

R_renderFunction · 0.85
R_drawMenusFunction · 0.85
R_drawSelectedMenuItemFunction · 0.85

Calls 4

fLeftMethod · 0.80
fBottomMethod · 0.80
fTopMethod · 0.80
fRightMethod · 0.80

Tested by

no test coverage detected