Files
Client/GameTools/CaldronBase/D3D9GraphicLayer.h
LGram16 dd97ddec92 Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 20:17:20 +09:00

151 lines
4.2 KiB
C++

// D3D9GraphicLayer.h: interface for the CD3D9GraphicLayer class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_D3D9GRAPHICLAYER_H__1026F404_E2F8_4612_A94C_A84F641A0C9A__INCLUDED_)
#define AFX_D3D9GRAPHICLAYER_H__1026F404_E2F8_4612_A94C_A84F641A0C9A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Caldron.h"
#include "./ExceptionMgr.h"
#include "./LogMgr.h"
/* *********************************************************************
* CD3D9GraphicLayer
* 파일 : D3D9GraphicLayer.h
* 기능 : Caldron Engine내 D3D9 디바이스등을 크리에이트 시켜주는 BaseGraphic Layer
실 app에서 사용할 시에 이 레이어를 상속받아 D3d Layer로 사용한다.
* 작성일 : 2003.10.30
* history :
wizardbug ( 2003.10.30)
********************************************************************** */
namespace Caldron {
namespace Base {
class CD3D9GraphicLayer
{
public:
class CD3D9WindowInfo
{
public:
bool m_bWindowed;
DWORD m_dwWidth;
DWORD m_dwHeight;
bool m_bD3DRunning;
HINSTANCE m_hInstance;
CD3D9WindowInfo()
{
m_bWindowed = true;
m_dwWidth = 800;
m_dwHeight = 600;
m_bD3DRunning = true;
m_hInstance = 0;
}
~CD3D9WindowInfo() {}
};
class CD3D9ModeInfo
{
public:
DWORD m_dwVertexProcessing;
D3DFORMAT m_ColorFormat;
D3DFORMAT m_DepthStencilFormat;
D3DMULTISAMPLE_TYPE m_MultiSampling;
CD3D9ModeInfo()
{
m_dwVertexProcessing = D3DCREATE_HARDWARE_VERTEXPROCESSING;
m_ColorFormat = D3DFMT_R5G6B5;
m_DepthStencilFormat = D3DFMT_D16;
m_MultiSampling = D3DMULTISAMPLE_NONE;
}
~CD3D9ModeInfo() {}
};
protected:
LPDIRECT3D9 m_pD3D9Obj;
static LPDIRECT3DDEVICE9 ms_pD3DDevice;
HWND m_hWnd;
D3DPRESENT_PARAMETERS m_PresentParameters;
D3DCAPS9 m_DeviceCaps;
CExceptionMgr *m_pExceptionMgr;
public:
static CD3D9WindowInfo m_WindowInfo;
static CD3D9ModeInfo m_ModeInfo;
static inline void _GetWindowSize(DWORD &dwWidth,DWORD &dwHeight)
{
dwWidth = m_WindowInfo.m_dwWidth;
dwHeight = m_WindowInfo.m_dwHeight;
}
//static inline CD3D9ModeInfo _GetModeInfo() { return m_ModeInfo;}
static inline LPDIRECT3DDEVICE9 _GetDevice() { return (ms_pD3DDevice != NULL) ? ms_pD3DDevice : NULL; }
inline HWND GetHwnd() { return m_hWnd;}
inline bool IsFullScreen() { return m_WindowInfo.m_bWindowed; }
inline bool IsD3DRunning() { return m_WindowInfo.m_bD3DRunning; }
// Change Fullscreen Mode
HRESULT SetFullScreen(bool bWin);
CD3D9GraphicLayer();
virtual ~CD3D9GraphicLayer();
// Device Create
HRESULT InitD3DLayer(HINSTANCE hInstance,
HWND hWnd,
DWORD dwWidth,
DWORD dwHeight,
bool bWindowed = true,
D3DFORMAT ColorFormat = D3DFMT_R5G6B5,
D3DFORMAT ZFormat = D3DFMT_D16,
DWORD dwVertexProcessing = D3DCREATE_HARDWARE_VERTEXPROCESSING,
D3DMULTISAMPLE_TYPE Antial = D3DMULTISAMPLE_NONE
);
void SaveSetting(); // Save D3D Create Info
void LoadSetting(); // Load D3D Create Info
// Device 로스트 되었나 테스팅
HRESULT CheckDeviceLost();
// Change Bit , width, height ..etc..
HRESULT ChangeMode(DWORD dwWidth, DWORD dwHeight, D3DFORMAT Pixel, D3DFORMAT Zbuffer,UINT UIPresent = D3DPRESENT_INTERVAL_IMMEDIATE);
HRESULT ChangePresentMode(UINT UIPresent = D3DPRESENT_INTERVAL_IMMEDIATE);
// 전체 모드시 Color Bit 지원되는가 check
HRESULT CheckD3DFormat(bool bFullScreen,D3DFORMAT iDepth,D3DFORMAT *pFormat);
D3DFORMAT Find16BitMode();
D3DFORMAT Find32BitMode();
void ReleaseAll();
virtual HRESULT CheckDeviceCaps();
virtual void InitScene();
void Render();
// 실 렌더링 코드가 들어갈 부분 Render Scene 부분
virtual void RenderScene(){};
virtual void Update(){};
virtual void Destroy(){};
};
};
};
#endif // !defined(AFX_D3D9GRAPHICLAYER_H__1026F404_E2F8_4612_A94C_A84F641A0C9A__INCLUDED_)