'CLR 빈 프로젝트'에서 소스파일을 생성하여 코드를 입력합니다.
Tutorial을 이렇게 시작하는 이유는 가능한한 Windows Forms와 관련된 코드를 배제하고 SlimDX에 관련된 코드에 집중할 수 있기 때문입니다.
앞으로 이 코드를 확장하여 Tutorial을 진행하겠습니다.
#include <windows.h>
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
public ref class WndForm : public Form
{
public:
WndForm()
{
this->ClientSize = System::Drawing::Size(400, 300);
this->StartPosition = FormStartPosition::CenterScreen;
this->Text = "D3D Tutorial 1";
}
~WndForm()
{
this->!WndForm();
}
!WndForm()
{
}
bool InitD3D()
{
return true;
}
void Render()
{
}
};
INT WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
{
WndForm^ frm = gcnew WndForm();
if (!frm->InitD3D()) {
MessageBox::Show("Initializing D3D Device Failed");
return 0;
}
frm->Show();
while (frm->Created) {
frm->Render();
Application::DoEvents();
}
return 0;
}


0 개의 댓글:
댓글 쓰기