split stuff out into cpu, os, gfx interfaces
This was SVN commit r557.
This commit is contained in:
parent
1e47f64630
commit
0eeca662cc
18
source/lib/cpu.h
Executable file
18
source/lib/cpu.h
Executable file
@ -0,0 +1,18 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
extern char cpu_type[];
|
||||
extern double cpu_freq;
|
||||
|
||||
// -1 if detect not yet called, or cannot be determined
|
||||
extern int cpus;
|
||||
extern int cpu_speedstep;
|
||||
extern int cpu_smp;
|
||||
// are there actually multiple physical processors,
|
||||
// not only logical hyperthreaded CPUs? relevant for wtime.
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -112,7 +112,9 @@ double cpu_freq = 0.f;
|
||||
// -1 if detect not yet called, or cannot be determined
|
||||
int cpus = -1;
|
||||
int cpu_speedstep = -1;
|
||||
|
||||
int cpu_smp = -1;
|
||||
// are there actually multiple physical processors,
|
||||
// not only logical hyperthreaded CPUs? relevant for wtime.
|
||||
|
||||
static inline void get_cpu_info()
|
||||
{
|
||||
|
@ -26,46 +26,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// useful for choosing a video mode. not called by detect().
|
||||
// if we fail, outputs are unchanged (assumed initialized to defaults)
|
||||
extern int get_cur_vmode(int* xres, int* yres, int* bpp, int* freq);
|
||||
|
||||
// useful for determining aspect ratio. not called by detect().
|
||||
// if we fail, outputs are unchanged (assumed initialized to defaults)
|
||||
extern int get_monitor_size(int& width_mm, int& height_mm);
|
||||
#include "gfx.h"
|
||||
#include "os.h"
|
||||
#include "cpu.h"
|
||||
|
||||
|
||||
|
||||
extern char gfx_card[64]; // default: ""
|
||||
extern char gfx_drv_ver[64]; // default: ""
|
||||
|
||||
// attempt to detect graphics card without OpenGL (in case ogl init fails,
|
||||
// or we want more detailed info). gfx_card[] is unchanged on failure.
|
||||
extern void get_gfx_info();
|
||||
|
||||
|
||||
//
|
||||
// mem
|
||||
//
|
||||
|
||||
extern size_t tot_mem;
|
||||
extern size_t avl_mem;
|
||||
|
||||
// updates *_mem above
|
||||
extern void get_mem_status();
|
||||
|
||||
|
||||
//
|
||||
// CPU
|
||||
//
|
||||
|
||||
extern char cpu_type[];
|
||||
extern double cpu_freq;
|
||||
|
||||
// -1 if detect not yet called, or cannot be determined
|
||||
extern int cpus;
|
||||
extern int cpu_speedstep;
|
||||
|
||||
extern void detect();
|
||||
|
||||
|
||||
|
17
source/lib/gfx.h
Executable file
17
source/lib/gfx.h
Executable file
@ -0,0 +1,17 @@
|
||||
|
||||
// useful for choosing a video mode. not called by detect().
|
||||
// if we fail, outputs are unchanged (assumed initialized to defaults)
|
||||
extern int get_cur_vmode(int* xres, int* yres, int* bpp, int* freq);
|
||||
|
||||
// useful for determining aspect ratio. not called by detect().
|
||||
// if we fail, outputs are unchanged (assumed initialized to defaults)
|
||||
extern int get_monitor_size(int& width_mm, int& height_mm);
|
||||
|
||||
|
||||
|
||||
extern char gfx_card[64]; // default: ""
|
||||
extern char gfx_drv_ver[64]; // default: ""
|
||||
|
||||
// attempt to detect graphics card without OpenGL (in case ogl init fails,
|
||||
// or we want more detailed info). gfx_card[] is unchanged on failure.
|
||||
extern void get_gfx_info();
|
9
source/lib/os.h
Executable file
9
source/lib/os.h
Executable file
@ -0,0 +1,9 @@
|
||||
//
|
||||
// mem
|
||||
//
|
||||
|
||||
extern size_t tot_mem;
|
||||
extern size_t avl_mem;
|
||||
|
||||
// updates *_mem above
|
||||
extern void get_mem_status();
|
Loading…
Reference in New Issue
Block a user