Running Slow when Compiled in Visual Studio .NET 2003

Started by
7 comments, last by ptl 18 years, 10 months ago
I tried to compile the third of Andy Pike's DirectX Tutorials (A spinning cube colored by vertex colors), and I'm getting about 5 frames a second. I ran other similar applications that I had compiled in Microsoft VC++ 6.0 on another machine, and they ran fine. I tried switching to release mode, but this had no effect. Any idea why this might be?
Advertisement
Somehow the software rasterization mode is being used. Check to make sure the the device is being created with HAL.
--m_nPostCount++
Here is what I am using to setup my device, It looks to me like I am using HAL...

HRESULT InitialiseD3D(HWND hWnd){	g_pD3D = Direct3DCreate8(D3D_SDK_VERSION);		if(g_pD3D == NULL)	{		return E_FAIL;	}	D3DDISPLAYMODE d3ddm;	if(FAILED(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)))	{		return E_FAIL;	}	D3DPRESENT_PARAMETERS d3dpp;	ZeroMemory(&d3dpp, sizeof(d3dpp));	d3dpp.Windowed = TRUE;	d3dpp.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC;	d3dpp.BackBufferFormat = d3ddm.Format;	if(FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice)))	{		return E_FAIL;	}	g_pD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);	g_pD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE);    	return S_OK;}
g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice)

Maybe you want to specify
D3DCREATE_HARDWARE_VERTEXPROCESSING
instead of
D3DCREATE_SOFTWARE_VERTEXPROCESSING.
Maybe check if exceptions is enabled in .net and not in MSVC6?
nmi - I tried what you said, and to no avail. When I use Hardware rather than software, the window doesn't even open and my program does nothing.

eq - How would I go about doing that?

thanks to both of you!
That looks fine to me... I haven't worked with the vsync swapeffect yet-- but I would imagine it works as advertised ;)

Have you actually tried compiling this demo in MSVC6, just for giggles? Otherwise, it might be something somewhere else... what you posted looks just fine.

-dbh
------------------------------------------------------------GDC/IGF 2006 Student Showcase Submission: Curator Defense
You haven't by any chance got 'Use Managed Extensions' set to yes have you? I have seen people working away quite happily not realising this is ticked and then wondering about the long start up times etc.
------------------------See my games programming site at: www.toymaker.info
I had the same problem a couple of days ago because both my release and debug version was linking to the debug version of libc (there is a new tab somewhere on VC 7 for this). Check if you link with the good lib (LIBCMT.lib or LIBCMT.lib, not Libcd.lib or licmtd.lib).

ptl

This topic is closed to new replies.

Advertisement