FAO Andy P, SDL2 library.

new topic     » topic index » view thread      » older message » newer message

Hi Andy.

Playing with your SDL2 library now, got it working with Phix, apart from font colouring which I am tearing my hair out at.

See the FontTest.exw, I have fiddled, so the line numbers may not be exact, lines 39 40

atom h = TTF_RenderText_Solid(f,"Hello World",255,0,0,100)  --<--colour set here to red, alpha 100 
atom ht = SDL_CreateTextureFromSurface(ren,h) 
atom h = TTF_RenderText_Solid(f,"Hello World",0,255,0,100)  --<--colour set here to green, alpha 100 
                                                            --but this doesn't work, text now black. 
                                                            --in fact setting the red channel to anything, only shows the  
                                                            --strength of that red 
atom ht = SDL_CreateTextureFromSurface(ren,h) 

I've done lots of reading of the SDL2 docs, the SDL2TTF docs, and I can't see what I'm missing. I've also tried setTextureColorMod to change the color chanels of ht, but again only the red channel was modified.

Any ideas?

Cheers

Chris

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu