People communicate with text all the time in their daily lives. It is the primary way for people to consume an increasing volume of information. In the past, it used to be through printed content, primarily documents, newspapers, books, and so on. Increasingly, it is online content on their Windows PC. A typical Windows user spends a lot of time reading from their computer screen. They might be ..
class cText2 { LPD3DXMESH m_mesh; public: cText2(); ~cText2(); void Setup(); void Draw(); }; cText2::cText2() { } cText2::~cText2() { //사용후엔 해제 필수! SAFE_RELEASE(m_mesh); } void cText2::Setup() { HDC hdc=GetDC(g_hWnd); //HDC에서 글꼴을 설정하고 //HFONT font, oldFont; LOGFONT font; ZeroMemory(&font, sizeof(LOGFONT)); font.lfHeight = 100.f; font.lfWidth = 30.f; HFONT hFont; HFONT hOldFont; hFont = CreateFon..
ID3DXFont 인터페이스 이용하기 ID3DXFont 인터페이스는 D3D 애플리케이션에서 텍스트를 그릴 때 사용한다. 이 인터페이스는 내부적으로 GDI를 이용하기 때문에 약간의 성능저하가 따르지만 , GDI의 도움으로 복잡한 글꼴이나 포맷팅을 이용할 수 있다. //아래 함수를 이용해 폰트를 생성 한뒤( 구조체 정보는 아래에) D3DXCreateFontIndirect( _In_ LPDIRECT3DDEVICE9 pDevice, _In_ const D3DXFONT_DESC *pDesc, _Out_ LPD3DXFONT *ppFont ); Creates a font object indirectly for both a device and a font. //아래함수로 그린다.INT DrawText( [in] LPD..
Direct3D 는 기본적으로지정된 버텍스 순서(시계방향)를 가지고 전면 폴리곤인지 후면폴리곤인지 확인해서 스스로 후면 추려내기를 한다. 하지만 이런작업을 원치않거나 후면만 그려보고싶거나 그럴 때가있으니 LPDIRECT3DDEVICE9 g_pD3DDevice; //D4DRS_CULLMODE g_pD3DDevice->SetRenderState(D3DRS_CULLMODE, Value); Value 에 다음값중 하나를 넣어주면 된다. D3DCULL_NONE : 후면 추려내기를 완전히 끈다. D3DCULL_CW : 시계방향 두르기를 가진 삼각형을 추려낸다.( 시계방향 버텍스로 만들어진 메시의 뒷면만 볼 수 있다., 또는 시계반대방향 버텍스로 만들어진 메시의 앞면을 볼 수 있기도 하다.) D3DCULL_CCW :..
Sets a single device render-state parameter. Syntax C++ HRESULT SetRenderState( [in] D3DRENDERSTATETYPE State, [in] DWORD Value ); Parameters State [in] Type: D3DRENDERSTATETYPE Device state variable that is being modified. This parameter can be any member of the D3DRENDERSTATETYPE enumerated type. Value [in] Type: DWORD New value for the device render state to be set. The meaning of this parame..