Skip to main content
gamedev.net
🔒 Locked

D3DXCreateFontIndirect Problem

Started by Newbie00 0 replies 1.8k views
Original Post
Newbie00
Newbie00
When I am trying to crreate my font i receive this compile error. error C2664: ''D3DXCreateFontIndirectA'' : cannot convert parameter 2 from ''struct tagLOGFONTA *'' to ''const struct _D3DXFONT_DESCA *'' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast Here is my code.

ID3DXFont *mFont=NULL;

        LOGFONT defaultFont = { 
            18,                            //height 
            0,                            //width 
            0,                            //lfEscapement 
            0,                            //lfOrientation 
            FW_BOLD,                    //lfWeight 
            FALSE,                        //lfItalic 
            FALSE,                        //lfUnderline 
            FALSE,                        //lfStrikeOut 
            DEFAULT_CHARSET,            //lfCharSet 
            OUT_DEFAULT_PRECIS,            //lfOutPrecision 
            CLIP_DEFAULT_PRECIS,        //lfClipPrecision 
            NONANTIALIASED_QUALITY,        //lfQuality 
            DEFAULT_PITCH,                //lfPitchAndFamily 
            "Courier New"                //lfFaceName[LF_FACESIZE] 
        }; 

        // Create the Font 
        D3DXCreateFontIndirect(oIDirect3DDevice9,&defaultFont,&mFont); 

/code]   
Etnu
Etnu
Instead of using a logfont, just use a d3dfontdesc. Yes, they''re almost identical in structure.
---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.