Main: add processor detection.
This commit is contained in:
parent
714d8cc6bb
commit
e21e7a1aba
1 changed files with 16 additions and 1 deletions
17
src/main.cpp
17
src/main.cpp
|
@ -18,6 +18,10 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <SDL_messagebox.h>
|
||||||
|
|
||||||
|
#include <cpuid.h>
|
||||||
|
|
||||||
#include <errhandlingapi.h>
|
#include <errhandlingapi.h>
|
||||||
#include <synchapi.h>
|
#include <synchapi.h>
|
||||||
#include <winerror.h>
|
#include <winerror.h>
|
||||||
|
@ -59,7 +63,18 @@ int main(int argc, char** argv) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utility::Debug{} << "===Initialising OpenGL renderer===";
|
std::uint32_t brand[12];
|
||||||
|
|
||||||
|
if (!__get_cpuid_max(0x80000004, nullptr)) {
|
||||||
|
Utility::Warning{} << "Warning: CPUID features not supported. Can't get the current processor's model.";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
__get_cpuid(0x80000002, brand+0x0, brand+0x1, brand+0x2, brand+0x3);
|
||||||
|
__get_cpuid(0x80000003, brand+0x4, brand+0x5, brand+0x6, brand+0x7);
|
||||||
|
__get_cpuid(0x80000004, brand+0x8, brand+0x9, brand+0xa, brand+0xb);
|
||||||
|
Utility::Debug{} << "Processor:" << Containers::arrayCast<const char>(brand).data();
|
||||||
|
}
|
||||||
|
|
||||||
SaveTool app({argc, argv});
|
SaveTool app({argc, argv});
|
||||||
Int result = app.exec();
|
Int result = app.exec();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue