Advertisement

get the target computer info

Started by January 31, 2003 12:10 AM
1 comment, last by tylerbingham 22 years, 1 month ago
I am building an OpenGL demo, but I need a way to find out what the target computer is able to run in as far as bits
a) CPU register/addressing size : check sizeof(void*) (in bytes)
b) OGL functionality : call glGetString() with GL_VERSION or GL_EXTENSIONS



[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
For further info on the cpu you''ll have to do some asm - check for the existence of the CPUID instruction and (if it exists) use it to retrieve the make, model, family and stepping info (Google). If it isn''t, you''ll have to base your conclusions on even more processor specific info. Note that all newer cpu''s have this instruction (since Pentium or 486 or something - not too sure). Furthermore, AFAIK new cpu''s (Atlons > 800 MHz (and their equals) or so - I could be wrong) have some burned in string which you can retrieve directly without having to base you conclusion on a set of tests. If you want cpu speed, then, again, you''ll have to fall back on testing. The instruction you''re looking for here is RDTSC (read time stamp counter). This is pretty heavy if you have never done assembly before - and what''s bad about it, is that there is no good API out there (such as OpenGL for the gpu), so I''m afraid you''ll have to write everything from scratch...

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement