Skip to content

Commit a7e1c78

Browse files
committed
Minor fixes
1 parent 7bf20ba commit a7e1c78

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

examples_tests/common/CommonAPI.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,13 @@ class CommonAPI
392392
#ifdef _NBL_PLATFORM_WINDOWS_
393393
caller = nbl::core::make_smart_refctd_ptr<nbl::system::CSystemCallerWin32>();
394394
#endif
395-
return nbl::core::make_smart_refctd_ptr<nbl::system::ISystem>(std::move(caller));
395+
#ifdef _NBL_PLATFORM_WINDOWS_
396+
return nbl::core::make_smart_refctd_ptr<nbl::system::CSystemWin32>(std::move(caller));
397+
#elif defined(_NBL_PLATFORM_ANDROID_)
398+
return nbl::core::make_smart_refctd_ptr<nbl::system::CSystemAndroid>(std::move(caller));
399+
#else
400+
return nullptr;
401+
#endif
396402
}
397403

398404
struct QueueFamilyProps

include/nbl/system/CSystemWin32.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class CSystemCallerWin32 final : public ISystemCaller
2424

2525
class CSystemWin32 : public ISystem
2626
{
27+
public:
28+
CSystemWin32(core::smart_refctd_ptr<ISystemCaller>&& caller) : ISystem(std::move(caller)) {}
2729
//LOL the struct definition wasn't added to winapi headers do they ask to declare them yourself
2830
typedef struct _PROCESSOR_POWER_INFORMATION {
2931
ULONG Number;
@@ -37,9 +39,10 @@ class CSystemWin32 : public ISystem
3739
SystemInfo getSystemInfo() const override
3840
{
3941
SystemInfo info;
40-
PROCESSOR_POWER_INFORMATION cpuInfo;
41-
CallNtPowerInformation(ProcessorInformation, nullptr, 0, &cpuInfo, sizeof(cpuInfo));
42-
info.cpuFrequency = cpuInfo.MaxMhz;
42+
LARGE_INTEGER speed;
43+
QueryPerformanceFrequency(&speed);
44+
45+
info.cpuFrequency = speed.QuadPart;
4346

4447
info.desktopResX = GetSystemMetrics(SM_CXSCREEN);
4548
info.desktopResY = GetSystemMetrics(SM_CYSCREEN);

0 commit comments

Comments
 (0)