I don’t care about complex or confusing! I actually prefer it since I find the more difficult things are the more powerful they become. I’m also really passionate about learning and solving from first principles. This is why my day job is a theoretical physicist :b (although I took a day off to figure this shit out). I was just a little frustrated since this caught me off guard. I thought it would be really easy.
Hey everyone thanks for your help! I solved the problem. The issue was that I was passing the font as a NULL pointer which was causing a segfault in the TTF font DLL. Not out of the clear though since, while I can update things on the screen, I’m having an issue converting ints to strings. I’ll figure it out though.
Btw thanks everyone for helping me! I’ve learned a lot. I will use this solution for the time being but will go through all of your suggestions. I’m a little time constraned since I’m developing on the off hours. But I will definately go through this thread in the future! Sorry my noobishness.
Well if you think that its worth the time/amount of work for what you are trying to do then nothing stopping you
Also
int a = 10;
char *intStr = itoa(a);
OR
int a = 10;
stringstream ss;
ss << a;
string str = ss.str();
I like using snprintf(), personally. It’s nice and flexible with a
printf-style format. Visual Studio might have poor support for it until
version 2014, but you can find snippets online to implement it.
int a = 10;
char buffer[20];
snprintf(buffer, 20, “%d”, a);
The full SDL 2 game example I posted turns ints into strings and a lot of
stuff. It is a full game that loads file data, does TTF, makes log files,
puts thousands of enemy bugs crawling on the screen, and more. Plus its
only 859 lines. I hope to finish in under one k without too much clutter.
Wait till you see it finished. If you missed it scroll back and take a look
at the zip
I like using snprintf(), personally. It’s nice and flexible with a
printf-style format. Visual Studio might have poor support for it until
version 2014, but you can find snippets online to implement it.
int a = 10;
char buffer[20];
snprintf(buffer, 20, “%d”, a);
Jonny DOn Tue, Feb 4, 2014 at 5:13 PM, Eric Wing wrote:
On 2/4/14, Jonathan Dearborn <@Jonathan_Dearborn> wrote:
I like using snprintf(), personally. It’s nice and flexible with a
printf-style format. Visual Studio might have poor support for it until
version 2014, but you can find snippets online to implement it.
int a = 10;
char buffer[20];
snprintf(buffer, 20, “%d”, a);
The full SDL 2 game example I posted turns ints into strings and a lot of stuff. It is a full game that loads file data, does TTF, makes log files, puts thousands of enemy bugs crawling on the screen, and more. Plus its only 859 lines. I hope to finish in under one k without too much clutter. Wait till you see it finished. If you missed it scroll back and take a look at the zip
I don’t think you posted the link. There are several games on your website, whisper 8. which one do you recommend?
By the way, services like pastebin make this much easier and we even get
syntax highlights :)On Sat, Feb 8, 2014 at 9:00 PM, shinn497 wrote:
R Manard wrote:
The full SDL 2 game example I posted turns ints into strings and a lot
of stuff. It is a full game that loads file data, does TTF, makes log
files, puts thousands of enemy bugs crawling on the screen, and more. Plus
its only 859 lines. I hope to finish in under one k without too much
clutter. Wait till you see it finished. If you missed it scroll back and
take a look at the zip
I don’t think you posted the link. There are several games on your
website, whisper 8. which one do you recommend?
sure hope it works nowOn Sat, Feb 8, 2014 at 6:00 PM, shinn497 wrote:
R Manard wrote:
The full SDL 2 game example I posted turns ints into strings and a lot
of stuff. It is a full game that loads file data, does TTF, makes log
files, puts thousands of enemy bugs crawling on the screen, and more. Plus
its only 859 lines. I hope to finish in under one k without too much
clutter. Wait till you see it finished. If you missed it scroll back and
take a look at the zip
I don’t think you posted the link. There are several games on your
website, whisper 8. which one do you recommend?
If you’re only displaying ascii characters, and only in one size, the answer is easy: blit every ascii character into a single surface, turn that into a texture, and treat it as you would a bitmap font.------------------------
Nate Fries