Skip to content

Instantly share code, notes, and snippets.

@rajan9519
Last active April 28, 2020 06:05
Show Gist options
  • Select an option

  • Save rajan9519/1cd8382dd6af94f75a3dd67a4fd4f889 to your computer and use it in GitHub Desktop.

Select an option

Save rajan9519/1cd8382dd6af94f75a3dd67a4fd4f889 to your computer and use it in GitHub Desktop.
void visual(int* arr){
glClear(GL_COLOR_BUFFER_BIT); // sets the previous background with the current background
drawBitmapString(400,570,sortName);
drawBitmapString(400,550,"Number of Compares:"+std::to_string(compares));
drawBitmapString(400,530,"Number of Exchanges:"+std::to_string(exchanges));
glColor3f(1.0f,0.0f,0.0f); //red
// drawing bars on the screen by diagonal coordinates
for(int i=0;i<N;i++){
glRecti(4*i,0,4*i+3,arr[i]);
}
glFlush();
usleep(150);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment