Multi-monitor/OpenGL check
by Christian Beaumont · in Torque Game Engine Advanced · 10/25/2004 (9:07 pm) · 0 replies
I just noticed a peculiarity...
I was trying the "Super Simple Torque Demo" on my system using TSE. This demo specifies $pref::Video::displayDevice as OpenGL in main.cs.
When I have both my monitors attached TSE actually starts and I see the GUI.
If I now disable my secondary monitor TSE pops up a dialog that says "OpenGL is not implemented yet"
I tracked it down to Platform::initWindow() in winWindow.cpp
specifically the lines:
if (dStrcmp(renderer, "D3D") == 0)
GFXInit::createDevice( adapters[0] );
else
GFXInit::createDevice( adapters[1] );
Since the application does not specify D3D it always ends up in the else branch. When I don't have two monitors attached adapters[1] is bogus since there is only one adapter in the array yet it still calls createDevice passing the bogus array entry. This later blows up in the Assert() in GFXDevice::get()
AssertFatal( smGFXDevice[smActiveDeviceIndex] != NULL && smActiveDeviceIndex > -1, "Attempting to get invalid GFX device." );
By the way shouldn't this be the other way around?
AssertFatal( smActiveDeviceIndex > -1 && smGFXDevice[smActiveDeviceIndex] != NULL , "Attempting to get invalid GFX device." );
Since you are doing the check for smActiveDeviceIndex after you already try to dereference the array which in my case causes an access violation.
I'm not quite sure of the intention in Platform::initWindow() since there is no real correlation between the requirement for OpenGL and the list of adapters (at the moment). I'm assuming it's just unfinished code.
Anyway, just thought you might want to know about it.
best wishes,
Christian
I was trying the "Super Simple Torque Demo" on my system using TSE. This demo specifies $pref::Video::displayDevice as OpenGL in main.cs.
When I have both my monitors attached TSE actually starts and I see the GUI.
If I now disable my secondary monitor TSE pops up a dialog that says "OpenGL is not implemented yet"
I tracked it down to Platform::initWindow() in winWindow.cpp
specifically the lines:
if (dStrcmp(renderer, "D3D") == 0)
GFXInit::createDevice( adapters[0] );
else
GFXInit::createDevice( adapters[1] );
Since the application does not specify D3D it always ends up in the else branch. When I don't have two monitors attached adapters[1] is bogus since there is only one adapter in the array yet it still calls createDevice passing the bogus array entry. This later blows up in the Assert() in GFXDevice::get()
AssertFatal( smGFXDevice[smActiveDeviceIndex] != NULL && smActiveDeviceIndex > -1, "Attempting to get invalid GFX device." );
By the way shouldn't this be the other way around?
AssertFatal( smActiveDeviceIndex > -1 && smGFXDevice[smActiveDeviceIndex] != NULL , "Attempting to get invalid GFX device." );
Since you are doing the check for smActiveDeviceIndex after you already try to dereference the array which in my case causes an access violation.
I'm not quite sure of the intention in Platform::initWindow() since there is no real correlation between the requirement for OpenGL and the list of adapters (at the moment). I'm assuming it's just unfinished code.
Anyway, just thought you might want to know about it.
best wishes,
Christian