<< 08-04-2025 >>

00:20:02*xet7 quit (Ping timeout: 268 seconds)
00:32:10*xet7 joined #nim
01:20:39*disso-peach quit (Remote host closed the connection)
01:45:43*andreas joined #nim
01:46:43*andreas_ quit (Read error: Connection reset by peer)
02:30:09FromDiscord<devlop_gaming> Is there a way to use sdl3_ttf and sdl3_image in nim?
03:21:00FromDiscord<.bobbbob> yes
03:36:06FromDiscord<mimidragon.> In reply to @devlop_gaming "Is there a way": Using sdl3 and sdl3_ttf https://github.com/dinau/sdl3_nim
04:04:40*amadaluzia_ quit (Ping timeout: 260 seconds)
04:33:16*xet7 quit (Remote host closed the connection)
04:35:02*xet7 joined #nim
04:46:05*derpydoo joined #nim
04:49:14*ntat joined #nim
04:50:24*derpydoo quit (Ping timeout: 244 seconds)
06:35:02*derpydoo joined #nim
07:08:09*andy-turner joined #nim
07:10:59*Guest69 joined #nim
07:13:49*derpydoo quit (Quit: derpydoo)
07:35:43*Guest69 quit (Quit: Client closed)
07:47:51*nils` quit (Ping timeout: 252 seconds)
07:55:22*ntat quit (Quit: leaving)
08:05:51*andreas quit (Quit: Konversation terminated!)
08:06:02*andreas joined #nim
08:13:25*ntat joined #nim
09:00:53*nils` joined #nim
09:01:46*ntat quit (Quit: leaving)
10:22:20*coldfeet joined #nim
10:28:36*beholders_eye joined #nim
10:35:41*ntat joined #nim
10:56:05*coldfeet quit (Quit: Lost terminal)
11:23:52*ntat quit (Read error: Connection reset by peer)
11:25:46FromDiscord<.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=GwwwMweh
11:25:59FromDiscord<.tokyovigilante> (edit) "https://play.nim-lang.org/#pasty=xDlOeFkH" => "https://play.nim-lang.org/#pasty=vlaYJxDU"
11:26:23FromDiscord<.tokyovigilante> ie using `{.varargs.}` instead of `va_list`?
11:27:04FromDiscord<.tokyovigilante> This makes it hard to write a Nim function for `logtv` as I'm not sure how to access the varargs. I had just been using `vsnprintf` to write it into a char buffer.
11:28:21FromDiscord<.tokyovigilante> I can't quite figure out if `{.cdecl, varargs.}` even makes sense, i.e. can the compiler convert between Nim and C varargs?
11:31:08*ntat joined #nim
11:33:12FromDiscord<.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=GiwPNzPg
11:33:31Amun-Ra{.varargs.} is en equivalent of C's ...
11:35:09FromDiscord<.tokyovigilante> Ok, so {.cdecl, varargs.} should work? Just not sure how to implement the callback in Nim so I can access the arguments in that case, ie past `a6`.
11:35:23FromDiscord<.tokyovigilante> (edit) "{.cdecl, varargs.}" => "`{.cdecl, varargs.}`"
11:40:35Amun-Ravarargs should work for … (snprintf, etc) but not for va_list ones (vsnprintf, etc)
11:41:18FromDiscord<demotomohiro> It seems when you call C functions with variable number of arguments, they need to have `varargs` pragma.↵But when you need to implement C functions with variable number of arguments that are called by C, you need to use `va_list` instead of `varargs` pragma in order to access arguments.
11:42:49Amun-Rathose are two methods for passing a variable number of arguments to a function
11:44:32Amun-Raif you need to pass … to a function that accepts va_list you have to build it with va_start, va_copy, va_end, etc.
11:45:37Amun-Raand I don't think va_list is event exposed to nim side in stdlib
11:53:04*ntat quit (Quit: Lost terminal)
11:53:18FromDiscord<dawidek.2137> nim has special syntax for (`=programCounter`) but there is no such thing for getters, right?
11:53:30FromDiscord<dawidek.2137> (edit) "nim has special syntax for ... (`=programCounter`)" added "setters"
11:55:26FromDiscord<fabric.input_output> `proc a(b: C): A = b.someting` you can use it like `b.a`
11:55:29FromDiscord<fabric.input_output> essentially a getter
11:56:17FromDiscord<dawidek.2137> thanks
11:57:55FromDiscord<lainlaylie> https://nim-lang.org/docs/manual.html#procedures-properties
11:59:32Amun-Radawidek.2137: you can even shadow object field name with a func at it'll act like a getter
12:02:11FromDiscord<lainlaylie> as demonstrated in the link
12:03:11Amun-Raah, right
13:47:56*kasimir_ quit (Remote host closed the connection)
13:48:31*kasimir_ joined #nim
13:57:10*kasimir_ quit (Remote host closed the connection)
13:57:41*kasimir_ joined #nim
14:17:48*bgupta quit (Ping timeout: 276 seconds)
14:18:42*bgupta joined #nim
14:22:00FromDiscord<devlop_gaming> sent a long message, see https://pasty.ee/jtmgTNQE
14:22:22FromDiscord<devlop_gaming> sent a code paste, see https://play.nim-lang.org/#pasty=EuIpWrMw
14:25:06FromDiscord<nnsee> In reply to @devlop_gaming "So i am trying": isn't that what it's supposed to return?
14:25:21FromDiscord<nnsee> Return Value↵↵(bool) Returns true on success or false on failure; call SDL_GetError() for more information.
14:25:28FromDiscord<nnsee> `true` is defined as 1
14:25:47FromDiscord<nnsee> https://wiki.libsdl.org/SDL3_ttf/TTF_Init
14:25:54FromDiscord<devlop_gaming> In reply to @nnsee "isn't that what it's": No it's supposed to return 0 on success
14:26:00FromDiscord<nnsee> no, i don't think so
14:26:16FromDiscord<devlop_gaming> 0 is success and 1 is an error
14:26:51FromDiscord<nnsee> In reply to @devlop_gaming "0 is success and": usually, yes, but not in SDL3
14:26:51FromDiscord<nnsee> https://wiki.libsdl.org/SDL3/README/migration
14:26:58FromDiscord<devlop_gaming> Huh?
14:28:05FromDiscord<devlop_gaming> I don't see what you're talking about
14:28:33FromDiscord<nnsee> literally the first paragraph
14:28:35FromDiscord<nnsee> code blocks 1 to 4
14:29:54FromDiscord<devlop_gaming> I still don't follow
14:30:17FromDiscord<devlop_gaming> Also it can't import TTF_GetError
14:33:25FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=MtjcLhUj
14:33:42FromDiscord<nnsee> your function is returning `true` on success, therefore it is returning `1`
14:34:38FromDiscord<devlop_gaming> In reply to @nnsee "your function is returning": Then why am is my TTF_OpenFont function failing and i can't import TTF_GetError?
14:35:16FromDiscord<nnsee> i don't know, you haven't posted any errors and i'm not clairvoyant
14:36:03FromDiscord<devlop_gaming> I gave code tho
14:36:09FromDiscord<devlop_gaming> sent a long message, see https://pasty.ee/kkuaJleV
14:36:22FromDiscord<devlop_gaming> (edit) "long message," => "code paste," | "https://pasty.ee/MveIAqnd" => "https://play.nim-lang.org/#pasty=mjTVdTwg"
14:36:47FromDiscord<nnsee> sure, but again, that's not very helpful without the actual error message
14:37:26FromDiscord<nnsee> actually, i guess i am clairvoyant
14:37:58FromDiscord<nnsee> you can't import the function because there's no function called that in SDL3
14:38:16FromDiscord<nnsee> the documentation link I posted lists the correct function to call
14:38:22FromDiscord<devlop_gaming> Traceback (most recent call last)↵C:\Users\Dreca\OneDrive\Dreaminate\src\main.nim(19) main↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵Error: execution of an external program failed: 'C:\Users\Dreca\OneDrive\Dreaminate\src\main.exe'
14:38:38FromDiscord<devlop_gaming> In reply to @nnsee "the documentation link I": SDL3_ttf
14:38:43FromDiscord<devlop_gaming> It's in that doc
14:39:02FromDiscord<nnsee> please read again
14:39:20FromDiscord<devlop_gaming> What about it?
14:39:32FromDiscord<nnsee> > (bool) Returns true on success or false on failure; call SDL_GetError() for more information.
14:39:33*amadaluzia joined #nim
14:39:52FromDiscord<nnsee> look at the function name in the documentation, then look at the function you're trying to import
14:43:20FromDiscord<devlop_gaming> Same error
14:43:24FromDiscord<devlop_gaming> In reply to @devlop_gaming "Traceback (most recent call": ^
14:43:55FromDiscord<nnsee> that's not very helpful without the code :p
14:43:58FromDiscord<devlop_gaming> Right whee i try to open the font
14:44:08FromDiscord<nnsee> i don't see line 19 in the code you pasted
14:44:19FromDiscord<devlop_gaming> sent a code paste, see https://play.nim-lang.org/#pasty=KBNEFBtd
14:46:09FromDiscord<nnsee> well line 19 is you already using the font. as per the documentation, if opening the font fails, it returns a null pointer - if you're operating on a null pointer, it's no wonder it's crashing. you need to specifically check for the null pointer and actually use SDL_GetError to print the actual error message if it is null
14:47:19FromDiscord<devlop_gaming> I said multiple times it won't let me import it for some reason
14:48:29FromDiscord<devlop_gaming> Wait nvm
14:48:33FromDiscord<spotlightkid> learn to read error messages you must, young jedi...
14:49:46FromDiscord<devlop_gaming> Nothing is printed to output
14:50:23FromDiscord<devlop_gaming> No wait i was right\
14:50:25FromDiscord<devlop_gaming> could not import: TTF_GetError
14:50:28FromDiscord<devlop_gaming> (edit) "right\" => "right"
14:50:33FromDiscord<nnsee> are you actually `echo`-ing the result from SDL_GetError?
14:50:40FromDiscord<nnsee> In reply to @devlop_gaming "could not import: TTF_GetError": again, wrong function name...
14:51:58FromDiscord<devlop_gaming> In reply to @nnsee "again, wrong function name...": Oh then i don't get anything when printing the error
14:52:49FromDiscord<nnsee> can you post the code
14:53:16FromDiscord<devlop_gaming> sent a long message, see https://pasty.ee/EIvVKpcs
14:53:51FromDiscord<nnsee> (if possible, please use https://play.nim-lang.org for sharing longer code snippets, there's a share button on the bottom left)
14:54:45FromDiscord<nnsee> how are you importing SDL_GetError? also you should actually check whether it _is_ returning a null pointer, i was just guessing
14:55:10FromDiscord<spotlightkid> And for shorter ones, you can use code-fences (triple back-tick before/after the source code) here on matrix. you can even have hi-lighting if you but `nim` after the initial triple back-tick.
14:55:14FromDiscord<devlop_gaming> I installed sdl3 using nimble and put it's dll in my src folder
14:56:57FromDiscord<nnsee> oh, SDL_GetError is in the nimble library, and the import seems fine to me
14:57:17FromDiscord<nnsee> you need more checks in your code for null pointers for functions that can return null as per the documentation to figure out exactly what's going wrong
15:00:29FromDiscord<devlop_gaming> Checks where?
15:01:07FromDiscord<nnsee> ... the return values for functions that can return a null pointer
15:01:28FromDiscord<nnsee> TTF_OpenFont, for one
15:01:33FromDiscord<nnsee> the documentation is your friend
15:01:52FromDiscord<devlop_gaming> I literally have it open right now
15:02:10FromDiscord<devlop_gaming> But i'm asking where should i put checks
15:02:12FromDiscord<nnsee> i suggest also reading it :p
15:02:25FromDiscord<nnsee> In reply to @devlop_gaming "But i'm asking where": respectfully, i'm not reading the documentation for you
15:02:50FromDiscord<devlop_gaming> I really don't get what you mean
15:04:55FromDiscord<devlop_gaming> In reply to @nnsee "respectfully, i'm not reading": Seriously what do you mean
15:07:51FromDiscord<devlop_gaming> Can someone help me?
15:11:56*kasimir_ quit (Remote host closed the connection)
15:12:26*kasimir_ joined #nim
15:14:36*derpydoo joined #nim
15:15:31FromDiscord<mimidragon.> In reply to @devlop_gaming "Seriously what do you": Fist you should check return value from TTF_OpenFont().
15:17:10FromDiscord<spotlightkid> https://wiki.libsdl.org/SDL3_ttf/TTF_OpenFont#return-value↵https://wiki.libsdl.org/SDL3/CategoryError
15:17:41FromDiscord<devlop_gaming> In reply to @mimidragon. "Fist you should check": I don't know how
15:17:47FromDiscord<mimidragon.> sent a code paste, see https://play.nim-lang.org/#pasty=rUguMekh
15:18:27FromDiscord<spotlightkid> https://nim-lang.org/docs/system.html#isNil%2Cpointer
15:19:21FromDiscord<devlop_gaming> In reply to @mimidragon. "First you should check": No errors
15:19:33*nils` quit (Quit: nils`)
15:23:08FromDiscord<spotlightkid> With your font?
15:27:17*derpydoo quit (Quit: derpydoo)
15:38:50*derpydoo joined #nim
15:39:56FromDiscord<mimidragon.> In reply to @devlop_gaming "No errors": Which version of Nim are you using?
15:56:55*ntat joined #nim
15:57:54*amadaluzia quit (Changing host)
15:57:54*amadaluzia joined #nim
16:23:15*amadaluzia left #nim (ERC 5.6.0.30.1 (IRC client for GNU Emacs 30.1))
16:30:10*computerquip quit (Ping timeout: 248 seconds)
16:30:17*attah quit (Read error: Connection reset by peer)
16:31:51*attah joined #nim
16:32:06*computerquip joined #nim
16:37:29*derpydoo quit (Quit: derpydoo)
16:39:40FromDiscord<devlop_gaming> In reply to @mimidragon. "Which version of Nim": 2.2.2
16:56:32*ntat_ joined #nim
17:07:25*coldfeet joined #nim
17:12:04*derpydoo joined #nim
17:15:31*kasimir_ quit (Remote host closed the connection)
17:16:03*kasimir_ joined #nim
17:39:16*ntat_ quit (Quit: leaving)
18:27:04*andreas quit (Quit: Konversation terminated!)
18:48:39*CypherCat quit (Changing host)
18:48:39*CypherCat joined #nim
19:09:28*firefall joined #nim
19:11:39*firefall left #nim (#nim)
19:18:14FromDiscord<devlop_gaming> In reply to @mimidragon. "Which version of Nim": Wait could it be possible font isn't returning nil and there could be another issue?
19:26:33FromDiscord<nnsee> In reply to @devlop_gaming "Wait could it be": yes
19:26:48FromDiscord<nnsee> but you'll know best. it's _your_ code
19:27:23FromDiscord<nnsee> echo every result, every return value you get. print debugging is the poor man's debugger
19:32:19*beholders_eye quit (Ping timeout: 265 seconds)
19:33:48FromDiscord<devlop_gaming> In reply to @nnsee "yes": I figured it out
19:34:35FromDiscord<devlop_gaming> I decided to re look at the implantation of my procedure and the function on the ttf docs and i noticed it missed the return type part
19:34:59*ntat quit (Ping timeout: 245 seconds)
19:35:00FromDiscord<devlop_gaming> It returns a SDL_Surface pointer which my procedure wasn't returning
19:37:19FromDiscord<devlop_gaming> In reply to @nnsee "but you'll know best.": True
19:45:47FromDiscord<nnsee> In reply to @devlop_gaming "I figured it out": nice!
19:45:50*ntat joined #nim
20:16:03*coldfeet quit (Quit: Lost terminal)
20:17:46*beholders_eye joined #nim
20:23:25*ntat quit (Quit: leaving)
21:10:17*andy-turner quit (Quit: Leaving)
21:23:30*rockcavera joined #nim
22:05:03*om3ga quit (Ping timeout: 265 seconds)
22:20:20*rockcavera quit (Remote host closed the connection)
22:27:48FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=XdIiiJeK
22:27:49FromDiscord<Robyn [She/Her]> Brrrr
22:28:12FromDiscord<Robyn [She/Her]> Reworking my NBT impl from the ground-up
22:28:54*rockcavera joined #nim
22:32:45FromDiscord<fabric.input_output> size: sizeof(byte)
22:33:31FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "size: sizeof(byte)": Yeah idk why I wrote that :p
22:33:53FromDiscord<Robyn [She/Her]> `{.size: 1.}` brrrr
22:34:07FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=mIUUIwjD
22:34:42FromDiscord<fabric.input_output> I'm doing some opengl graphics in nim
22:38:37FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=kAVbGNlo
22:38:56FromDiscord<Robyn [She/Her]> As well as maybe a helper proc?
23:15:47*derpydoo quit (Quit: derpydoo)
23:27:01*tiorock joined #nim
23:27:01*tiorock quit (Changing host)
23:27:01*tiorock joined #nim
23:27:01*rockcavera quit (Killed (erbium.libera.chat (Nickname regained by services)))
23:27:01*tiorock is now known as rockcavera
23:29:08*tiorock joined #nim
23:29:08*rockcavera is now known as Guest3446
23:29:08*Guest3446 quit (Killed (tungsten.libera.chat (Nickname regained by services)))
23:29:08*tiorock is now known as rockcavera
23:42:44FromDiscord<Elegantbeef> @fabric.input_output sure is some graphics
23:45:27FromDiscord<Elegantbeef> What's your goal with this fabric?