Game Development Community

NVPerfHUD define is bugged.

by Stefan Lundmark · in Torque Game Engine Advanced · 03/19/2007 (5:11 am) · 14 replies

// Define if you want nVIDIA's NVPerfHUD to work with TSE
#define TORQUE_NVPERFHUD

Is bugged. I get an error box that says I need to have a D3D9 card.

#1
03/19/2007 (12:47 pm)
Do you have a D3D9 card. If you dont...its not a bug.
#2
03/19/2007 (1:10 pm)
And why exactly would I mention that the define is bugged, if running without it set, has the same result? Thanks though...
#3
03/19/2007 (3:31 pm)
I think what he refers: Is your card out of sight of DX SDK Dec 06 and later a DX 9 card?
DX9 sadly isn't DX9 anymore. I would assume that the newer NV Perf refer to the current DX9 standard which means shader 2 compliant on an Win2k / WinXP system or better.
#4
03/19/2007 (4:06 pm)
That error message does not mean that you need to have D3D9 support, it is just a generic error message that means Direct3D was not initialized properly. It could be that the October (?) SDK which TGEA uses is too old, I have no clue.

Edit:

D3DDEVTYPE_REF

Does not work on both of my systems here. If anyone else can try it, please do (:
#5
04/04/2007 (11:32 pm)
That whole function seems to have issues, thus I rewrote ours based on what the NVPerfHud documentation said -

// Create D3D Presentation params
   D3DPRESENT_PARAMETERS d3dpp = setupPresentParams( mode );

   // Set default settings
   UINT AdapterToUse=D3DADAPTER_DEFAULT;
   D3DDEVTYPE DeviceType=D3DDEVTYPE_HAL;

#ifdef TORQUE_NVPERFHUD

	   // Look for 'NVIDIA NVPerfHUD' adapter
	   // If it is present, override default settings
	   for (UINT Adapter=0;Adapter<mD3D->GetAdapterCount();Adapter++)
	   {
		   D3DADAPTER_IDENTIFIER9 Identifier;
		   HRESULT Res;
		   Res = mD3D->GetAdapterIdentifier(Adapter,0,&Identifier);
		   if (strstr(Identifier.Description,"NVPerfHUD") != 0)
		   {
			   AdapterToUse=Adapter;
			   DeviceType=D3DDEVTYPE_REF;
			   break;
		   }
	   }
#endif

   // Vertex processing was changed from MIXED to HARDWARE because of the switch to a pure D3D device.
   // If this causes problems, please let me know: patw@garagegames.com

   // Set up device flags from our compile flags.
   U32 deviceFlags = 0;
   deviceFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;

   // Add the multithread flag if we're a multithread build.
#ifdef TORQUE_MULTITHREAD
   deviceFlags |= D3DCREATE_MULTITHREADED;
#endif

   // Try to do pure, unless we're doing debug (and thus doing more paranoid checking).
#ifndef TORQUE_DEBUG_RENDER
   deviceFlags |= D3DCREATE_PUREDEVICE;
#endif

   HRESULT hres = mD3D->CreateDevice( AdapterToUse, DeviceType, 
                                       winState.appWindow, deviceFlags, 
                                       &d3dpp, &mD3DDevice );

   //regenStates();


I added existing lines at the beginning and end so it would be easy to find where all of thise goes
#6
04/06/2007 (1:24 pm)
I will check that out in a moment, thanks as always Jeremiah.

I take it you guys are staying with TGEA, after all? I hope so!
#7
04/06/2007 (3:27 pm)
If you have any issues, lemme know... :)

As for staying with TGEA, nothing else much for us to use currently that supports certain requirements we need... plus we're finally "stable", minus some odd crashes here and there. I, also, just spent a little bit of time reintegrating FMOD again, but this time using the Event system exclusively (though still some backwards compatibility), so in no hurry to have to run away lol
#8
04/06/2007 (3:30 pm)
On FMOD: Just a shame they are going to get rid of Hardware support (or they will according to Brett). Software is kind of cool, but it is a pretty hefty hit if you use any filters.
#9
04/06/2007 (3:37 pm)
Well.. Theres good and bad things with that.. but if they continue to support OpenAL then other than just totally making everything go thru software, there will still be hw interaction. I guess its easier to support software though, since they know what is going on versus with hardware there could be all kinds of oddities
#10
04/06/2007 (4:33 pm)
Their OpenAL implementation is quite buggy, and was said to be phased out in favour of DirectSound soon. Makes me wish I had the source license, but I do not ;)

Sorry for the offtopic btw.
#11
04/06/2007 (4:35 pm)
Lol.. Well, with Microsoft dropping HW support in DirectSound with Vista, its not surprising they would move in that direction, although sucks in some cases, but theres still computers that have sound cards without OpenAL HW support, so it still goes to SW lol
#12
04/06/2007 (4:49 pm)
Bah! I guess the future looks "promising" for software then? Oh well.
#13
04/06/2007 (4:58 pm)
Lol, I guess.. then again CPUs are getting so powerful so... but ah well, I'm happy with my new implementation so far with the event system so we'll see
#14
04/06/2007 (5:02 pm)
Truly powerful.

Good luck :)