# glutMainLoop() excutes what?

**URL:** <https://forums.developer.nvidia.com/t/glutmainloop-excutes-what/2269>\
**Category:** CUDA Programming and Performance\
**Created:** [January 8, 2008, 7:22am UTC](https://forums.developer.nvidia.com/t/glutmainloop-excutes-what/2269 "2008-01-08T07:22:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanbean\_Youn](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Hanbean\_Youn](https://forums.developer.nvidia.com/u/Hanbean_Youn)\
**Post date:** [January 8, 2008, 7:22am UTC](https://forums.developer.nvidia.com/t/glutmainloop-excutes-what/2269/1 "2008-01-08T07:22:59Z")

</div>

I’m trying to solve sample code “SobelFilter”.

Now…I could understand how to process each sub function.

But in the main function main(), what function is excuted by glutMainLoop()?

I think the main loop is included at SobelFilter\_Kernels.cu, but I can understand how to connect algorithmic subfunction and glutMainLoop().

I searched website for glutMainLoop(). but I can’t understand it.

Does gerneral form like glutMainLoop(CallBacks)??

Other functions are formed as glutKeyboardFunc(Keyborard)…

Plz give me some hint…

Thanx

---

<div class="post-metadata">

**Author:** ![Simon\_Green](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Simon\_Green](https://forums.developer.nvidia.com/u/Simon_Green)\
**Post date:** [January 8, 2008, 5:12pm UTC](https://forums.developer.nvidia.com/t/glutmainloop-excutes-what/2269/2 "2008-01-08T17:12:27Z")

</div>

This isn’t really a CUDA question, but glutMainLoop basically runs the callback functions defined by glutDisplayFunc() etc. in main. The main display function “display()” gets called every time the display needs to be updated.

GLUT documentation is here:  
[url=“[http://www.opengl.org/documentation/specs/glut/spec3/spec3.html](http://www.opengl.org/documentation/specs/glut/spec3/spec3.html)”][http://www.opengl.org/documentation/specs/...pec3/spec3.html[/url]](http://www.opengl.org/documentation/specs/...pec3/spec3.html%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Hanbean\_Youn](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Hanbean\_Youn](https://forums.developer.nvidia.com/u/Hanbean_Youn)\
**Post date:** [January 9, 2008, 1:10am UTC](https://forums.developer.nvidia.com/t/glutmainloop-excutes-what/2269/3 "2008-01-09T01:10:31Z")

</div>

> [@](#):
>
> This isn’t really a CUDA question, but glutMainLoop basically runs the callback functions defined by glutDisplayFunc() etc. in main. The main display function “display()” gets called every time the display needs to be updated.
> 
> GLUT documentation is here:
> 
> http://www.opengl.org/documentation/specs/…pec3/spec3.html
> 
> [snapback]306956[/snapback]

Thank you for your kindness!!

Best regards…
