// Takes a path and file name like "C:\Folder\Program.exe" and a name like "My Program" // Makes sure the program is listed in Windows Firewall and its listing is checked, adding and checking it as necessary // Returns true if the program is listed and checked, false if we weren't able to do it // When bRemove is TRUE, it removes the application from the exception list BOOL CFirewall::SetupProgram( const CString& path, const CString& name, BOOL bRemove ) { // Make sure the COM interfaces have been accessed //if ( ! FwManager ) return FALSE; // If the program isn't on the Windows Firewall exceptions list BOOL bListed = FALSE; if ( ! IsProgramListed( path, &bListed ) ) return FALSE; if ( ! bListed && ! bRemove ) { // Add it to the list with a checked checkbox if ( ! AddProgram( path, name ) ) return FALSE; } else if ( bListed && bRemove ) { if ( ! RemoveProgram( path ) ) return FALSE; return TRUE; } // If the program is on the list, but its checkbox isn't checked BOOL bEnabled = FALSE; if ( ! IsProgramEnabled( path, &bEnabled ) ) return FALSE; if ( ! bEnabled ) { // Check the checkbox if ( ! EnableProgram( path ) ) return FALSE; } // The program is listed and checked return TRUE; }
void DrawTexture::DrawBarrelDistortion(bool leftEye) const { glBindVertexArray(fVao); auto shader = Shaders::BarrelDistortion::Make(); shader->EnableProgram(); shader->ConfigureEye(leftEye); glm::mat4 scale = glm::scale(glm::mat4(1), glm::vec3(2,2,1)); glm::mat4 transl = glm::translate(glm::mat4(1), glm::vec3(-1, -1, 0)); shader->ModelView(transl * scale); this->DrawBasic(); shader->DisableProgram(); glBindVertexArray(0); }