You’ll have to do a custom compile of SDL_ttf with SDL2 installed - in my
case (without SDL 1.2 installed in mingw, which should be roughly the same
on linux), it was literally me doing an hg clone of SDL2, ./configure &&
make && sudo make install, then going into SDL2, ./configure (confirm that
it does get SDL2 in there) && make && sudo make install
Note that instead of building SDL_ttf, with SDL2 it will build SDL2_ttf - I
am assuming that this is the general naming convention that Sam would like
to see with other SDL contrib. libraries (compatible with SDL 1.2 = SDL_,
SDL2 = SDL2_)
As far as I’m aware, SDL_gfx needs to be updated to deal with SDL2 properly
- Andreas mentioned in another thread that he’s planning on working on an
SDL2-compatible version.
Take care,
-AlexOn Sat, Aug 18, 2012 at 4:06 AM, stevo5800 wrote:
**
SDK_ttf is compatible you might need to download it from Mercurial to get
the latest. Everything is pretty much the same you just need to convert the
SDL_Surface to SDL_Texture with
example:
char buf[256]
SDL_Color foregroundColor = { 255, 255, 255 };
SDL_Color backgroundColor = { 0, 0, 0 };
SDL_Rect TextLoacation;
snprintf(buf,256,“TESTING”);
SDL_Surface *textSurface= TTF_RenderText_Shaded(font, buf,
foregroundColor, backgroundColor);
if(testSurface)
{
temp_texture = SDL_CreateTextureFromSurface(renderer, textSurface);
TextLocation.h = textSurface->h;
TextLocation.w = textSurface->w;
TextLocation.x = 100;
TextLocation.y = 100;
}
wahono sri wrote:
Hi all,
I’m new user of SDL, and before start using SDL, I have some question
to ensure the features as I hope.
- Is SDL_ttf and SDL_gfx is compatible with SDL 2?
- Is SDL_ttf and SDL_gfx use hardware rendering because as I read in
http://wiki.libsdl.org/moin.cgi/MigrationGuide, only using textures
will use hardware rendered, and SDL_ttf/SDL_gfx use surfaces to
drawing?
Thanks in advance.
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org