Original Post
I need to create a d3d device to perform texture loading and conversion. This works fine, except for the fact that when I create the d3d device, my monitor flickers black briefly. This wouldn't be so bad, except that the conversion is done by a command-line tool, and it gets rather annoying to have the screen flicker repeatedly when the tool is run from a batch file. I've tried every combination of arguments to CreateDevice I can think of (that would make sense, anyway). It seems that if I'm using D3DDEVTYPE_NULLREF, in windowed mode, and with no back-buffer, it shouldn't have to reset the gpu (or whatever it is precisely that causes the flicker) - but it does. So, on the off-chance that someone out there has found a work-around for this issue, please let me know. BTW, this is happening with in DirectX 9, with an nvidia quadro fx 3500 video card. I haven't tested it on other machines. Here's the code that exhibits the problem:
IDirect3D9 *d3d = Direct3DCreate9(D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS presentParams;
memset(&presentParams, 0, sizeof(presentParams));
presentParams.BackBufferWidth = 0;
presentParams.BackBufferHeight = 0;
presentParams.BackBufferFormat = D3DFMT_UNKNOWN;
presentParams.BackBufferCount = 0;
presentParams.MultiSampleType = D3DMULTISAMPLE_NONE;
presentParams.MultiSampleQuality = 0;
presentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
presentParams.hDeviceWindow = 0;
presentParams.Windowed = TRUE;
presentParams.EnableAutoDepthStencil = FALSE;
presentParams.AutoDepthStencilFormat = (D3DFORMAT)0;
presentParams.Flags = 0;
presentParams.FullScreen_RefreshRateInHz = 0;
presentParams.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
IDirect3DDevice9 *device;
d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_NULLREF, GetDesktopWindow(), D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParams, &device);