download d3dfont.h
Language: C++
Copyright: (c) 1999-2000 Microsoft Corporation. All rights reserved.
LOC: 39
Project Info
Cratered
Server: SourceForge
Type: cvs
...d\cratered\Libs\DX\include\
   activecf.h
   amaudio.h
   amparse.h
   amstream.h
   amva.h
   amvideo.h
   atsmedia.h
   audevcod.h
   austream.h
   aviriff.h
   basetsd.h
   bdaiface.h
   bdamedia.h
   bdatypes.h
   comlite.h
   control.h
   d3d.h
   d3d8.h
   d3d8caps.h
   d3d8types.h
   d3dapp.h
   d3dcaps.h
   d3dfile.h
   d3dfont.h
   d3dres.h
   d3drm.h
   d3drmdef.h
   d3drmobj.h
   d3drmwin.h
   d3dtypes.h
   d3dutil.h
   d3dvec.inl
   d3dx.h
   d3dx8.h
   d3dx8core.h
   d3dx8effect.h
   d3dx8math.h
   d3dx8math.inl
   d3dx8mesh.h
   d3dx8shape.h
   d3dx8tex.h
   d3dxcore.h
   d3dxerr.h
   d3dxmath.h
   d3dxmath.inl
   d3dxshapes.h
   d3dxsprite.h
   ddraw.h
   ddrawex.h
   ddstream.h
   ddutil.h
   didcfgview.h
   dinput.h
   dinputd.h
   diutil.h
   dls1.h
   dls2.h
   dmdls.h
   dmerror.h
   dmksctrl.h
   dmo.h
   dmodshow.h
   dmoimpl.h
   dmoreg.h
   dmort.h
   dmplugin.h
   dmusbuff.h
   dmusicc.h
   dmusicf.h
   dmusici.h
   dmusics.h
   dmutil.h
   dpaddr.h
   dplay.h
   dplay8.h
   dplobby.h
   dplobby8.h
   dsetup.h
   DShow.h
   dshowasf.h
   dsound.h
   dsutil.h
   dv.h
   dvdevcod.h
   dvdmedia.h
   dvoice.h
   dvp.h
   dx7todx8.h
   dxerr8.h
   dxfile.h
   dxsdk.inc
   dxtrans.h
   dxutil.h
   dxva.h
   edevdefs.h
   errors.h
   evcode.h
   il21dec.h
   ks.h
   ksguid.h
   ksmedia.h
   ksproxy.h
   ksuuids.h
   mediaerr.h
   mediaobj.h
   medparam.h
   mmstream.h
   mpconfig.h
   mpegtype.h
   multimon.h
   netclient.h
   netclientres.h
   netconnect.h
   netconnectres.h
   netvoice.h
   playlist.h
   qedit.h
   qnetwork.h
   regbag.h
   rmxfguid.h
   rmxftmpl.h
   tune.h
   tuner.h
   uuids.h
   vfwmsgs.h
   videoacc.h
   vpconfig.h
   vpnotify.h
   vptype.h
   xprtdefs.h

//-----------------------------------------------------------------------------
// File: D3DFont.h
//
// Desc: Texture-based font class
//
// Copyright (c) 1999-2000 Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#ifndef D3DFONT_H
#define D3DFONT_H
#include <tchar.h>
#include <D3D8.h>


// Font creation flags
#define D3DFONT_BOLD        0x0001
#define D3DFONT_ITALIC      0x0002

// Font rendering flags
#define D3DFONT_CENTERED    0x0001
#define D3DFONT_TWOSIDED    0x0002
#define D3DFONT_FILTERED    0x0004




//-----------------------------------------------------------------------------
// Name: class CD3DFont
// Desc: Texture-based font class for doing text in a 3D scene.
//-----------------------------------------------------------------------------
class CD3DFont
{
    TCHAR   m_strFontName[80];            // Font properties    
    DWORD   m_dwFontFlags;

    LPDIRECT3DDEVICE8       m_pd3dDevice; // A D3DDevice used for rendering
    LPDIRECT3DTEXTURE8      m_pTexture;   // The d3d texture for this font
    LPDIRECT3DVERTEXBUFFER8 m_pVB;        // VertexBuffer for rendering text
    DWORD   m_dwTexWidth;                 // Texture dimensions
    DWORD   m_dwTexHeight;
    FLOAT   m_fTextScale;
    FLOAT   m_fTexCoords[128-32][4];

    // Stateblocks for setting and restoring render states
    DWORD   m_dwSavedStateBlock;
    DWORD   m_dwDrawTextStateBlock;

public:
    DWORD   m_dwFontHeight;

    // 2D and 3D text drawing functions
    HRESULT DrawText( FLOAT x, FLOAT y, DWORD dwColor, 
                      TCHAR* strText, DWORD dwFlags=0L );
    HRESULT DrawTextScaled( FLOAT x, FLOAT y, FLOAT z, 
                            FLOAT fXScale, FLOAT fYScale, DWORD dwColor, 
                            TCHAR* strText, DWORD dwFlags=0L );
    HRESULT Render3DText( TCHAR* strText, DWORD dwFlags=0L );
    
    // Function to get extent of text
    HRESULT GetTextExtent( TCHAR* strText, SIZE* pSize );

    // Initializing and destroying device-dependent objects
    HRESULT InitDeviceObjects( LPDIRECT3DDEVICE8 pd3dDevice );
    HRESULT RestoreDeviceObjects();
    HRESULT InvalidateDeviceObjects();
    HRESULT DeleteDeviceObjects();

    // Constructor / destructor
    CD3DFont( TCHAR* strFontName, DWORD dwHeight, DWORD dwFlags=0L );
    ~CD3DFont();
};




#endif


About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us