Re: Segmentation fault while reading a file

2024-08-01 Thread IchorDev via Digitalmars-d-learn
On Thursday, 1 August 2024 at 14:42:36 UTC, Ruby The Roobster wrote: Thank you. I am not very well acquainted with the standard library, and this cleans up things significantly. Question: Is there a good guide to Phobos anywhere? I would like to learn the more commonly used algorithms / con

Re: Segmentation fault while reading a file

2024-08-01 Thread Ruby The Roobster via Digitalmars-d-learn
On Thursday, 1 August 2024 at 07:03:04 UTC, IchorDev wrote: Hey just a heads up, you might wanna use [`readText`](https://dlang.org/library/std/file/read_text.html) and [`lineSplitter`](https://dlang.org/library/std/string/line_splitter.html) just so you don’t have to deal with file handles. .

Re: Segmentation fault while reading a file

2024-08-01 Thread IchorDev via Digitalmars-d-learn
Hey just a heads up, you might wanna use [`readText`](https://dlang.org/library/std/file/read_text.html) and [`lineSplitter`](https://dlang.org/library/std/string/line_splitter.html) just so you don’t have to deal with file handles. Also you can use something like [`formattedRead`](https://dlang

Re: Segmentation fault while reading a file

2024-07-31 Thread Ruby The Roobster via Digitalmars-d-learn
Nevermind. The segfault happened because I accidentally used the Mesh class before loading OpenGL. I don't know if it works as intended, but it no longer crashes.

Re: Segmentation fault while reading a file

2024-07-31 Thread matheus via Digitalmars-d-learn
On Wednesday, 31 July 2024 at 23:06:30 UTC, Ruby The Roobster wrote: ... or is `readln` bugging out because the file (backpack.obj contained in the linked .zip file) is too large? ... I don't have I compiler in hand to try your code at moment, but about your concern over the size of the file,

Segmentation fault while reading a file

2024-07-31 Thread Ruby The Roobster via Digitalmars-d-learn
I decided to attempt to write my own OBJ loading library, seeing as the spec for the format is readily available online. Building with DMD and on Windows, and testing on [this model](https://learnopengl.com/data/models/backpack.zip), the code acts normally for a while, and then apparently segf