VirtualBox

Changeset 8144 in vbox for trunk/src


Ignore:
Timestamp:
Apr 18, 2008 1:28:51 PM (17 years ago)
Author:
vboxsync
Message:

FE/SDL: use RenderUTF8_Blended() if available to get a better looking font

Location:
trunk/src/VBox/Frontends/VBoxSDL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r7207 r8144  
    5858DECLSPEC TTF_Font* (SDLCALL *pTTF_OpenFont)(const char *file, int ptsize);
    5959DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Solid)(TTF_Font *font, const char *text, SDL_Color fg);
     60DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Blended)(TTF_Font *font, const char *text, SDL_Color fg);
    6061DECLSPEC void (SDLCALL *pTTF_CloseFont)(TTF_Font *font);
    6162DECLSPEC void (SDLCALL *pTTF_Quit)(void);
     
    10571058                           (mSecureLabelColorFG & 0x0000FF00) >> 8,
    10581059                           mSecureLabelColorFG & 0x000000FF, 0};
    1059         SDL_Surface *sText = pTTF_RenderUTF8_Solid(mLabelFont, mSecureLabelText.raw(), clrFg);
     1060        SDL_Surface *sText = (pTTF_RenderUTF8_Blended != NULL)
     1061                                 ? pTTF_RenderUTF8_Blended(mLabelFont, mSecureLabelText.raw(), clrFg)
     1062                                 : pTTF_RenderUTF8_Solid(mLabelFont, mSecureLabelText.raw(), clrFg);
    10601063        rect.x = 10;
    10611064        SDL_BlitSurface(sText, NULL, mScreen, &rect);
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r5999 r8144  
    3333extern DECLSPEC TTF_Font* (SDLCALL *pTTF_OpenFont)(const char *file, int ptsize);
    3434extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Solid)(TTF_Font *font, const char *text, SDL_Color fg);
     35extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Shaded)(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg);
     36extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Blended)(TTF_Font *font, const char *text, SDL_Color fg);
    3537extern DECLSPEC void (SDLCALL *pTTF_CloseFont)(TTF_Font *font);
    3638extern DECLSPEC void (SDLCALL *pTTF_Quit)(void);
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r8049 r8144  
    18671867        if (VBOX_SUCCESS(rcVBox))
    18681868            rcVBox = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_RenderUTF8_Solid", (void**)&pTTF_RenderUTF8_Solid);
     1869        if (VBOX_SUCCESS(rcVBox))
     1870        {
     1871            /* silently ignore errors here */
     1872            rcVBox = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_RenderUTF8_Blended", (void**)&pTTF_RenderUTF8_Blended);
     1873            if (VBOX_FAILURE(rcVBox))
     1874                pTTF_RenderUTF8_Blended = NULL;
     1875            rcVBox = VINF_SUCCESS;
     1876        }
    18691877        if (VBOX_SUCCESS(rcVBox))
    18701878            rcVBox = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_CloseFont", (void**)&pTTF_CloseFont);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette