Just trying to make an editor for my game. Im aiming to have directx render into a Split Container (C++ forms). I've managed to have it render into a picturebox, but moving it onto a split container panel has proved problematic. I also have an issue with some of the controls on the form rendering incorrectly (I've got a feeling its related to the directx renderer..?). Anyways, pictures will describe better:
And what it should look like (according to visual studio):
The DX renderer is initialized like this:
Form1(HINSTANCE hInstance)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInstance;
wc.hbrBackground = NULL;
wc.lpszClassName = L"WindowClass";
RegisterClassEx(&wc);
hWnd = CreateWindowEx(NULL, L"WindowClass", NULL, WS_CHILD,
this->splitContainer3->Panel1->ClientRectangle.X, this->splitContainer3->Panel1->ClientRectangle.Y,
this->splitContainer3->Panel1->Width, this->splitContainer3->Panel1->Height,
(HWND)this->splitContainer3->Panel1->Handle.ToPointer(),
NULL,
hInstance,
NULL);
if(hWnd == NULL)
MessageBoxA(NULL, "Error in HWND!", "ERROR", MB_OK | MB_ICONEXCLAMATION);
ShowWindow(hWnd, SW_SHOW);
directxHandle = new DXHandler((HWND)this->splitContainer3->Panel1->Handle.ToPointer(), this->splitContainer3->Panel1->Size.Height, this->splitContainer3->Panel1->Size.Width);
HInstance = hInstance;
}
Thanks,
James Warner