# Source Code

**URL:** https://forum.defold.com/c/source-code/491.md

[Latest](https://forum.defold.com/latest.md) · [Categories](https://forum.defold.com/categories.md)

---

## [About the Source Code category](https://forum.defold.com/t/about-the-source-code-category/65188)

<div class="topic-metadata">

**Author:** [@britzl](https://forum.defold.com/u/britzl)\
**Replies:** 0

</div>

This is the place to discuss the Defold source code and how to contribute.

---

## [Why \`dm\` prefix?](https://forum.defold.com/t/why-dm-prefix/82318)

<div class="topic-metadata">

**Author:** [@d9k](https://forum.defold.com/u/d9k)\
**Replies:** 1\
**Last updated:** [February 3, 2026, 6:26am UTC](https://forum.defold.com/t/why-dm-prefix/82318 "2026-02-03T06:26:02Z")

</div>

I have a question after reading some of the Defold engine code: Why is the dm prefix used in some places? For example, dmsdk, dmMessage, dmMath?

---

## [Help building Defold?](https://forum.defold.com/t/help-building-defold/66152)

<div class="topic-metadata">

**Author:** [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Replies:** 31\
**Last updated:** [April 17, 2025, 1:17pm UTC](https://forum.defold.com/t/help-building-defold/66152 "2025-04-17T13:17:35Z")

</div>

I am trying to build Defold from source. However, when I run the package/SDK install script with: ./scripts/build.py install\_ext --platform=win32 --package-path=./packages/ It installs a few python packages but eventua…

---

## [Help building the Defold Editor on Windows](https://forum.defold.com/t/help-building-the-defold-editor-on-windows/80281)

<div class="topic-metadata">

**Author:** [@megalanthus](https://forum.defold.com/u/megalanthus)\
**Replies:** 5\
**Last updated:** [April 17, 2025, 8:42am UTC](https://forum.defold.com/t/help-building-the-defold-editor-on-windows/80281 "2025-04-17T08:42:06Z")

</div>

I decided to study deeper how the editor is organized, followed the instructions defold/editor/README\_CURSIVE.md at dev · defold/defold · GitHub. I got to step 8. From a command-line prompt, cd into the defold/editor di…

---

## [Creating a WELD joint after 180º causes sudden jumps/glitches](https://forum.defold.com/t/creating-a-weld-joint-after-180-causes-sudden-jumps-glitches/79558)

<div class="topic-metadata">

**Author:** [@Jay](https://forum.defold.com/u/Jay)\
**Replies:** 3\
**Last updated:** [January 27, 2025, 11:56am UTC](https://forum.defold.com/t/creating-a-weld-joint-after-180-causes-sudden-jumps-glitches/79558 "2025-01-27T11:56:28Z")

</div>

In my game I can enable an upgrade that uses a WELD joint to add an item to the player spaceship. When creating the new object at the right position and rotation, then using physics.create\_joint to WELD it, everything wo…

---

## [Gamepad Hats - what should be possible?](https://forum.defold.com/t/gamepad-hats-what-should-be-possible/79373)

<div class="topic-metadata">

**Author:** [@Jay](https://forum.defold.com/u/Jay)\
**Replies:** 2\
**Last updated:** [January 9, 2025, 11:58am UTC](https://forum.defold.com/t/gamepad-hats-what-should-be-possible/79373 "2025-01-09T11:58:57Z")

</div>

I’m writing a GUI tool to create gamepad mappings from the RAW gamepad input. The detector looks for a single input by counting all the gamepad\_buttons, gamepad\_axis, and gamepad\_hats where math.abs(value) is greater tha…

---

## [Gamepad modifiers - what should be possible?](https://forum.defold.com/t/gamepad-modifiers-what-should-be-possible/79372)

<div class="topic-metadata">

**Author:** [@Jay](https://forum.defold.com/u/Jay)\
**Replies:** 1\
**Last updated:** [January 9, 2025, 11:08am UTC](https://forum.defold.com/t/gamepad-modifiers-what-should-be-possible/79372 "2025-01-09T11:08:37Z")

</div>

In the GDC tool there is a bit of code that infers what modifiers to apply to a gamepad mapping: if (dmMath::Abs(delta) \> 1.5f) driver.m\_Triggers\[i\].m\_Modifiers\[dmInputDDF::GAMEPAD\_MODIFIER\_SCALE\] = true; else if (g…

---

## [Get graphics context from extension](https://forum.defold.com/t/get-graphics-context-from-extension/79250)

<div class="topic-metadata">

**Author:** [@Jay](https://forum.defold.com/u/Jay)\
**Replies:** 17\
**Last updated:** [January 8, 2025, 1:58pm UTC](https://forum.defold.com/t/get-graphics-context-from-extension/79250 "2025-01-08T13:58:22Z")

</div>

I’m trying to write an extension to take screenshots. dmGraphics has all the functionality needed, but it’s not exposed to extensions as far as I can tell. dmGraphics::g\_adapter-\>m\_GetContextCb() should be able to get t…

---

## [How is rive implemented into the engine?](https://forum.defold.com/t/how-is-rive-implemented-into-the-engine/78543)

<div class="topic-metadata">

**Author:** [@llykoi](https://forum.defold.com/u/llykoi)\
**Replies:** 1\
**Last updated:** [October 22, 2024, 2:40am UTC](https://forum.defold.com/t/how-is-rive-implemented-into-the-engine/78543 "2024-10-22T02:40:44Z")

</div>

I’ve been looking at the source code for Defold a little just trying to see how you’ve integrated Rive into the project but I’m unable to find any code that shows how it is done. I’ve just been looking at content and se…

---

## [Building Defold Engine on Windows](https://forum.defold.com/t/building-defold-engine-on-windows/77891)

<div class="topic-metadata">

**Author:** [@object71](https://forum.defold.com/u/object71)\
**Replies:** 17\
**Last updated:** [September 6, 2024, 11:27pm UTC](https://forum.defold.com/t/building-defold-engine-on-windows/77891 "2024-09-06T23:27:41Z")

</div>

I want to try and join in with any contribution I can make on the code side of Defold. I am having trouble setting up the environment, though. I am not familiar with waf, and following the setup and build process leads m…

---

## [Hyper Casual Yandex SDK game example](https://forum.defold.com/t/hyper-casual-yandex-sdk-game-example/69973)

<div class="topic-metadata">

**Author:** [@Alexander\_Bulatov](https://forum.defold.com/u/Alexander_Bulatov)\
**Replies:** 3\
**Last updated:** [September 6, 2024, 8:00pm UTC](https://forum.defold.com/t/hyper-casual-yandex-sdk-game-example/69973 "2024-09-06T20:00:18Z")

</div>

Square Fall - Hyper casual game for yandex The game implements the following functions from the Yandex SDK: Leaderboard The projection is set to Fixed Fit Monetization Copy Protection List of extensions used: defos d…

---

## [Limitations of Defold's open source license](https://forum.defold.com/t/limitations-of-defolds-open-source-license/77600)

<div class="topic-metadata">

**Author:** [@Kios](https://forum.defold.com/u/Kios)\
**Replies:** 3\
**Last updated:** [August 1, 2024, 5:35am UTC](https://forum.defold.com/t/limitations-of-defolds-open-source-license/77600 "2024-08-01T05:35:34Z")

</div>

Hi i have a few questions about the license. In the license it talks about “derivative works” and a “Game Engine Product”. And how you can’t make or comercialize such things with Defold. Now my question is, does that …

---

## [Help building the engine](https://forum.defold.com/t/help-building-the-engine/74687)

<div class="topic-metadata">

**Author:** [@luca.falco](https://forum.defold.com/u/luca.falco)\
**Replies:** 10\
**Last updated:** [October 27, 2023, 11:43pm UTC](https://forum.defold.com/t/help-building-the-engine/74687 "2023-10-27T23:43:22Z")

</div>

I’m trying to build the engine. These are the steps I’ve made ./scripts/build.py shell To paget the packages into a local\_sdks folder ./scripts/package/package\_win32\_sdk.sh ./scripts/build.py --package-path…

---

## [French Translation](https://forum.defold.com/t/french-translation/74085)

<div class="topic-metadata">

**Author:** [@Nightchromatic](https://forum.defold.com/u/Nightchromatic)\
**Replies:** 2\
**Last updated:** [September 16, 2023, 8:17pm UTC](https://forum.defold.com/t/french-translation/74085 "2023-09-16T20:17:41Z")

</div>

Hey everyone! I’m interested in translating your documentation in French. I’m new here, I noticed that the little “fr” is not around. Since it is my native language, I was thinking, why not? But It is my first time doi…

---

## [Custom Defold build for Android](https://forum.defold.com/t/custom-defold-build-for-android/72804)

<div class="topic-metadata">

**Author:** [@Fr1ar](https://forum.defold.com/u/Fr1ar)\
**Replies:** 14\
**Last updated:** [March 17, 2023, 11:17am UTC](https://forum.defold.com/t/custom-defold-build-for-android/72804 "2023-03-17T11:17:11Z")

</div>

Can someone explain to me how to compile a custom Defold build for Android (on Windows)? I’m going to change some OpenGL settings in Defold engine here: https://github.com/defold/defold/blob/dev/engine/glfw/lib/android/…

---

## [Defold Codepad](https://forum.defold.com/t/defold-codepad/65533)

<div class="topic-metadata">

**Author:** [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Replies:** 19\
**Last updated:** [December 11, 2022, 8:01am UTC](https://forum.defold.com/t/defold-codepad/65533 "2022-12-11T08:01:33Z")

</div>

How many of you know about https://godbolt.org/ ? It’s a great site I use a lot to see what different compilers do to the code I write. It’s quite informative. And, perhaps you didn’t know we have a similar tool, for D…

---

## [NE: Updated dmScript::LuaHBuffer constructor](https://forum.defold.com/t/ne-updated-dmscript-luahbuffer-constructor/69931)

<div class="topic-metadata">

**Author:** [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Replies:** 3\
**Last updated:** [December 16, 2021, 7:52am UTC](https://forum.defold.com/t/ne-updated-dmscript-luahbuffer-constructor/69931 "2021-12-16T07:52:41Z")

</div>

A heads up for the native extension authors: We’ve done a small cleanup of the (old) api for the dmScript::LuaHBuffer and as such, some code needs to be updated: # from 1.2.191 dmScript::LuaHBuffer luabuffer = { buffer…

---

## [Compilation issues on Linux (clang++ as CC)](https://forum.defold.com/t/compilation-issues-on-linux-clang-as-cc/69563)

<div class="topic-metadata">

**Author:** [@nkindt](https://forum.defold.com/u/nkindt)\
**Replies:** 18\
**Last updated:** [November 1, 2021, 7:20am UTC](https://forum.defold.com/t/compilation-issues-on-linux-clang-as-cc/69563 "2021-11-01T07:20:40Z")

</div>

Hi, trying to build Defold on Linux i am running into following problem: The recognized C compiler is always clang++ and the compilation process stops with errors as soon as any C lib is compiled with clang++ (obviousl…

---

## [How is audio exactly implemented?](https://forum.defold.com/t/how-is-audio-exactly-implemented/66655)

<div class="topic-metadata">

**Author:** [@hakoptak](https://forum.defold.com/u/hakoptak)\
**Replies:** 19\
**Last updated:** [October 7, 2021, 7:03am UTC](https://forum.defold.com/t/how-is-audio-exactly-implemented/66655 "2021-10-07T07:03:59Z")

</div>

Hi all, I’m new to Defold and I’d like to contribute to the engine, especially to its audio implementation on Android and iOS. But I have a hard time figuring out how audio is implemented in Defold. First of all: it se…

---

## [Make a progress bar in Defold](https://forum.defold.com/t/make-a-progress-bar-in-defold/68540)

<div class="topic-metadata">

**Author:** [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Replies:** 2\
**Last updated:** [May 28, 2021, 6:04pm UTC](https://forum.defold.com/t/make-a-progress-bar-in-defold/68540 "2021-05-28T18:04:42Z")

</div>

Hey !!! I made a project that shows 3 ways to make a progress bar. In this project, there will be three different approaches : The player life bar (file: progress\_box). Will allow…

---

## [Working with tests in Defold engine](https://forum.defold.com/t/working-with-tests-in-defold-engine/68517)

<div class="topic-metadata">

**Author:** [@otsakir](https://forum.defold.com/u/otsakir)\
**Replies:** 0\
**Last updated:** [May 26, 2021, 6:01am UTC](https://forum.defold.com/t/working-with-tests-in-defold-engine/68517 "2021-05-26T06:01:43Z")

</div>

Hello! I’m starting a thread about ways to write tests in defold. As a contrubutor, i tend to spend much more time trying to figure out how to write the test for a feature than for the feature itself. Cutting to the c…

---

## [Fast buffer copy from string](https://forum.defold.com/t/fast-buffer-copy-from-string/67987)

<div class="topic-metadata">

**Author:** [@dlannan](https://forum.defold.com/u/dlannan)\
**Replies:** 2\
**Last updated:** [April 1, 2021, 5:55pm UTC](https://forum.defold.com/t/fast-buffer-copy-from-string/67987 "2021-04-01T17:55:55Z")

</div>

Before I go and write one (because Im very lazy).. has anyone written a little native copy function to effectively do the below: local buff = buffer.create(v.res.width \* v.res.height, { { name=hash(v.res.type), …

---

## [Help building editor on Mac, Python 3 required?](https://forum.defold.com/t/help-building-editor-on-mac-python-3-required/67661)

<div class="topic-metadata">

**Author:** [@beldenfox](https://forum.defold.com/u/beldenfox)\
**Replies:** 8\
**Last updated:** [March 1, 2021, 4:58pm UTC](https://forum.defold.com/t/help-building-editor-on-mac-python-3-required/67661 "2021-03-01T16:58:46Z")

</div>

I’m trying to build the editor on my Mac running Big Sur. When I try to grab external packages: python2 ./scripts/build.py install\_ext --platform=x86\_64-darwin --package-path=./mystuff I end up seeing lot of Python syn…

---

## [Clojure Learning Resources + Post Your Clojure Insights](https://forum.defold.com/t/clojure-learning-resources-post-your-clojure-insights/65375)

<div class="topic-metadata">

**Author:** [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Replies:** 2\
**Last updated:** [February 16, 2021, 7:44am UTC](https://forum.defold.com/t/clojure-learning-resources-post-your-clojure-insights/65375 "2021-02-16T07:44:13Z")

</div>

Now that the source is available, it is time for some of us more to gitgud with Clojure so that we can contribute to improving the editor! Official series by @mats.gisselson https://www.youtube.com/playlist?list=PLXsXu…

---

## [Working on the editor - Iterating quickly](https://forum.defold.com/t/working-on-the-editor-iterating-quickly/67469)

<div class="topic-metadata">

**Author:** [@otsakir](https://forum.defold.com/u/otsakir)\
**Replies:** 2\
**Last updated:** [February 5, 2021, 11:03pm UTC](https://forum.defold.com/t/working-on-the-editor-iterating-quickly/67469 "2021-02-05T23:03:17Z")

</div>

Hello, I’m trying to fine-tune the UI of the sound component and i’m experimenting with the SoundNode and its properties. I’m using value, set, dynamic error clauses etc. to improve the UX. I’m using Cursive in intelli…

---

## [Working on the editor - the g/fnk macro](https://forum.defold.com/t/working-on-the-editor-the-g-fnk-macro/67457)

<div class="topic-metadata">

**Author:** [@otsakir](https://forum.defold.com/u/otsakir)\
**Replies:** 4\
**Last updated:** [February 4, 2021, 9:14am UTC](https://forum.defold.com/t/working-on-the-editor-the-g-fnk-macro/67457 "2021-02-04T09:14:58Z")

</div>

Can someone explain what is this fnk clojure macro in ns dynamo.graph? It’s defined in dynamo/graph.clj. It’s used all over the place but its definition is kind of cryptic. I’ve come across this on a sound issue i’m w…

---

## [First contribution](https://forum.defold.com/t/first-contribution/67158)

<div class="topic-metadata">

**Author:** [@wootr0p](https://forum.defold.com/u/wootr0p)\
**Replies:** 3\
**Last updated:** [January 3, 2021, 8:12pm UTC](https://forum.defold.com/t/first-contribution/67158 "2021-01-03T20:12:30Z")

</div>

Hello! I’m new to Defold, but I like so much his philosophy, style and community. I’m 26 and I’m a software developer and I would like to contribute in some manner to the project… Unluckily I never contribute to a pro…

---

## [Defold engine code overview](https://forum.defold.com/t/defold-engine-code-overview/67119)

<div class="topic-metadata">

**Author:** [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 10:23am UTC](https://forum.defold.com/t/defold-engine-code-overview/67119 "2020-12-30T10:23:37Z")

</div>

I wrote an overview of the Defold engine code. This first part is quite high level, but should serve as a first primer to what is currently in the engine. If there are any special areas you wish to know more about, le…

---

## [Error while tried to build defold engine](https://forum.defold.com/t/error-while-tried-to-build-defold-engine/66251)

<div class="topic-metadata">

**Author:** [@gmvbif](https://forum.defold.com/u/gmvbif)\
**Replies:** 8\
**Last updated:** [September 8, 2020, 3:24pm UTC](https://forum.defold.com/t/error-while-tried-to-build-defold-engine/66251 "2020-09-08T15:24:10Z")

</div>

I’m using ubuntu 20.4 and trying to build engine for linux. I have an error while ./scripts/build.py install\_ext commands run. The last lines looks like this Downloading my/clang%2Bllvm-9.0.0-x86\_64-linux-gnu-ubuntu-…

---

## [Attempting to build wasm-web version of engine](https://forum.defold.com/t/attempting-to-build-wasm-web-version-of-engine/66227)

<div class="topic-metadata">

**Author:** [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Replies:** 4\
**Last updated:** [September 6, 2020, 8:12am UTC](https://forum.defold.com/t/attempting-to-build-wasm-web-version-of-engine/66227 "2020-09-06T08:12:00Z")

</div>

I’m struggling right now to build the wasm-web version of the engine. I was able to build the PC version without issues (although I hadn’t tried swapping it out as I don’t have issues in my game with the PC version yet a…

[Next page](https://forum.defold.com/c/source-code/491.md?page=1)
