MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / renderQuad

Method renderQuad

Common/rendercheck_gl.h:1043–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041 }
1042
1043 virtual void renderQuad(int width, int height, GLenum eTarget) {
1044 float width_norm = (float)width / (float)m_Width,
1045 height_norm = (float)height / (float)m_Height;
1046
1047 // Bind the FBO texture for the display path
1048 glBindTexture(eTarget, m_fboData.colorTex);
1049
1050 glGenerateMipmapEXT(GL_TEXTURE_2D);
1051 glBindTexture(eTarget, 0);
1052
1053 // now render to the full screen using this texture
1054 glClearColor(0.2f, 0.2f, 0.2f, 0.0f);
1055 glClear(GL_COLOR_BUFFER_BIT);
1056
1057 glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_textureProgram);
1058 glEnable(GL_FRAGMENT_PROGRAM_ARB);
1059 glDisable(GL_DEPTH_TEST);
1060
1061 glBegin(GL_QUADS);
1062 {
1063 glVertex2f(0.0f, 0.0f);
1064 glTexCoord2f(0.0f, 0.0f);
1065 glVertex2f(0.0f, height_norm);
1066 glTexCoord2f(width_norm, 0.0f);
1067 glVertex2f(width_norm, height_norm);
1068 glTexCoord2f(width_norm, height_norm);
1069 glVertex2f(width_norm, 0.0f);
1070 glTexCoord2f(0.0f, height_norm);
1071 }
1072 glEnd();
1073
1074 // Release the FBO texture (finished rendering)
1075 glBindTexture(eTarget, 0);
1076 }
1077
1078 // bind to the Fragment Program
1079 void bindFragmentProgram() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected