# Can I call global functions from a Thread?

**URL:** <https://discourse.libsdl.org/t/can-i-call-global-functions-from-a-thread/3454>\
**Category:** SDL Development\
**Created:** [November 11, 2000, 6:15am UTC](https://discourse.libsdl.org/t/can-i-call-global-functions-from-a-thread/3454 "2000-11-11T06:15:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Gregorio](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/f07891/32.png) [@Jeremy\_Gregorio](https://discourse.libsdl.org/u/Jeremy_Gregorio)\
**Post date:** [November 11, 2000, 6:15am UTC](https://discourse.libsdl.org/t/can-i-call-global-functions-from-a-thread/3454/1 "2000-11-11T06:15:32Z")

</div>

I’m trying to move the calls to DrawTiles() in my little scroll app to  
a thread. Can I call DrawTiles() directly or do I need to pass a pointer (which  
would be bad since I’ve forgotten how to call a function with it’s pointer 🙂  
). Thanks in advance!–  
Jeremy Gregorio  
jgreg at [azstarnet.com](http://azstarnet.com)

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [November 11, 2000, 6:14pm UTC](https://discourse.libsdl.org/t/can-i-call-global-functions-from-a-thread/3454/2 "2000-11-11T18:14:55Z")

</div>

> I’m trying to move the calls to DrawTiles() in my little scroll app to  
> a thread. Can I call DrawTiles() directly or do I need to pass a pointer (which  
> would be bad since I’ve forgotten how to call a function with it’s pointer 🙂  
> ). Thanks in advance!

I would recommend doing all your drawing and event handling in the main  
thread.

See ya!  
-Sam Lantinga, Lead Programmer, Loki Entertainment Software
