示例#1
0
bool OpenGL::initContext()
{
	if (contextInitialized)
		return true;

	if (!gladLoadGLLoader(LOVEGetProcAddress))
		return false;

	initOpenGLFunctions();
	initVendor();
	initMatrices();

	bugs = {};

#if defined(LOVE_WINDOWS) || defined(LOVE_LINUX)
	// See the comments in OpenGL.h.
	if (getVendor() == VENDOR_AMD)
	{
		bugs.clearRequiresDriverTextureStateUpdate = true;
		bugs.generateMipmapsRequiresTexture2DEnable = true;
	}
#endif

	contextInitialized = true;

	return true;
}
示例#2
0
const std::string OpenNI2Device::getStringID() const
{
  std::string ID_str = getName() + "_" + getVendor();

  boost::replace_all(ID_str, "/", "");
  boost::replace_all(ID_str, ".", "");
  boost::replace_all(ID_str, "@", "");

  return ID_str;
}
void SE_RenderSystemCapabilities::createHardwareInfo()
{
   //get gpu vendor
    const char* vendorName = (const char*)glGetString(GL_VENDOR);
    setVendor(vendorFromString(vendorName));

if(getVendor() == 11)
{
SE_Application::getInstance()->getSceneManager()->setSceneManagerStatus(ENABLELIGHT,false);
SE_Application::getInstance()->getSceneManager()->setSceneManagerStatus(ENABLEMIRROR,false);
SE_Application::getInstance()->getSceneManager()->setSceneManagerStatus(ENABLEGROUNDSHADOW,false);
}

    if(SE_Application::getInstance()->SEHomeDebug)
    LOGI("vendorName = %s\n",vendorName);

    //get compressed texture type num
    glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS,&mTextureCompressedTypeNum);

    //get compressed texture supported type
    int* compressTextureTypes = new int[mTextureCompressedTypeNum];
    glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS,compressTextureTypes);

    for(int i = 0; i < mTextureCompressedTypeNum; ++i)
    {
        mTextureCompressTypes.push_back(compressTextureTypes[i]);
    }    

    delete compressTextureTypes;

    //get maxium texture image unit number
    glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,&mMaxTextureImageUnitNum);
    if(SE_Application::getInstance()->SEHomeDebug)
    LOGI("GL_MAX_TEXTURE_IMAGE_UNITS = %d\n",mMaxTextureImageUnitNum);

    glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,&mMaxCombinedTextureImageUnitNum);
    if(SE_Application::getInstance()->SEHomeDebug)
    LOGI("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = %d\n",mMaxCombinedTextureImageUnitNum); 
         
    glGetIntegerv(GL_STENCIL_BITS,&mMaxStencilBufferNum);
    if(SE_Application::getInstance()->SEHomeDebug)
    LOGI("\n\nGL_STENCIL_BITS = %d\n\n",mMaxStencilBufferNum);
 
         
}
	//-----------------------------------------------------------------------
	void RenderSystemCapabilities::log(Log* pLog)
	{
#if OGRE_PLATFORM != OGRE_PLATFORM_WINRT
		pLog->logMessage("RenderSystem capabilities");
		pLog->logMessage("-------------------------");
		pLog->logMessage("RenderSystem Name: " + getRenderSystemName());
		pLog->logMessage("GPU Vendor: " + vendorToString(getVendor()));
		pLog->logMessage("Device Name: " + getDeviceName());
		pLog->logMessage("Driver Version: " + getDriverVersion().toString());
		pLog->logMessage(" * Fixed function pipeline: " 
			+ StringConverter::toString(hasCapability(RSC_FIXED_FUNCTION), true));
		pLog->logMessage(
			" * Hardware generation of mipmaps: "
			+ StringConverter::toString(hasCapability(RSC_AUTOMIPMAP), true));
		pLog->logMessage(
			" * Texture blending: "
			+ StringConverter::toString(hasCapability(RSC_BLENDING), true));
		pLog->logMessage(
			" * Anisotropic texture filtering: "
			+ StringConverter::toString(hasCapability(RSC_ANISOTROPY), true));
		pLog->logMessage(
			" * Dot product texture operation: "
			+ StringConverter::toString(hasCapability(RSC_DOT3), true));
		pLog->logMessage(
			" * Cube mapping: "
			+ StringConverter::toString(hasCapability(RSC_CUBEMAPPING), true));
		pLog->logMessage(
			" * Hardware stencil buffer: "
			+ StringConverter::toString(hasCapability(RSC_HWSTENCIL), true));
		if (hasCapability(RSC_HWSTENCIL))
		{
			pLog->logMessage(
				"   - Stencil depth: "
				+ StringConverter::toString(getStencilBufferBitDepth()));
			pLog->logMessage(
				"   - Two sided stencil support: "
				+ StringConverter::toString(hasCapability(RSC_TWO_SIDED_STENCIL), true));
			pLog->logMessage(
				"   - Wrap stencil values: "
				+ StringConverter::toString(hasCapability(RSC_STENCIL_WRAP), true));
		}
		pLog->logMessage(
			" * Hardware vertex / index buffers: "
			+ StringConverter::toString(hasCapability(RSC_VBO), true));
		if(hasCapability(RSC_VBO))
		{
			pLog->logMessage(
				" * 32-bit index buffers: "
				+ StringConverter::toString(hasCapability(RSC_32BIT_INDEX), true));
		}
		pLog->logMessage(
			" * Vertex programs: "
			+ StringConverter::toString(hasCapability(RSC_VERTEX_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for vertex programs: "
             + StringConverter::toString(mVertexProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for vertex programs: "
             + StringConverter::toString(mVertexProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for vertex programs: "
             + StringConverter::toString(mVertexProgramConstantBoolCount));
		pLog->logMessage(
			" * Fragment programs: "
			+ StringConverter::toString(hasCapability(RSC_FRAGMENT_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for fragment programs: "
             + StringConverter::toString(mFragmentProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for fragment programs: "
             + StringConverter::toString(mFragmentProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for fragment programs: "
             + StringConverter::toString(mFragmentProgramConstantBoolCount));
		pLog->logMessage(
			" * Geometry programs: "
			+ StringConverter::toString(hasCapability(RSC_GEOMETRY_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for geometry programs: "
             + StringConverter::toString(mGeometryProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for geometry programs: "
             + StringConverter::toString(mGeometryProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for geometry programs: "
             + StringConverter::toString(mGeometryProgramConstantBoolCount));
		pLog->logMessage(
			" * Tessellation Hull programs: "
			+ StringConverter::toString(hasCapability(RSC_TESSELLATION_HULL_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for tessellation hull programs: "
             + StringConverter::toString(mTessellationHullProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for tessellation hull programs: "
             + StringConverter::toString(mTessellationHullProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for tessellation hull programs: "
             + StringConverter::toString(mTessellationHullProgramConstantBoolCount));
		pLog->logMessage(
			" * Tessellation Domain programs: "
			+ StringConverter::toString(hasCapability(RSC_TESSELLATION_DOMAIN_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for tessellation domain programs: "
             + StringConverter::toString(mTessellationDomainProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for tessellation domain programs: "
             + StringConverter::toString(mTessellationDomainProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for tessellation domain programs: "
             + StringConverter::toString(mTessellationDomainProgramConstantBoolCount));
		pLog->logMessage(
			" * Compute programs: "
			+ StringConverter::toString(hasCapability(RSC_COMPUTE_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for compute programs: "
             + StringConverter::toString(mComputeProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for compute programs: "
             + StringConverter::toString(mComputeProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for compute programs: "
             + StringConverter::toString(mComputeProgramConstantBoolCount));
		String profileList = "";
		for(ShaderProfiles::iterator iter = mSupportedShaderProfiles.begin(), end = mSupportedShaderProfiles.end();
			iter != end; ++iter)
		{
			profileList += " " + *iter;
		}
		pLog->logMessage(" * Supported Shader Profiles:" + profileList);

		pLog->logMessage(
			" * Texture Compression: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION), true));
		if (hasCapability(RSC_TEXTURE_COMPRESSION))
		{
			pLog->logMessage(
				"   - DXT: "
				+ StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_DXT), true));
			pLog->logMessage(
				"   - VTC: "
				+ StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_VTC), true));
			pLog->logMessage(
                 "   - PVRTC: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_PVRTC), true));
			pLog->logMessage(
                 "   - ATC: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_ATC), true));
			pLog->logMessage(
                 "   - ETC1: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_ETC1), true));
			pLog->logMessage(
                 "   - ETC2: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_ETC2), true));
			pLog->logMessage(
                 "   - BC4/BC5: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_BC4_BC5), true));
			pLog->logMessage(
                 "   - BC6H/BC7: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_BC6H_BC7), true));
		}

		pLog->logMessage(
			" * Scissor Rectangle: "
			+ StringConverter::toString(hasCapability(RSC_SCISSOR_TEST), true));
		pLog->logMessage(
			" * Hardware Occlusion Query: "
			+ StringConverter::toString(hasCapability(RSC_HWOCCLUSION), true));
		pLog->logMessage(
			" * User clip planes: "
			+ StringConverter::toString(hasCapability(RSC_USER_CLIP_PLANES), true));
		pLog->logMessage(
			" * VET_UBYTE4 vertex element type: "
			+ StringConverter::toString(hasCapability(RSC_VERTEX_FORMAT_UBYTE4), true));
		pLog->logMessage(
			" * Infinite far plane projection: "
			+ StringConverter::toString(hasCapability(RSC_INFINITE_FAR_PLANE), true));
		pLog->logMessage(
			" * Hardware render-to-texture: "
			+ StringConverter::toString(hasCapability(RSC_HWRENDER_TO_TEXTURE), true));
		pLog->logMessage(
			" * Floating point textures: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_FLOAT), true));
		pLog->logMessage(
			" * Non-power-of-two textures: "
			+ StringConverter::toString(hasCapability(RSC_NON_POWER_OF_2_TEXTURES), true)
			+ (mNonPOW2TexturesLimited ? " (limited)" : ""));
		pLog->logMessage(
			" * 1d textures: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_1D), true));
		pLog->logMessage(
			" * Volume textures: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_3D), true));
		pLog->logMessage(
			" * Multiple Render Targets: "
			+ StringConverter::toString(mNumMultiRenderTargets));
		pLog->logMessage(
			"   - With different bit depths: " + StringConverter::toString(hasCapability(RSC_MRT_DIFFERENT_BIT_DEPTHS), true));
		pLog->logMessage(
			" * Point Sprites: "
			+ StringConverter::toString(hasCapability(RSC_POINT_SPRITES), true));
		pLog->logMessage(
			" * Extended point parameters: "
			+ StringConverter::toString(hasCapability(RSC_POINT_EXTENDED_PARAMETERS), true));
		if(hasCapability(RSC_POINT_SPRITES))
		{
			pLog->logMessage(
				" * Max Point Size: "
				+ StringConverter::toString(mMaxPointSize));
		}
		pLog->logMessage(
			" * Vertex texture fetch: "
			+ StringConverter::toString(hasCapability(RSC_VERTEX_TEXTURE_FETCH), true));
		pLog->logMessage(
             " * Number of world matrices: "
             + StringConverter::toString(mNumWorldMatrices));
		pLog->logMessage(
             " * Number of texture units: "
             + StringConverter::toString(mNumTextureUnits));
		pLog->logMessage(
             " * Stencil buffer depth: "
             + StringConverter::toString(mStencilBufferBitDepth));
		pLog->logMessage(
             " * Number of vertex blend matrices: "
             + StringConverter::toString(mNumVertexBlendMatrices));
		if (hasCapability(RSC_VERTEX_TEXTURE_FETCH))
		{
			pLog->logMessage(
				"   - Max vertex textures: "
				+ StringConverter::toString(mNumVertexTextureUnits));
			pLog->logMessage(
				"   - Vertex textures shared: "
				+ StringConverter::toString(mVertexTextureUnitsShared, true));

		}
		pLog->logMessage(
			" * Render to Vertex Buffer : "
			+ StringConverter::toString(hasCapability(RSC_HWRENDER_TO_VERTEX_BUFFER), true));
        pLog->logMessage(
            " * Hardware Atomic Counters: "
            + StringConverter::toString(hasCapability(RSC_ATOMIC_COUNTERS), true));

		if (mCategoryRelevant[CAPS_CATEGORY_GL])
		{
			pLog->logMessage(
				" * GL 1.5 without VBO workaround: "
				+ StringConverter::toString(hasCapability(RSC_GL1_5_NOVBO), true));

			pLog->logMessage(
				" * Frame Buffer objects: "
				+ StringConverter::toString(hasCapability(RSC_FBO), true));
			pLog->logMessage(
				" * Frame Buffer objects (ARB extension): "
				+ StringConverter::toString(hasCapability(RSC_FBO_ARB), true));
			pLog->logMessage(
				" * Frame Buffer objects (ATI extension): "
				+ StringConverter::toString(hasCapability(RSC_FBO_ATI), true));
			pLog->logMessage(
				" * PBuffer support: "
				+ StringConverter::toString(hasCapability(RSC_PBUFFER), true));
			pLog->logMessage(
				" * GL 1.5 without HW-occlusion workaround: "
				+ StringConverter::toString(hasCapability(RSC_GL1_5_NOHWOCCLUSION), true));
            pLog->logMessage(
                " * Vertex Array Objects: "
                + StringConverter::toString(hasCapability(RSC_VAO), true));
			pLog->logMessage(
                " * Separate shader objects: "
                + StringConverter::toString(hasCapability(RSC_SEPARATE_SHADER_OBJECTS), true));
		}

		if (mCategoryRelevant[CAPS_CATEGORY_D3D9])
		{
			pLog->logMessage(
				" * DirectX per stage constants: "
				+ StringConverter::toString(hasCapability(RSC_PERSTAGECONSTANT), true));
		}
#endif
	}
示例#5
0
    void DiGfxCaps::LogCaps()
    {
        DI_INFO("-------------------------");
        DI_INFO("--Graphics capabilities--");
        DI_INFO("-------------------------");

        DI_INFO("GfxDriver: %s", getRenderSystemName().c_str());
        DI_INFO("GPU Vendor: %s", vendorToString(getVendor()).c_str());
        DI_INFO("Device Name: %s", getDeviceName().c_str());
        DI_INFO("Driver Version: %s", getDriverVersion().toString().c_str());

        DI_INFO(" * Hardware generation of mipmaps: %s", _BoolToStr(hasCapability(RSC_AUTOMIPMAP)));
        DI_INFO(" * Anisotropic texture filtering: %s", _BoolToStr(hasCapability(RSC_ANISOTROPY)));
        DI_INFO(" * Hardware stencil buffer: %s", _BoolToStr(hasCapability(RSC_HWSTENCIL)));

        if (hasCapability(RSC_HWSTENCIL))
        {
            DI_INFO("   - Stencil depth: %d", getStencilBufferBitDepth());
            DI_INFO("   - Two sided stencil support: %s", _BoolToStr(hasCapability(RSC_TWO_SIDED_STENCIL)));
            DI_INFO("   - Wrap stencil values: %s", _BoolToStr(hasCapability(RSC_STENCIL_WRAP)));
        }
        DI_INFO(" * 32-bit index buffers: %s", +_BoolToStr(hasCapability(RSC_32BIT_INDEX)));

        DI_INFO(" * Vertex shader: %s", _BoolToStr(hasCapability(RSC_VERTEX_PROGRAM)));
        DI_INFO(" * Number of float constants for vertex shader: %d", mVertexProgramConstantFloatCount);
        DI_INFO(" * Number of int constants for vertex shader: %d", mVertexProgramConstantIntCount);
        DI_INFO(" * Number of bool constants for vertex shader: %d", mVertexProgramConstantBoolCount);

        DI_INFO(" * Fragment shader: %s", _BoolToStr(hasCapability(RSC_FRAGMENT_PROGRAM)));
        DI_INFO(" * Number of float constants for fragment shader: %d", mFragmentProgramConstantFloatCount);
        DI_INFO(" * Number of int constants for fragment shader: %d", mFragmentProgramConstantIntCount);
        DI_INFO(" * Number of bool constants for fragment shader: %d", mFragmentProgramConstantBoolCount);

        DiString profileList = "";
        for(ShaderProfiles::iterator iter = mSupportedShaderProfiles.begin(), end = mSupportedShaderProfiles.end();
            iter != end; ++iter)
        {
            profileList += " " + *iter;
        }
        DI_INFO(" * Supported Shader Profiles: %s", profileList.c_str());

        DI_INFO(" * Texture Compression: ", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION)));
        if (hasCapability(RSC_TEXTURE_COMPRESSION))
        {
            DI_INFO("   - DXT: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_DXT)));
            DI_INFO("   - VTC: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_VTC)));
            DI_INFO("   - PVRTC: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_PVRTC)));
            DI_INFO("   - ATC: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_ATC)));
            DI_INFO("   - ETC1: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_ETC1)));
            DI_INFO("   - ETC2: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_ETC2)));
            DI_INFO("   - BC4/BC5: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_BC4_BC5)));
            DI_INFO("   - BC6H/BC7: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_BC6H_BC7)));
        }

        DI_INFO(" * Scissor Rectangle: %s", _BoolToStr(hasCapability(RSC_SCISSOR_TEST)));
        DI_INFO(" * Hardware Occlusion Query: %s", _BoolToStr(hasCapability(RSC_HWOCCLUSION)));
        DI_INFO(" * User clip planes: %s", _BoolToStr(hasCapability(RSC_USER_CLIP_PLANES)));
        DI_INFO(" * VET_UBYTE4 vertex element type: %s", _BoolToStr(hasCapability(RSC_VERTEX_FORMAT_UBYTE4)));
        DI_INFO(" * Infinite far plane projection: %s", _BoolToStr(hasCapability(RSC_INFINITE_FAR_PLANE)));
        DI_INFO(" * Hardware render-to-texture: %s", _BoolToStr(hasCapability(RSC_HWRENDER_TO_TEXTURE)));
        DI_INFO(" * Floating point textures: %s", _BoolToStr(hasCapability(RSC_TEXTURE_FLOAT)));
        DI_INFO(" * Non-power-of-two textures: %s %s", _BoolToStr(hasCapability(RSC_NON_POWER_OF_2_TEXTURES)),(mNonPOW2TexturesLimited ? " (limited)" : ""));
        DI_INFO(" * 1D textures: %s", _BoolToStr(hasCapability(RSC_TEXTURE_1D)));
        DI_INFO(" * 3D textures: %s", _BoolToStr(hasCapability(RSC_TEXTURE_3D)));
        DI_INFO(" * Multiple Render Targets: %d", mNumMultiRenderTargets);
        DI_INFO("   - With different bit depths: %s", _BoolToStr(hasCapability(RSC_MRT_DIFFERENT_BIT_DEPTHS)));
        
        DI_INFO(" * Vertex texture fetch: %s", _BoolToStr(hasCapability(RSC_VERTEX_TEXTURE_FETCH)));
        DI_INFO(" * Number of world matrices: %d", mNumWorldMatrices);
        DI_INFO(" * Number of texture units: %d", mNumTextureUnits);
        DI_INFO(" * Stencil buffer depth: %d", mStencilBufferBitDepth);
        DI_INFO(" * Number of vertex blend matrices: %d", mNumVertexBlendMatrices);

        DI_INFO(" * Render to Vertex Buffer : %s", _BoolToStr(hasCapability(RSC_HWRENDER_TO_VERTEX_BUFFER)));
        DI_INFO(" * Hardware Atomic Counters: %s", _BoolToStr(hasCapability(RSC_ATOMIC_COUNTERS)));

        if (mCategoryRelevant[CAPS_CATEGORY_GL])
        {
            DI_INFO(" * GL 1.5 without VBO workaround: %s"
                , _BoolToStr(hasCapability(RSC_GL1_5_NOVBO)));
            DI_INFO(" * Frame Buffer objects: %s"
                , _BoolToStr(hasCapability(RSC_FBO)));
            DI_INFO(" * Frame Buffer objects (ARB extension): %s"
                , _BoolToStr(hasCapability(RSC_FBO_ARB)));
            DI_INFO(" * Frame Buffer objects (ATI extension): %s"
                , _BoolToStr(hasCapability(RSC_FBO_ATI)));
            DI_INFO(" * PBuffer support: %s"
                , _BoolToStr(hasCapability(RSC_PBUFFER)));
            DI_INFO(" * GL 1.5 without HW-occlusion workaround: %s"
                , _BoolToStr(hasCapability(RSC_GL1_5_NOHWOCCLUSION)));
            DI_INFO(" * Vertex Array Objects: %s"
                , _BoolToStr(hasCapability(RSC_VAO)));
            DI_INFO(" * Separate shader objects: %s"
                , _BoolToStr(hasCapability(RSC_SEPARATE_SHADER_OBJECTS)));
        }

        if (mCategoryRelevant[CAPS_CATEGORY_D3D9])
        {
            DI_INFO(" * DirectX per stage constants: %s", _BoolToStr(hasCapability(RSC_PERSTAGECONSTANT)));
        }
    }
GpuCapabilitiesWindows::FileVersion GpuCapabilitiesWindows::getDriverVersion() {

    FileVersion fileVersion;
    fileVersion.versionString = "";

    // Try to get driver file version
    if ( GpuCapabilities::getVendor() == GPU_VENDOR_NVIDIA ) {

        // Get fileversion of NVIDIA OpenGL dll
        LDEBUG("Reading file version of NVIDIA driver dll ... ");
        FileVersion fileVersion;
        //TODO: windows vista stores the name of the dll in the registry.
        //      its better to get the name from there (cdoer)
        if (getOSVersion() == OS_WIN_VISTA)
            fileVersion = getFileVersion("nvoglv32.dll");
        else
            fileVersion = getFileVersion(DRIVER_DLL_NVIDIA);

        if (fileVersion.versionString.length() == 0) {
            LDEBUG("Reading NVIDIA driver version failed.");
        }
        else {
            LDEBUG("Reading driver version successful.");
            return fileVersion;
        }
    }
    else if (getVendor() == GPU_VENDOR_ATI) {

        // Get fileversion of ATI OpenGL dll
        LDEBUG("Reading file version of ATI driver dll ... ");
        FileVersion fileVersion = getFileVersion(DRIVER_DLL_ATI);
        if ( fileVersion.versionString.length() == 0 ) {
            LDEBUG("Reading ATI driver version failed.");
        }
        else {
            LDEBUG("Reading driver version successful.");
            return fileVersion;
        }
    }

#ifdef CGT_WITH_WMI
    // unknown graphics board vendor or reading NVIDIA/Ati driver version failed:
    // get driver version from WMI
    LDEBUG("Reading driver version from WMI ...");

    // Win32_VideoController class: http://msdn2.microsoft.com/en-us/library/aa394512.aspx
    std::string version = WMIqueryStr("Win32_VideoController", "DriverVersion");

    if (version.length() == 0) {
        LDEBUG("Failed to retrieve driver version from WMI.");
        LWARNING("Failed to detect driver version.");
    }
    else {
        fileVersion.versionString = version;
        // do not parse driver version string since it is not necessarily a file version string
        fileVersion.d1 = 0;
        fileVersion.d2 = 0;
        fileVersion.d3 = 0;
        fileVersion.d4 = 0;
        fileVersion.version = 0;
        LDEBUG("Successfully read driver version from WMI");
    }
    return fileVersion;

#else
    LDEBUG("Compiled without WMI support.");
    LWARNING("Failed to detect driver version.");
    return fileVersion;
#endif

}
std::string GpuCapabilitiesWindows::getDriverDate() {

    LDEBUG("Retrieving driver date ...");

    if ( getVendor() == GPU_VENDOR_NVIDIA ) {

        LDEBUG("Retrieving driver date by querying file date of NVIDIA driver dll ...");

        std::string result;
        //TODO: windows vista stores the name of the dll in the registry.
        //      its better to get the name from there (cdoer)
        if (getOSVersion() == OS_WIN_VISTA)
            result = getFileDate("nvoglv32.dll");
        else
            result = getFileDate(DRIVER_DLL_NVIDIA);

        if (result.length() == 0) {
            LDEBUG("Failed reading driver date from NVIDIA driver dll.");
        }
        else {
            LDEBUG("Reading driver date successful.");
            return result;
        }
    }
    else if (getVendor() == GPU_VENDOR_ATI) {
        LDEBUG("Retrieving driver date by querying file date of ATI driver dll ...");
        std::string result = getFileDate(DRIVER_DLL_ATI);
        if (result.length() == 0) {
            LDEBUG("Failed reading driver date from ATI driver dll.");
        }
        else {
            LDEBUG("Reading driver date successful.");
            return result;
        }
    }

#ifdef CGT_WITH_WMI

    // unknown vendor or reading driver date from vendor dll failed:
    // read driver date from WMI
    LDEBUG("Reading driver date from WMI ...");

    if (isWMIinited()) {
        // Win32_VideoController class: http://msdn2.microsoft.com/en-us/library/aa394512.aspx
        std::string date = WMIqueryStr("Win32_VideoController", "DriverDate");

        if (date.length() > 0) {

            LDEBUG("Reading driver date successful.");

            // convert to yyyy-mm-dd format.
            // see http://msdn2.microsoft.com/en-us/library/aa387237.aspx for specification of CIM_DATETIME
            std::string dateformat = "";
            dateformat.append(date.substr(0,4));
            dateformat.append("-");
            dateformat.append(date.substr(4,2));
            dateformat.append("-");
            dateformat.append(date.substr(6,2));

            return dateformat;
        }
        else {
            LDEBUG("Failed reading driver date.");
            LWARNING("Failed to detect driver date");
            return "";
        }
    }
    else {
        LDEBUG("Unable to read DriverDate from WMI: not inited");
    }

#else
    LDEBUG("Compiled without WMI support.");
    LWARNING("Failed to detect driver date");
#endif

    return "";

}
示例#8
0
DeviceItem *
PlatformUdisks::getNewDevice(QString devicePath)
{
    QString path, model, vendor;

    DeviceItem *devItem = new DeviceItem;
    path = getPath(devicePath);
    if (path == "")
        return(NULL);

    if (!getIsDrive(devicePath))
        return(NULL);

    model = getModel(devicePath);
    vendor = getVendor(devicePath);

    devItem->setUDI(devicePath);
    devItem->setPath(path);
    devItem->setIsRemovable(getIsRemovable(devicePath));
    devItem->setSize(getSize(devicePath));
    devItem->setModelString(model);
    if (vendor == "")
    {
        if (mKioskMode)
            devItem->setVendorString("SUSE Studio USB Key");
        else
            devItem->setVendorString("Unknown Device");
    }
    else
    {
        devItem->setVendorString(vendor);
    }
    QString newDisplayString = QString("%1 %2 - %3 (%4 MB)")
                               .arg(devItem->getVendorString())
                               .arg(devItem->getModelString())
                               .arg(devItem->getPath())
                               .arg(devItem->getSize() / 1048576);
    devItem->setDisplayString(newDisplayString);

    if (mKioskMode)
    {
        if((devItem->getSize() / 1048576) > 200000)
        {
            delete devItem;
            return(NULL);
        }
    }

    // If a device is 0 megs we might as well just not list it
    if ((devItem->getSize() / 1048576) > 0)
    {
        itemList << devItem;
    }
    else
    {
        delete devItem;
        devItem = NULL;
    }

    return(devItem);
}
示例#9
0
void oglx_caps_t::report(oglx_caps_t& self) {
    auto& renderer = Ego::Renderer::get();
    Log::Entry e(Log::Level::Info, __FILE__, __LINE__);
    {
        const auto info = renderer.getInfo();
        e << "OpenGL" << Log::EndOfLine
            << "  version = " << info.getVersion() << Log::EndOfLine
            << "  vendor = " << info.getVendor() << Log::EndOfLine
            << "  renderer = " << info.getRenderer() << Log::EndOfLine;
        e << "  extensions =";
        for (const auto& extension : self.gl_extensions) {
            e << " " << extension;
        }
        e << Log::EndOfLine;
    }
#if 0
    Log::get().message("\tGL_MAX_MODELVIEW_STACK_DEPTH     == %d\n", self.max_modelview_stack_depth);
    Log::get().message("\tGL_MAX_PROJECTION_STACK_DEPTH    == %d\n", self.max_projection_stack_depth);
    Log::get().message("\tGL_MAX_TEXTURE_STACK_DEPTH       == %d\n", self.max_texture_stack_depth);
    Log::get().message("\tGL_MAX_NAME_STACK_DEPTH          == %d\n", self.max_name_stack_depth);
    Log::get().message("\tGL_MAX_ATTRIB_STACK_DEPTH        == %d\n", self.max_attrib_stack_depth);
    Log::get().message("\tGL_MAX_CLIENT_ATTRIB_STACK_DEPTH == %d\n\n", self.max_client_attrib_stack_depth);
#endif

#if 0
    Log::get().message("\tGL_SUBPIXEL_BITS          == %d\n", self.subpixel_bits);
    Log::get().message("\tGL_POINT_SIZE_RANGE       == %f - %f\n", self.point_size_range[0], self.point_size_range[1]);
    Log::get().message("\tGL_POINT_SIZE_GRANULARITY == %f\n", self.point_size_granularity);
    Log::get().message("\tGL_LINE_WIDTH_RANGE       == %f - %f\n", self.line_width_range[0], self.line_width_range[1]);
    Log::get().message("\tGL_LINE_WIDTH_GRANULARITY == %f\n\n", self.line_width_granularity);
#endif

#if 0
    Log::get().message("\tGL_MAX_VIEWPORT_DIMS == %d, %d\n", self.max_viewport_dims[0], self.max_viewport_dims[1]);
    Log::get().message("\tGL_AUX_BUFFERS       == %d\n", self.aux_buffers);
    Log::get().message("\tGL_RGBA_MODE         == %s\n", self.rgba_mode ? "TRUE" : "FALSE");
    Log::get().message("\tGL_INDEX_MODE        == %s\n", self.index_mode ? "TRUE" : "FALSE");
    Log::get().message("\tGL_DOUBLEBUFFER      == %s\n", self.doublebuffer ? "TRUE" : "FALSE");
    Log::get().message("\tGL_STEREO            == %s\n", self.stereo ? "TRUE" : "FALSE");
#endif
    {
        // Print the colour buffer colour depth.
        const auto colourDepth = renderer.getColourBuffer().getColourDepth();
        e << "  Colour Buffer Colour Depth:" << Log::EndOfLine
            << "    " << "red bits = " << colourDepth.getRedDepth() << Log::EndOfLine
            << "    " << "green bits = " << colourDepth.getGreenDepth() << Log::EndOfLine
            << "    " << "blue bits = " << colourDepth.getBlueDepth() << Log::EndOfLine
            << "    " << "alpha bits = " << colourDepth.getAlphaDepth() << Log::EndOfLine;
    }
    {
        // Print the accumulation buffer colour depth.
        const auto colourDepth = renderer.getAccumulationBuffer().getColourDepth();
        e << "  Accumulation Buffer Colour Depth:" << Log::EndOfLine
            << "    " << "red bits = " << colourDepth.getRedDepth() << Log::EndOfLine
            << "    " << "green bits = " << colourDepth.getGreenDepth() << Log::EndOfLine
            << "    " << "blue bits = " << colourDepth.getBlueDepth() << Log::EndOfLine
            << "    " << "alpha bits = " << colourDepth.getAlphaDepth() << Log::EndOfLine;
    }
    {
        // Print depth buffer and stencil buffer depth.
        e << "  Depth Buffer Depth:" << renderer.getDepthBuffer().getDepth() << Log::EndOfLine;
        e << "  Stencil Buffer Depth:" << renderer.getStencilBuffer().getDepth() << Log::EndOfLine;
    }
#if 0
	Log::get().message("\tGL_INDEX_BITS        == %d\n", self.index_bits);
#endif


#if 0
	Log::get().message("\tGL_MAX_LIGHTS        == %d\n", self.max_lights);
	Log::get().message("\tGL_MAX_CLIP_PLANES   == %d\n", self.max_clip_planes);
	Log::get().message("\tGL_MAX_TEXTURE_SIZE  == %d\n\n", self.max_texture_size);

	Log::get().message("\tGL_MAX_PIXEL_MAP_TABLE == %d\n", self.max_pixel_map_table);
	Log::get().message("\tGL_MAX_LIST_NESTING    == %d\n", self.max_list_nesting);
	Log::get().message("\tGL_MAX_EVAL_ORDER      == %d\n\n", self.max_eval_order);

    if (self.anisotropic_supported)
    {
		Log::get().message("\tGL_MAX_TEXTURE_MAX_ANISOTROPY_EXT == %f\n", self.maxAnisotropy);
    }

	Log::get().message("==============================================================\n");
#endif
    e << Log::EndOfEntry;
    Log::get() << e;
}
QString DeviceInfo::getDescription() const
{
    return getUART() + ':' + QString::number(getID()) + '(' + getVendor() + '.' + getProduct() + '.' + getVersion() + ')';
}