Typing Text in SDL

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
xx6heartless6xx
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Wed Feb 02, 2011 9:42 pm

Typing Text in SDL

Post by xx6heartless6xx »

I've got a game running and I wanted to output some text on top of what is going on.

I know I cant simply just use cout so how would I output text in SDL? Would it be the using SDL_TTF? Is that the only way?
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: Typing Text in SDL

Post by Milch »

Google is your friend ;)
But anyway, here you go: http://lazyfoo.net/SDL_tutorials/lesson07/index.php
This site is pretty good for learing SDL!
Follow me on twitter!
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Typing Text in SDL

Post by dandymcgee »

xx6heartless6xx wrote:I know I cant simply just use cout so how would I output text in SDL? Would it be the using SDL_TTF? Is that the only way?
Short of creating your own bitmap font, yes. That's pretty much the standard font library for SDL.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply