remove static ddraw.dll dep

This commit is contained in:
cxgeorge 2001-12-20 00:05:23 +00:00
parent 4984d9b860
commit 0b2dc96d80
5 changed files with 29 additions and 15 deletions

View File

@ -29,6 +29,7 @@ ConfigureFn(config_wdxdisplay) {
init_libwdxdisplay(); init_libwdxdisplay();
} }
int dx_use_multimon = config_wdxdisplay.GetInt("dx-multimon", 1);
bool dx_force_16bpp_zbuffer = config_wdxdisplay.GetBool("dx-force-16bpp-zbuffer", false); bool dx_force_16bpp_zbuffer = config_wdxdisplay.GetBool("dx-force-16bpp-zbuffer", false);
bool bResponsive_minimized_fullscreen_window = config_wdxdisplay.GetBool("responsive-minimized-fullscreen-window",false); bool bResponsive_minimized_fullscreen_window = config_wdxdisplay.GetBool("responsive-minimized-fullscreen-window",false);

View File

@ -27,6 +27,7 @@ NotifyCategoryDecl(wdxdisplay, EXPCL_PANDADX, EXPTP_PANDADX);
extern bool bResponsive_minimized_fullscreen_window; extern bool bResponsive_minimized_fullscreen_window;
extern bool dx_force_16bpp_zbuffer; extern bool dx_force_16bpp_zbuffer;
extern int dx_use_multimon;
extern Filename get_icon_filename(); extern Filename get_icon_filename();
extern Filename get_mono_cursor_filename(); extern Filename get_mono_cursor_filename();
extern Filename get_color_cursor_filename(); extern Filename get_color_cursor_filename();

View File

@ -33,8 +33,8 @@ wdxGraphicsPipe::wdxGraphicsPipe(const PipeSpecifier& spec)
: InteractiveGraphicsPipe(spec) { : InteractiveGraphicsPipe(spec) {
// _width = GetSystemMetrics(SM_CXSCREEN); // _width = GetSystemMetrics(SM_CXSCREEN);
// _height = GetSystemMetrics(SM_CYSCREEN); // _height = GetSystemMetrics(SM_CYSCREEN);
_shift = false; // _shift = false;
// global_pipe = this; // global_pipe = this;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View File

@ -68,7 +68,7 @@ private:
// int _width; // int _width;
// int _height; // int _height;
bool _shift; // bool _shift;
protected: protected:

View File

@ -54,6 +54,8 @@ typedef map<HWND,wdxGraphicsWindow *> HWND_PANDAWIN_MAP;
HWND_PANDAWIN_MAP hwnd_pandawin_map; HWND_PANDAWIN_MAP hwnd_pandawin_map;
wdxGraphicsWindow* global_wdxwinptr = NULL; // need this for temporary windproc wdxGraphicsWindow* global_wdxwinptr = NULL; // need this for temporary windproc
#define MAX_DEVICES 20
extern bool dx_full_screen_antialiasing; // defined in dxgsg_config.cxx extern bool dx_full_screen_antialiasing; // defined in dxgsg_config.cxx
#define MOUSE_ENTERED 0 #define MOUSE_ENTERED 0
@ -1291,24 +1293,35 @@ dx_setup() {
// Check for DirectX 7 by looking for DirectDrawCreateEx // Check for DirectX 7 by looking for DirectDrawCreateEx
HINSTANCE DDHinst = LoadLibrary( "ddraw.dll" ); HINSTANCE DDHinst = LoadLibrary("ddraw.dll");
if(DDHinst == 0) { if(DDHinst == 0) {
wdxdisplay_cat.fatal() << "can't locate DDRAW.DLL!" << endl; wdxdisplay_cat.fatal() << "can't locate DDRAW.DLL!\n";
exit(1); exit(1);
} }
if(NULL == GetProcAddress( DDHinst, "DirectDrawCreateEx" )) { typedef HRESULT (WINAPI * LPDIRECTDRAWCREATEEX)(GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter);
wdxdisplay_cat.fatal() << "Panda currently requires at least DirectX 7.0!" << endl;
// load all ddraw exports dynamically to avoid static link to ddraw.dll, in case system doesnt have it
LPDIRECTDRAWCREATEEX pDDCreateEx = (LPDIRECTDRAWCREATEEX) GetProcAddress(DDHinst,"DirectDrawCreateEx");
if(pDDCreateEx == NULL) {
wdxdisplay_cat.fatal() << "Panda currently requires at least DirectX 7.0!\n";
exit(1);
}
LPDIRECTDRAWENUMERATEEX pDDEnumEx = (LPDIRECTDRAWENUMERATEEX) GetProcAddress(DDHinst,"DirectDrawEnumerateEx");
if(pDDEnumEx == NULL) {
wdxdisplay_cat.fatal() << "GetProcAddr failed for DirectDrawEnumerateEx!\n";
exit(1); exit(1);
} }
GUID DriverGUID; GUID DriverGUID;
ZeroMemory(&DriverGUID,sizeof(GUID)); ZeroMemory(&DriverGUID,sizeof(GUID));
// search for early voodoo-type non-primary display drivers // search for early voodoo-type non-primary display drivers
// if they exist, use them for 3D (could examine 3D devices on all // if they exist, use them for 3D (could examine 3D devices on all
// drivers and pick the best one, but I'll assume the computer setuper knows what he's doing) // drivers and pick the best one, but I'll assume the computer setuper knows what he's doing)
if(hr = DirectDrawEnumerateEx( DriverEnumCallback, &DriverGUID, DDENUM_NONDISPLAYDEVICES )) { if(hr = (*pDDEnumEx)( DriverEnumCallback, &DriverGUID, DDENUM_NONDISPLAYDEVICES )) {
wdxdisplay_cat.fatal() << "config() - DirectDrawEnumerateEx failed : result = " << ConvD3DErrorToString(hr) << endl; wdxdisplay_cat.fatal() << "config() - DirectDrawEnumerateEx failed : result = " << ConvD3DErrorToString(hr) << endl;
exit(1); exit(1);
} }
@ -1319,14 +1332,14 @@ dx_setup() {
} }
// Create the Direct Draw Object // Create the Direct Draw Object
hr = DirectDrawCreateEx(pOurDriverGUID, (void **)&pDD, IID_IDirectDraw7, NULL); hr = (*pDDCreateEx)(pOurDriverGUID, (void **)&pDD, IID_IDirectDraw7, NULL);
if(hr != DD_OK) { if(hr != DD_OK) {
wdxdisplay_cat.fatal() wdxdisplay_cat.fatal()
<< "config() - DirectDrawCreateEx failed : result = " << ConvD3DErrorToString(hr) << endl; << "config() - DirectDrawCreateEx failed : result = " << ConvD3DErrorToString(hr) << endl;
exit(1); exit(1);
} }
FreeLibrary(DDHinst); //undo LoadLib above, decrement ddrawl.dll refcnt (after DDrawCreate, since dont want to unload/reload) FreeLibrary(DDHinst); //undo LoadLib above, decrement ddraw.dll refcnt (after DDrawCreate, since dont want to unload/reload)
pDD->GetDeviceIdentifier(&_DXDeviceID,0x0); pDD->GetDeviceIdentifier(&_DXDeviceID,0x0);
@ -1344,8 +1357,7 @@ dx_setup() {
exit(1); exit(1);
} }
D3DDEVICEDESC7 d3ddevs[2]; // put HAL in 0, TnLHAL in 1 D3DDEVICEDESC7 d3ddevs[MAX_DEVICES]; // put HAL in 0, TnLHAL in 1
// just look for HAL and TnL devices right now. I dont think // just look for HAL and TnL devices right now. I dont think
// we have any interest in the sw rasts at this point // we have any interest in the sw rasts at this point