# Can anyone help with ANuklear?

**URL:** https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967
**Category:** General
**Created:** [July 7, 2024, 9:23am UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967 "2024-07-07T09:23:42Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 9:23am UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/1 "2024-07-07T09:23:42Z")

</div>

I’ve been trying to port the sdl\_renderer demo in the Nuklear repo, but I get the following:

 ![image](https://forum.ada-lang.io/uploads/default/original/1X/987bc8da7669011e8728dd231101a3f070dcc76e.png)

This is what it should look like (this is the C demo):

 ![image](https://forum.ada-lang.io/uploads/default/original/1X/1c9a715277cf9cc34125aa4f7538e55a5528101b.png)

> “I’ve seen that before when font loading messed up”
> 
> From the very slooooow discord.

If anyone can help work out why the built-in font isn’t working right, I’d be happy

> **[GitHub - ada-game-framework/anuklear: Ada bindings to the Nuklear UI library.](https://github.com/ada-game-framework/anuklear)**
>
> Ada bindings to the Nuklear UI library. Contribute to ada-game-framework/anuklear development by creating an account on GitHub.

> **[GitHub - ada-game-framework/anuklear\_examples: Test programs for ANuklear.](https://github.com/ada-game-framework/anuklear_examples)**
>
> Test programs for ANuklear. Contribute to ada-game-framework/anuklear\_examples development by creating an account on GitHub.

To build with alr, just change the pins to the url versions to get the latest from sdlada git.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 10:20am UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/2 "2024-07-07T10:20:55Z")

</div>

Seems the font.texture element is missing from my record, even though it’s there.

```ada
   type nk_font;
   type nk_font is record
      next : access nk_font; -- ./Nuklear/nuklear.h:4091
      handle : aliased nk_user_font; -- ./Nuklear/nuklear.h:4092
      info : aliased nk_baked_font; -- ./Nuklear/nuklear.h:4093
      scale : aliased float; -- ./Nuklear/nuklear.h:4094
      glyphs : access nk_font_glyph; -- ./Nuklear/nuklear.h:4095
      fallback : access constant nk_font_glyph; -- ./Nuklear/nuklear.h:4096
      fallback_codepoint : aliased nk_rune; -- ./Nuklear/nuklear.h:4097
      texture : aliased nk_handle; -- ./Nuklear/nuklear.h:4098
      config : access nk_font_config; -- ./Nuklear/nuklear.h:4099
   end record
   with Convention => C_Pass_By_Copy; -- ./Nuklear/nuklear.h:4090

```

![Image](https://media.discordapp.net/attachments/922234432071548973/1259453957621813318/image.png?ex=668bbd67&is=668a6be7&hm=3c0ce571f895546f713a5c48464761a2459cb84947578a9d41699b9b7975d113&=&format=webp&quality=lossless&width=546&height=546)

 ![image](https://forum.ada-lang.io/uploads/default/original/1X/2fee60c771726efe06761c660235d4d0db37342d.png)  
 ![image](https://forum.ada-lang.io/uploads/default/original/1X/97676fec6f23c858226a97993d1179edf80e845d.png)

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 10:27am UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/3 "2024-07-07T10:27:17Z")

</div>

It seems the compiler has optimised out the nk\_handle object and inlined it’s contents, ptr/id fields. Anyone seen this before?

---

<div class="post-metadata">

### Author: ![mgrojo](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/mgrojo/32/15_2.png) [@mgrojo](https://forum.ada-lang.io/u/mgrojo)
#### Post date: [July 7, 2024, 11:32am UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/4 "2024-07-07T11:32:05Z")

</div>

I wouldn’t trust the debugger, since it is giving inconsistent information. Is the code optimized? Couldn’t you turn off optimization to see if it changes anything?

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 12:03pm UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/5 "2024-07-07T12:03:36Z")

</div>

Fixed it, Defining NK\_UINT\_DRAW\_INDEX as per the docs, does not work.

 ![image](https://forum.ada-lang.io/uploads/default/original/1X/5a30db2645b152949cff9c8735a6540ad6eb1245.png)

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 3:20pm UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/6 "2024-07-07T15:20:13Z")

</div>

[![](https://i.imgur.com/NlJFX1S.png) ](https://i.imgur.com/NlJFX1S.png)

Not nice to use, but it works.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 4:21pm UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/7 "2024-07-07T16:21:29Z")

</div>

Added a post on [reddit](https://www.reddit.com/r/ada/comments/1dxjmm5/anuklear_works_but_needs_help/)

---

<div class="post-metadata">

### Author: ![Verisimilitude](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/verisimilitude/32/384_2.png) [@Verisimilitude](https://forum.ada-lang.io/u/Verisimilitude)
#### Post date: [July 7, 2024, 8:58pm UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/8 "2024-07-07T20:58:01Z")

</div>

This is the first time I’ve seen `C_Pass_By_Copy`. Is that nonstandard, or new? I’m curious as to why it exists.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [July 7, 2024, 9:57pm UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/9 "2024-07-07T21:57:23Z")

</div>

Seems to be the standard way C passes structs to functions.

---

<div class="post-metadata">

### Author: ![jere](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jere/32/87_2.png) [@jere](https://forum.ada-lang.io/u/jere)
#### Post date: [July 7, 2024, 10:38pm UTC](https://forum.ada-lang.io/t/can-anyone-help-with-anuklear/967/10 "2024-07-07T22:38:52Z")

</div>

> [@Verisimilitude](#):
>
> This is the first time I’ve seen `C_Pass_By_Copy`. Is that nonstandard, or new? I’m curious as to why it exists.

It was a GNAT extension up to Ada95. The language spec added it officially for Ada2005
