mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[c-host] nvfbc: print out the SDK version and enable NvFBC
This commit is contained in:
parent
09d4fea9e2
commit
afe072adf1
@ -37,6 +37,7 @@ struct NVAPI
|
||||
NvFBC_SetGlobalFlagsType setGlobalFlags;
|
||||
NvFBC_GetStatusExFunctionType getStatusEx;
|
||||
NvFBC_EnableFunctionType enable;
|
||||
NvFBC_GetSDKVersionFunctionType getVersion;
|
||||
};
|
||||
|
||||
struct stNvFBCHandle
|
||||
@ -64,6 +65,33 @@ bool NvFBCInit()
|
||||
nvapi.setGlobalFlags = (NvFBC_SetGlobalFlagsType )GetProcAddress(nvapi.dll, "NvFBC_SetGlobalFlags");
|
||||
nvapi.getStatusEx = (NvFBC_GetStatusExFunctionType )GetProcAddress(nvapi.dll, "NvFBC_GetStatusEx" );
|
||||
nvapi.enable = (NvFBC_EnableFunctionType )GetProcAddress(nvapi.dll, "NvFBC_Enable" );
|
||||
nvapi.getVersion = (NvFBC_GetSDKVersionFunctionType)GetProcAddress(nvapi.dll, "NvFBC_GetSDKVersion" );
|
||||
|
||||
if (
|
||||
!nvapi.createEx ||
|
||||
!nvapi.setGlobalFlags ||
|
||||
!nvapi.getStatusEx ||
|
||||
!nvapi.enable ||
|
||||
!nvapi.getVersion)
|
||||
{
|
||||
DEBUG_ERROR("Failed to get the required proc addresses");
|
||||
return false;
|
||||
}
|
||||
|
||||
NvU32 version;
|
||||
if (nvapi.getVersion(&version) != NVFBC_SUCCESS)
|
||||
{
|
||||
DEBUG_ERROR("Failed to get the NvFBC SDK version");
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_INFO("NvFBC SDK Version: %lu", version);
|
||||
|
||||
if (nvapi.enable(NVFBC_STATE_ENABLE) != NVFBC_SUCCESS)
|
||||
{
|
||||
DEBUG_ERROR("Failed to enable the NvFBC interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
nvapi.initialized = true;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user