views:

54

answers:

3

I am making a C++/Windows/DirectX program that requires the functions

d3d = Direct3DCreate9(D3D_SDK_VERSION);

and

d3d->CreateDevice(...);

when I run the program, these to init functions take particularily long to work (not long, but noticible). Is there any way to shorten the loading time of these?

The basic structure of the program is

INIT
WHILE TRUE
    CHECK WIN. MESSG.
    ONE FRAME OF GAME
END WHILE
RELEASE RESC.
+3  A: 

No. Unfortunately, initializing the D3D system and creating a device is a time consuming operation. It requires working with your drivers for your graphics card, initializing D3D, etc. About the only control you have over this is to possibly get a driver that does its internal initialization more quickly, or improving your hardware.

Reed Copsey
A: 

I think the time spent initializing DirectX is neglectable compared to the performance you can depend on afterwards. It shouldn't really be much of a problem unless you initialize often during your application's running time.

Cecil Has a Name
+1  A: 

You could always fire off a thread to do some work while DirectX is initialising ...

Goz