Esempio n. 1
0
////////////////////////////////////////////////////////////////////////////////
//! Keyboard events handler
////////////////////////////////////////////////////////////////////////////////
void
keyboard( unsigned char key, int /*x*/, int /*y*/) {

    switch( key) {
    case( 27) :
        deletePBO( &pbo_source);
        deletePBO( &pbo_dest);
        deleteFBO( &fbo, &tex_fbo);
        deleteTexture( &tex_screen);
        exit( 0);
    case ' ':
        enable_cuda ^= 1;
        break;
    case 'a':
        animate ^= 1;
        break;
    case '=':
    case '+':
        if (blur_radius < 16) blur_radius++;
        printf("radius = %d\n", blur_radius);
        break;
    case '-':
        if (blur_radius > 1) blur_radius--;
        printf("radius = %d\n", blur_radius);
        break;
    }
}
Esempio n. 2
0
void cleanupCuda() {
    if (pbo) {
        deletePBO(&pbo);
    }
    if (displayImage) {
        deleteTexture(&displayImage);
    }
}
void cleanupCUDA() {
    if (m_pbo) {
        deletePBO(&m_pbo);
    }
    if (m_image) {
        deleteTexture(&m_image);
    }
}
// Function to clean up and exit
//*****************************************************************************
void Cleanup(int iExitCode)
{
    // Cleanup allocated objects
    shrLog("\nStarting Cleanup...\n\n");
    if(pbo_source)deletePBO(&pbo_source);
    if(pbo_dest)deletePBO(&pbo_dest);
    if(tex_screen)deleteTexture(&tex_screen);
	if(ckKernel)clReleaseKernel(ckKernel); 
    if(cpProgram)clReleaseProgram(cpProgram);
    if(cl_pbos[0])clReleaseMemObject(cl_pbos[0]);
    if(cl_pbos[1])clReleaseMemObject(cl_pbos[1]);    
    if(cqCommandQueue)clReleaseCommandQueue(cqCommandQueue);
    if(cxGPUContext)clReleaseContext(cxGPUContext);

    shrLogEx(LOGBOTH | CLOSELOG, 0, "%s Exiting...\n", cExecutableName);

    // finalize logs and leave
    shrQAFinish2(bQATest, *pArgc, (const char **)pArgv, (iExitCode == 0) ? QA_PASSED : QA_FAILED);
    exit (iExitCode);
}
Esempio n. 5
0
void cleanupCuda(){
  if(pbo) deletePBO(&pbo);
  if(image) deleteTexture(&image);
}
Esempio n. 6
0
void cleanupCuda()
{
  if(pbo) deletePBO(&pbo);
  if(textureID) deleteTexture(&textureID);
}
Esempio n. 7
0
void cleanupCuda() {
	delete[] keyPressed;

	if (pbo) deletePBO(&pbo);
	if (textureID) deleteTexture(&textureID);
}