Commit 7e857cea authored by lukeph's avatar lukeph

committed getVendorInfo() patch by BlindSide.

seems to work fine in opengl. directx untested

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1055 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 11a16957
......@@ -801,6 +801,9 @@ namespace video
\param color: New color of the ambient light. */
virtual void setAmbientLight(const SColorf& color) = 0;
//! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() = 0;
};
} // end namespace video
......@@ -809,3 +812,4 @@ namespace video
#endif
......@@ -202,6 +202,18 @@ bool CD3D9Driver::initDriver(const core::dimension2d<s32>& screenSize, HWND hwnd
sprintf(tmp, "%s %s %d.%d.%d.%d", dai.Description, dai.Driver, Product, Version,
SubVersion, Build);
os::Printer::log(tmp, ELL_INFORMATION);
// Assign vendor name based on vendor id.
switch(dai.VendorId)
{
case 0x1002 : vendorName = "ATI Technologies Inc."; break;
case 0x10DE : vendorName = "NVIDIA Corporation"; break;
case 0x102B : vendorName = "Matrox Electronic Systems Ltd."; break;
case 0x121A : vendorName = "3dfx Interactive Inc"; break;
case 0x5333 : vendorName = "S3 Graphics Co., Ltd."; break;
case 0x8086 : vendorName = "Intel Corporation"; break;
default: vendorName = "Unknown VendorId: ";vendorName += (u32)dai.VendorId; break;
}
}
D3DDISPLAYMODE d3ddm;
......@@ -2213,3 +2225,4 @@ IVideoDriver* createDirectX9Driver(const core::dimension2d<s32>& screenSize, HWN
} // end namespace video
} // end namespace irr
......@@ -190,6 +190,9 @@ namespace video
//! \param enable: If true, enable the clipping plane else disable it.
virtual void enableClipPlane(u32 index, bool enable);
//! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() {return vendorName;};
private:
// enumeration for rendering modes such as 2d and 3d for minizing the switching of renderStates.
......@@ -293,6 +296,8 @@ namespace video
bool Fullscreen;
SColorf AmbientLight;
core::stringc vendorName;
};
......@@ -303,3 +308,4 @@ namespace video
#endif // _IRR_COMPILE_WITH_DIRECT3D_9_
#endif // __C_VIDEO_DIRECTX_8_H_INCLUDED__
......@@ -414,6 +414,9 @@ namespace video
//! \param enable: If true, enable the clipping plane else disable it.
virtual void enableClipPlane(u32 index, bool enable);
//! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() {return "Not available on this driver.";};
protected:
//! deletes all textures
......@@ -527,3 +530,4 @@ namespace video
#endif
......@@ -272,7 +272,10 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize,
const GLubyte* renderer = glGetString(GL_RENDERER);
const GLubyte* vendor = glGetString(GL_VENDOR);
if (renderer && vendor)
{
os::Printer::log(reinterpret_cast<const c8*>(renderer), reinterpret_cast<const c8*>(vendor), ELL_INFORMATION);
vendorName = reinterpret_cast<const c8*>(vendor);
}
u32 i;
for (i=0; i<MATERIAL_MAX_TEXTURES; ++i)
......@@ -2416,3 +2419,4 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize,
#endif // _IRR_COMPILE_WITH_OPENGL_
......@@ -297,6 +297,9 @@ namespace video
//! \param enable: If true, enable the clipping plane else disable it.
virtual void enableClipPlane(u32 index, bool enable);
//! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() {return vendorName;};
private:
void uploadClipPlane(u32 index);
......@@ -348,6 +351,8 @@ namespace video
core::dimension2d<s32> CurrentRendertargetSize;
core::stringc vendorName;
#ifdef _IRR_WINDOWS_API_
HDC HDc; // Private GDI Device Context
HWND Window;
......@@ -368,3 +373,4 @@ namespace video
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment