DirectX not working correctly.

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
xskater11x
Earned a small fee
Earned a small fee
Posts: 22
Joined: Sat May 20, 2006 2:45 am

DirectX not working correctly.

Post by xskater11x » Thu Jan 11, 2007 12:25 am

I found someone with a similar problem on GameDev and the proposed solution was to use EVT_IDLE, but it was never stated if it worked, and it did not work for me.

Mainly the problem is drawing to the actual window. I am using a basic wxFrame and passing its HWND to my DirectX class, and going at it from there, but when I start the app, instead of drawing a green screen, is stays the standard gray, which is typical of an MDI child (if i am correct?). If anyone has any ideas on how to allow DirectX to actually work on the window itself, it would be appreciated.

For reference my code for initialization is as follows:

Code: Select all

bool ClientApp::OnInit()
{
	//create a new window
	ClientFrame *frame = new ClientFrame("Dark Memories Client", 50, 50, 800, 600);

	//start out socket crappity
	wxSocketBase::Initialize();
	//bind to client frame
	frame->CreateSocketClient();
	frame->ShowFullScreen(TRUE,wxFULLSCREEN_ALL);

gCore.InitCore(800,600,D3DFMT_A8R8G8B8,(HWND)frame->GetHandle(),FALSE);

	frame->Show ( TRUE );
	//make it the window on top of all others
	SetTopWindow ( frame );

	return TRUE;
}
My Event table and Idle function are as follows:

Code: Select all

BEGIN_EVENT_TABLE (ClientFrame, wxFrame)

  EVT_MENU		(MENU_EXIT, ClientFrame::OnExit)
  EVT_SOCKET	(SOCKET_ID, ClientFrame::OnSocketEvent)
  EVT_IDLE    (ClientFrame::Idle)	

END_EVENT_TABLE()

void ClientFrame::Idle (wxIdleEvent &event)
{


	gCore.Begin();
	gCore.End();

	event.RequestMore();
	return;
}


If anything more is needed from me, just ask, I will gladly supply it. Also, I am willing to give out my MSN or GTalk to anyone interested in helping through chat.

Post Reply