Giter Club home page Giter Club logo

Comments (49)

Jebbs avatar Jebbs commented on June 8, 2024

Do you get an error output in the console for the font?

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I did get text to draw before I uploaded that code, so I wonder if something broke later.

In any case, I do get an invalid memory error on my end when using a Font object which may explain your crash. I'll get this fixed too!

This is what happens when I don't write unit tests as soon as I write the code. :P

from dsfml.

aubade avatar aubade commented on June 8, 2024

Here's what the output looked like:

rdmd -I/home/redacted/Devel/git/ICE/ICE/Libraries -L-ldsfml-system -L-ldsfml-graphics -L-ldsfml-window test.d 
Destroying Text
*** Error in `/tmp/.rdmd-1000/rdmd-test.d-4AAE0106B697DDA071C44F14C979CAE4/test': free(): invalid pointer: 0x00000000012d1e58 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x80a46)[0x7f380ade9a46]
/tmp/.rdmd-1000/rdmd-test.d-4AAE0106B697DDA071C44F14C979CAE4/test(_D5dsfml8graphics7texture7Texture6__dtorMFZv+0x11)[0x44d41d]
======= Memory map: ========
00400000-00493000 r-xp 00000000 08:01 3014743                            /tmp/.rdmd-1000/rdmd-test.d-4AAE0106B697DDA071C44F14C979CAE4/test
00692000-00693000 r--p 00092000 08:01 3014743                            /tmp/.rdmd-1000/rdmd-test.d-4AAE0106B697DDA071C44F14C979CAE4/test
00693000-006c0000 rw-p 00093000 08:01 3014743                            /tmp/.rdmd-1000/rdmd-test.d-4AAE0106B697DDA071C44F14C979CAE4/test
01089000-013be000 rw-p 00000000 00:00 0                                  [heap]
41079000-41117000 rw-p 00000000 00:00 0 
41610000-416ae000 rw-p 00000000 00:00 0 
41742000-41744000 r-xs 00000000 08:01 3014717                            /tmp/gl8B9BXC (deleted)
7f3804082000-7f3804482000 rw-s 153def000 00:05 12603                     /dev/nvidia0
7f3804482000-7f3804882000 rw-s 1547e8000 00:05 12603                     /dev/nvidia0
7f3804882000-7f3804a82000 rw-s 1547f3000 00:05 12603                     /dev/nvidia0
7f3804a82000-7f3804b41000 r--p 00000000 08:11 779687                     /home/redacted/Devel/arial.ttf
7f3804c0a000-7f3804c0f000 r-xp 00000000 08:01 3282528                    /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f3804c0f000-7f3804e0e000 ---p 00005000 08:01 3282528                    /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f3804e0e000-7f3804e0f000 r--p 00004000 08:01 3282528                    /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f3804e0f000-7f3804e10000 rw-p 00005000 08:01 3282528                    /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f3804e10000-7f3804e19000 r-xp 00000000 08:01 3282532                    /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f3804e19000-7f3805019000 ---p 00009000 08:01 3282532                    /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f3805019000-7f380501a000 r--p 00009000 08:01 3282532                    /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f380501a000-7f380501b000 rw-p 0000a000 08:01 3282532                    /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f3805053000-7f380511c000 rw-p 00000000 00:00 0 
7f380511c000-7f380531c000 rw-s 153803000 00:05 12603                     /dev/nvidia0
7f380531c000-7f380551c000 rw-s 153172000 00:05 12603                     /dev/nvidia0
7f380551c000-7f380571c000 rw-s 153271000 00:05 12603                     /dev/nvidia0
7f380571c000-7f380581c000 rw-s 153cf2000 00:05 12603                     /dev/nvidia0
7f380581c000-7f3805823000 rw-s 153f03000 00:05 12603                     /dev/nvidia0
7f3805823000-7f3805843000 rw-s d80e0000 00:05 12603                      /dev/nvidia0
7f3805843000-7f3805883000 rw-s 153f1f000 00:05 12603                     /dev/nvidia0
7f3805883000-7f38058c3000 rw-s 153cd8000 00:05 12603                     /dev/nvidia0
7f38058c3000-7f3805a44000 rw-p 00000000 00:00 0 
7f3805a44000-7f3805acc000 rw-s 2ecf44000 00:05 12603                     /dev/nvidia0
7f3805acc000-7f3805ad1000 r-xp 00000000 08:01 3284440                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f3805ad1000-7f3805cd0000 ---p 00005000 08:01 3284440                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f3805cd0000-7f3805cd1000 r--p 00004000 08:01 3284440                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f3805cd1000-7f3805cd2000 rw-p 00005000 08:01 3284440                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f3805cd2000-7f3805cd4000 r-xp 00000000 08:01 3284427                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f3805cd4000-7f3805ed4000 ---p 00002000 08:01 3284427                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f3805ed4000-7f3805ed5000 r--p 00002000 08:01 3284427                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f3805ed5000-7f3805ed6000 rw-p 00003000 08:01 3284427                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f3805ed6000-7f3805edf000 r-xp 00000000 08:01 3282530                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f3805edf000-7f38060de000 ---p 00009000 08:01 3282530                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f38060de000-7f38060df000 r--p 00008000 08:01 3282530                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f38060df000-7f38060e0000 rw-p 00009000 08:01 3282530                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f38060e0000-7f38060fd000 r-xp 00000000 08:01 3279808                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f38060fd000-7f38062fc000 ---p 0001d000 08:01 3279808                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f38062fc000-7f38062fd000 r--p 0001c000 08:01 3279808                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f38062fd000-7f38062fe000 rw-p 0001d000 08:01 3279808                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f38062fe000-7f3806301000 r-xp 00000000 08:01 265967                     /lib/x86_64-linux-gnu/libdl-2.17.so
7f3806301000-7f3806500000 ---p 00003000 08:01 265967                     /lib/x86_64-linux-gnu/libdl-2.17.so
7f3806500000-7f3806501000 r--p 00002000 08:01 265967                     /lib/x86_64-linux-gnu/libdl-2.17.so
7f3806501000-7f3806502000 rw-p 00003000 08:01 265967                     /lib/x86_64-linux-gnu/libdl-2.17.so
7f3806502000-7f3806513000 r-xp 00000000 08:01 3282520                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f3806513000-7f3806712000 ---p 00011000 08:01 3282520                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f3806712000-7f3806713000 r--p 00010000 08:01 3282520                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f3806713000-7f3806714000 rw-p 00011000 08:01 3282520                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f3806714000-7f3808194000 r-xp 00000000 08:01 4719299                    /usr/lib/nvidia-325/libnvidia-glcore.so.325.15
7f3808194000-7f3808394000 ---p 01a80000 08:01 4719299                    /usr/lib/nvidia-325/libnvidia-glcore.so.325.15
7f3808394000-7f3808ddb000 rwxp 01a80000 08:01 4719299                    /usr/lib/nvidia-325/libnvidia-glcore.so.325.15
7f3808ddb000-7f3808df4000 rwxp 00000000 00:00 0 
7f3808df4000-7f3808df7000 r-xp 00000000 08:01 4719210                    /usr/lib/nvidia-325/tls/libnvidia-tls.so.325.15
7f3808df7000-7f3808ff6000 ---p 00003000 08:01 4719210                    /usr/lib/nvidia-325/tls/libnvidia-tls.so.325.15
7f3808ff6000-7f3808ff7000 rw-p 00002000 08:01 4719210                    /usr/lib/nvidia-325/tls/libnvidia-tls.so.325.15
7f3808ff7000-7f380900d000 r-xp 00000000 08:01 266105                     /lib/x86_64-linux-gnu/libz.so.1.2.7
7f380900d000-7f380920c000 ---p 00016000 08:01 266105                     /lib/x86_64-linux-gnu/libz.so.1.2.7
7f380920c000-7f380920d000 r--p 00015000 08:01 266105                     /lib/x86_64-linux-gnu/libz.so.1.2.7
7f380920d000-7f380920e000 rw-p 00016000 08:01 266105                     /lib/x86_64-linux-gnu/libz.so.1.2.7
7f380920e000-7f3809217000 r-xp 00000000 08:01 3282538                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f3809217000-7f3809416000 ---p 00009000 08:01 3282538                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f3809416000-7f3809417000 r--p 00008000 08:01 3282538                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f3809417000-7f3809418000 rw-p 00009000 08:01 3282538                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f3809418000-7f380954c000 r-xp 00000000 08:01 3278595                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f380954c000-7f380974c000 ---p 00134000 08:01 3278595                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f380974c000-7f380974d000 r--p 00134000 08:01 3278595                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f380974d000-7f3809752000 rw-p 00135000 08:01 3278595                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f3809752000-7f380982b000 r-xp 00000000 08:01 4719272                    /usr/lib/nvidia-325/libGL.so.325.15
7f380982b000-7f3809a2a000 ---p 000d9000 08:01 4719272                    /usr/lib/nvidia-325/libGL.so.325.15
7f3809a2a000-7f3809a6a000 rwxp 000d8000 08:01 4719272                    /usr/lib/nvidia-325/libGL.so.325.15
7f3809a6a000-7f3809a80000 rwxp 00000000 00:00 0 
7f3809a80000-7f3809abf000 r-xp 00000000 08:01 3285046                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f3809abf000-7f3809cbf000 ---p 0003f000 08:01 3285046                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f3809cbf000-7f3809cc0000 r--p 0003f000 08:01 3285046                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f3809cc0000-7f3809cc1000 rw-p 00040000 08:01 3285046                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f3809cc1000-7f3809cd1000 rw-p 00000000 00:00 0 
7f3809cd1000-7f3809d49000 r-xp 00000000 08:01 3284319                    /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8.0
7f3809d49000-7f3809f48000 ---p 00078000 08:01 3284319                    /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8.0
7f3809f48000-7f3809f4e000 r--p 00077000 08:01 3284319                    /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8.0
7f3809f4e000-7f3809f4f000 rw-p 0007d000 08:01 3284319                    /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8.0
7f3809f4f000-7f3809f53000 rw-p 00000000 00:00 0 
7f3809f53000-7f3809fea000 r-xp 00000000 08:01 3278956                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.10.0
7f3809fea000-7f380a1e9000 ---p 00097000 08:01 3278956                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.10.0
7f380a1e9000-7f380a1ef000 r--p 00096000 08:01 3278956                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.10.0
7f380a1ef000-7f380a1f0000 rw-p 0009c000 08:01 3278956                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.10.0
7f380a1f0000-7f380a204000 r-xp 00000000 08:01 3286100                    /usr/lib/libsfml-window.so.2.1
7f380a204000-7f380a404000 ---p 00014000 08:01 3286100                    /usr/lib/libsfml-window.so.2.1
7f380a404000-7f380a405000 r--p 00014000 08:01 3286100                    /usr/lib/libsfml-window.so.2.1
7f380a405000-7f380a406000 rw-p 00015000 08:01 3286100                    /usr/lib/libsfml-window.so.2.1
7f380a406000-7f380a442000 r-xp 00000000 08:01 3298446                    /usr/lib/libsfml-graphics.so.2.1
7f380a442000-7f380a642000 ---p 0003c000 08:01 3298446                    /usr/lib/libsfml-graphics.so.2.1
7f380a642000-7f380a643000 r--p 0003c000 08:01 3298446                    /usr/lib/libsfml-graphics.so.2.1
7f380a643000-7f380a644000 rw-p 0003d000 08:01 3298446                    /usr/lib/libsfml-graphics.so.2.1
7f380a644000-7f380a645000 rw-p 00000000 00:00 0 
7f380a645000-7f380a65a000 r-xp 00000000 08:01 263272                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f380a65a000-7f380a859000 ---p 00015000 08:01 263272                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f380a859000-7f380a85a000 r--p 00014000 08:01 263272                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f380a85a000-7f380a85b000 rw-p 00015000 08:01 263272                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f380a85b000-7f380a941000 r-xp 00000000 08:01 3279348                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18
7f380a941000-7f380ab40000 ---p 000e6000 08:01 3279348                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18
7f380ab40000-7f380ab48000 r--p 000e5000 08:01 3279348                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18
7f380ab48000-7f380ab4a000 rw-p 000ed000 08:01 3279348                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18
7f380ab4a000-7f380ab5f000 rw-p 00000000 00:00 0 
7f380ab5f000-7f380ab68000 r-xp 00000000 08:01 3282230                    /usr/lib/libsfml-system.so.2.1
7f380ab68000-7f380ad67000 ---p 00009000 08:01 3282230                    /usr/lib/libsfml-system.so.2.1
7f380ad67000-7f380ad68000 r--p 00008000 08:01 3282230                    /usr/lib/libsfml-system.so.2.1
7f380ad68000-7f380ad69000 rw-p 00009000 08:01 3282230                    /usr/lib/libsfml-system.so.2.1
7f380ad69000-7f380af27000 r-xp 00000000 08:01 265952                     /lib/x86_64-linux-gnu/libc-2.17.so
7f380af27000-7f380b126000 ---p 001be000 08:01 265952                     /lib/x86_64-linux-gnu/libc-2.17.so
7f380b126000-7f380b12a000 r--p 001bd000 08:01 265952                     /lib/x86_64-linux-gnu/libc-2.17.so
7f380b12a000-7f380b12c000 rw-p 001c1000 08:01 265952                     /lib/x86_64-linux-gnu/libc-2.17.so
7f380b12c000-7f380b131000 rw-p 00000000 00:00 0 
7f380b131000-7f380b138000 r-xp 00000000 08:01 266072                     /lib/x86_64-linux-gnu/librt-2.17.so
7f380b138000-7f380b337000 ---p 00007000 08:01 266072                     /lib/x86_64-linux-gnu/librt-2.17.so
7f380b337000-7f380b338000 r--p 00006000 08:01 266072                     /lib/x86_64-linux-gnu/librt-2.17.so
7f380b338000-7f380b339000 rw-p 00007000 08:01 266072                     /lib/x86_64-linux-gnu/librt-2.17.so
7f380b339000-7f380b43c000 r-xp 00000000 08:01 266000                     /lib/x86_64-linux-gnu/libm-2.17.so
7f380b43c000-7f380b63c000 ---p 00103000 08:01 266000                     /lib/x86_64-linux-gnu/libm-2.17.so
7f380b63c000-7f380b63d000 r--p 00103000 08:01 266000                     /lib/x86_64-linux-gnu/libm-2.17.so
7f380b63d000-7f380b63e000 rw-p 00104000 08:01 266000                     /lib/x86_64-linux-gnu/libm-2.17.so
7f380b63e000-7f380b656000 r-xp 00000000 08:01 266064                     /lib/x86_64-linux-gnu/libpthread-2.17.so
7f380b656000-7f380b855000 ---p 00018000 08:01 266064                     /lib/x86_64-linux-gnu/libpthread-2.17.so
7f380b855000-7f380b856000 r--p 00017000 08:01 266064                     /lib/x86_64-linux-gnu/libpthread-2.17.so
7f380b856000-7f380b857000 rw-p 00018000 08:01 266064                     /lib/x86_64-linux-gnu/libpthread-2.17.so
7f380b857000-7f380b85b000 rw-p 00000000 00:00 0 
7f380b85b000-7f380b860000 r-xp 00000000 08:01 3295393                    /usr/lib/libdsfml-window.so.2.0
7f380b860000-7f380ba5f000 ---p 00005000 08:01 3295393                    /usr/lib/libdsfml-window.so.2.0
7f380ba5f000-7f380ba60000 r--p 00004000 08:01 3295393                    /usr/lib/libdsfml-window.so.2.0
7f380ba60000-7f380ba61000 rw-p 00005000 08:01 3295393                    /usr/lib/libdsfml-window.so.2.0
7f380ba61000-7f380ba70000 r-xp 00000000 08:01 3298607                    /usr/lib/libdsfml-graphics.so.2.0fish: Job 2, “rdmd -I/home/redacted/Devel/git/ICE/ICE/Libraries -L-ldsfml-system -L-ldsfml-graphics -L-ldsfml-window test.d ” terminated by signal SIGABRT (Abort)

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

But nothing from DSFML about an invalid font? Interesting.

I'll track down that invalid pointer issue though, and that should fix the crash.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Latest commit to DSFML-C fixes the crashing at exit, but it is late so I will work on the drawing part tomorrow!

from dsfml.

aubade avatar aubade commented on June 8, 2024

Unfortunately, it's still crashing at exit for me. :( It looks like it's trying to destroy a non-existent texture? At least according to the backtrace it's crashing in dsfml.graphics.texture.Texture.__dtor()

from dsfml.

aubade avatar aubade commented on June 8, 2024

Though, on the bright side, I just realized that while testing with DMD, I've been making 64-bit binaries. 32-bit ones are having the exact same difficulties, but at least 64-bit DMD binaries work now :)

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Oh, interesting. I didn't actually load a font though. I thought it was something else, but it looks like I fixed a different bug. :P

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

That's super great about building in 64 bits though! I'm gonna stop worrying about that completely. :)

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I can replicate the text not drawing, but I don't experience the crash on Windows. If I can't seem to track it down, then I'll get a VM going to see if maybe that'll help pinpoint it.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

If you don't create the text object, does the crash still happen?

from dsfml.

aubade avatar aubade commented on June 8, 2024

Nope! No crash if I don't create a Text object. And it wouldn't surprise me too much if it's OS-specific. We've seen a couple instances already of D's GC acting differently on Windows and Linux.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I would be willing to bet the two problems are closely related. I'll see what I can do!

Any other problems you've noticed since then?

from dsfml.

aubade avatar aubade commented on June 8, 2024

Not yet. :) Sprites, Circleshapes, rectangleshapes, and vertexarrays all seem to be working. I haven't integrated any sound code into my engine proper yet,but later today, I'll poke again at my sfmod and sfmidi stuff. :)

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I'm pretty confident you won't have any issues there. I haven't really changed much since the last time you said it worked.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I just found out that drawing text does work....sort of. I got it to draw by setting the fields individually. Not sure if order matters. Good news is that I should have a fix for it today. Bad news is that I have no idea what is causing that crash, but I'll keep fiddling.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Well, I found out why it wasn't drawing for you. And it's the dumbest reason ever.

I totally forgot to have everything update when you set the color, and I also realized that I forgot to add the alpha fix in color.d, so you would never see anything unless you update something else AFTER you set the color. I can fix both of these very easily and it will only take a few seconds.

You'll at least be able to draw text again!

Now to figure out what is causing your stupid crash...

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

There! You should be able to see your text now!

from dsfml.

aubade avatar aubade commented on June 8, 2024

Okay! It is displaying text! But... numbers aren't coming through correctly at all. I'm converting some basic debug data to a string at runtime and displaying it in a Text object. writeln()-ing it to stdout looks okay, but it prints one or two digits of the number, and a lot of spaces.

If I'm not explaining it well enough, I can make a quick youtube video to show the weirdness. It's actually kinda trippy.

from dsfml.

aubade avatar aubade commented on June 8, 2024

https://www.youtube.com/watch?v=sFezzCdxSq8 is what it looked like using the old branch of DSFML. The debug text shows the framerate, and the player's position.

https://www.youtube.com/watch?v=LcI85g1f0OU is running on the experimental DSFML branch. Outputting the same string with writeln() looks the same as in the first video.

from dsfml.

aubade avatar aubade commented on June 8, 2024

...after a closer glance, it looks like it's displaying the numbers, but just substituting blank spaces for any digits that aren't 8, 6, or 0... and considering the starting framerate is going to read 0, and the player's starting coordinates are (60, 80), I think the problem is that if you change the string, it won't correctly display any characters that weren't also there in the initial string.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Wow, that is just freaking the hell out isn't it? I never thought to check drawing with numbers. That is a pretty serious issue so I'll make sure to get it fixed asap.

Unfortunately I don't know the Text code that well. It was mostly me just copy pasting, so it might take a while to track down the actual cause.

from dsfml.

aubade avatar aubade commented on June 8, 2024

After a little further futzing, my theory seems to pan out--changing the initial position to 123, 456 made those digits show up, but not 7, 8, or 9. So it does appear that only glyphs present in the initial string are properly displayed.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Yep, I had the same thing happen to me. I do have something I can try tomorrow though. I was just very busy today.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Made some changes and now things draw like they should, but it causes a crash somewhere.

Making progress though!

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

If I can't figure out what is going on by Wednesday, I'll revert to using the CSFML type method of doing the Text class since we both know it worked right. If that happens I'll just mess with it later to try to fix what ever is going on.

I think it's something that probably just isn't translating very well when going from C/C++ to D. Fixing it is a much better solution than going back to the CSFML style, so what I'll probably do long term is create a new kind of C++ Text class that produces a vertex array, and then make a wrapper around that.

from dsfml.

aubade avatar aubade commented on June 8, 2024

Alright. :) I'm sorry it's such a pain!

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

That's what I get for undertaking this project I guess :P

I'm just glad you saw it! I was nearly ready to release/announce on the D forums and everything. I would have been pretty embarrassed if everyone in the D community that tried it found stuff broken already.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Don't get excited just yet, but I'm pretty sure I just found out how to fix the text not displaying properly AND your texture pointer crash.

I get off work in a couple of hours, so I'm not sure when I'll upload anything, but you should get it working tonight!

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I have something I'd like you to test. Are you loading the font from a file?

I have some more that I want to do to make sure everything is working the way it should, but I want to make sure that this idea is going to pan out.

from dsfml.

aubade avatar aubade commented on June 8, 2024

Yes, I am loading from a file--I haven't yet tested Streams or Memory loading.

from dsfml.

aubade avatar aubade commented on June 8, 2024

(Eventually I will be loading through a stream using PhysFS, but since we didn't have InputStreams till just now, I haven't set up the code for that yet.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

I need to clean up some code, but it should at least do the trick.

I made some changes to DSFML-C and DSFML so you'll need to recompile both. It fixes the issue with the font not updating correctly for me(and should for you too), and you shouldn't be trying to delete objects that no longer exist anymore. ;)

from dsfml.

aubade avatar aubade commented on June 8, 2024

Seems to work :) No exit-time crash. and all the numbers display well!

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Huzzah!

I'll finish cleaning everything up, maybe do a couple of more tests, and then I'll close this up.

from dsfml.

aubade avatar aubade commented on June 8, 2024

Uh oh! Sorry. I just did a quick implementation of an InputStream--loading from it reported success, but then the Text didn't work. I'll poke around a bit and file a new bug for that if it affects more than Fonts. :)

from dsfml.

aubade avatar aubade commented on June 8, 2024

Yup! Loads an image from a stream just fine, but loading a Font made it crash, when trying to actually do the draw operation

Here's a backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd2431 in sfFont_updateTexture ()
   from /usr/lib/libdsfml-graphics.so.2
(gdb) backtrace
#0  0x00007ffff7bd2431 in sfFont_updateTexture ()
   from /usr/lib/libdsfml-graphics.so.2
#1  0x000000000041cfd0 in dsfml.graphics.font.Font.getTexture() (this=..., 
    characterSize=10) at Libraries/dsfml/graphics/font.d:125
#2  0x0000000000443598 in dsfml.graphics.text.Text.draw() (this=..., 
    renderTarget=..., renderStates=...) at Libraries/dsfml/graphics/text.d:383
#3  0x000000000044ae89 in D main (args=...) at src/testcode.d:511
#4  0x0000000000578fff in rt.dmain2._d_run_main() ()
#5  0x000000000057975f in rt.dmain2._d_run_main() ()
#6  0x0000000000579990 in rt.dmain2._d_run_main() ()
#7  0x000000000057975f in rt.dmain2._d_run_main() ()
#8  0x00000000005798f8 in _d_run_main ()
#9  0x00007ffff5bb4ea5 in __libc_start_main (main=0x579930 <main>, argc=1, 
    ubp_av=0x7fffffffe738, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffe728) at libc-start.c:260
#10 0x0000000000413e45 in _start ()

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

That's because I haven't quite finished it yet. I wanted to make sure my idea actually worked before I implemented it for all if the ways you can load.

I'll get to it soon enough though! Probably tomorrow. No needed for a new issue in the tracker.

from dsfml.

aubade avatar aubade commented on June 8, 2024

Alrighty :) I was only going to file a new issue if other stuff didn't load right from a stream.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Ah, gotcha. I think I only did a test with loading a image, but everything should be set up the same. Assuming you don't find any other problems I'll start writing unit tests on Tuesday. Hopefully that will flush out any other missed stuff.

from dsfml.

aubade avatar aubade commented on June 8, 2024

wince loading Music from a stream isn't working either...

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Hmm. Well I'll make sure to run a test tomorrow. What most likely happened is that I just didn't quite finish setting it up.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Yep, just looked at some code and that is exactly what happened. I'll fix that today.

Sorry you keep finding broken/unfinished stuff. :(

from dsfml.

aubade avatar aubade commented on June 8, 2024

Hey, it's totally fine. I'm sorry I keep pushing back the release date :)

If I haven't mentioned it before, or enough, I <3 DSFML, and you're pretty awesome for going through all this work to maintain it :)

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Thanks for the kind words. I really appreciate it. :)

I finished up the font and text stuff, and the stream loading for music and sounds should work now too!

from dsfml.

aubade avatar aubade commented on June 8, 2024

We're close! Unless there's some D-side changes that I'm not able to pick up yet, it looks like we're closer but not quite there yet. Font isn't crashing, and Music isn't crashing on load.

Unfortunately, a stream-loaded font is displaying as all while squares, and stream-loaded Music is crashing when I try to play it. Both work fine when loaded directly from a file.

If it's of any help, the audio backtrace is now:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe50d2700 (LWP 20051)]
0x00007ffff79c4ddf in sf::priv::SoundFile::Stream::read(void*, long, void*) ()
   from /usr/lib/libdsfml-audio.so.2
(gdb) backtrace
#0  0x00007ffff79c4ddf in sf::priv::SoundFile::Stream::read(void*, long, void*)
    () from /usr/lib/libdsfml-audio.so.2
#1  0x00007ffff21b2031 in ?? () from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#2  0x00007ffff21ad598 in ?? () from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#3  0x00007ffff218f81f in sf_read_short ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x0000000000424bff in dsfml.audio.soundfile.SoundFile.read (data=..., 
    this=...) at Libraries/dsfml/audio/soundfile.d:84
#5  dsfml.audio.music.Music.onGetData() (this=..., data=...)
    at Libraries/dsfml/audio/music.d:123
#6  0x0000000000442d97 in dsfml.audio.soundstream.SoundStream.fillAndPushBuffer
    (bufferNum=0, this=...) at Libraries/dsfml/audio/soundstream.d:310
#7  dsfml.audio.soundstream.SoundStream.fillQueue (this=...)
    at Libraries/dsfml/audio/soundstream.d:354
#8  dsfml.audio.soundstream.SoundStream.streamData() (this=...)
    at Libraries/dsfml/audio/soundstream.d:215
#9  0x00000000005874ff in thread_entryPoint ()
#10 0x00007ffff60b0f8e in start_thread (arg=0x7fffe50d2700)
    at pthread_create.c:311
#11 0x00007ffff59bce1d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

EDIT: The audio crash might be something weird on my system, or with compiler optimization, because passing the length of the void array directly to physfs crashed, but caching it in a local variable and passing that to physfs didn't.

EDIT2: Even weirder. the local variable trick works when the engine is compiled with -O2, but it crashes when optimization is disabled.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Interesting. I think we should open up a different issue for the InputStream sound errors though. One problem at a time ;)

I know what happened with the Text not displaying though. It was just because I forgot to finish everything up for my fix with the other loading types in the loadFrom methods. You were drawing quads with no textures. It also looks like some of my changes failed to upload correctly, so I got those to commit.

The font should finally be fixed!(fingers crossed)

from dsfml.

aubade avatar aubade commented on June 8, 2024

Font works now! I'll make an issue for the Music crash.

from dsfml.

Jebbs avatar Jebbs commented on June 8, 2024

Cool!

I already told denizzzka that I will be working on his issue after I finished with this one so it might take some time before I get to it.

I'm gonna close this finally. :D

from dsfml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.