File: system.h

package info (click to toggle)
clanlib 0.5.4-1-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 10,320 kB
  • ctags: 10,893
  • sloc: cpp: 76,056; xml: 3,281; sh: 2,961; perl: 1,204; asm: 837; makefile: 775
file content (69 lines) | stat: -rw-r--r-- 1,946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
	$Id: system.h,v 1.10 2002/01/06 13:27:48 mbn Exp $

	------------------------------------------------------------------------
	ClanLib, the platform independent game SDK.

	This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
	version 2. See COPYING for details.

	For a total list of contributers see CREDITS.

	See http://www.clanlib.org
	------------------------------------------------------------------------
*/

//! clanCore="System"
//! header=core.h

#ifndef header_system
#define header_system

class CL_EventListener;
class CL_Signal_v0;

//: Generic functions that didn't fit in other places.
class CL_System
{
public:
//! Operations:
	//: Checks for system events, updates input and other stuff.
	static void keep_alive();

	//: Checks for system events (pump the CL_KeepAlive objects).
	//- Return when 'millis' has elapsed.
	static void keep_alive(int millis);

	//: Checks for system events (pump the CL_KeepAlive objects).
	//- Return when one of the events trigger, or when timeout has elapsed.
	static bool keep_alive(CL_EventListener &events, int timeout = -1);

	//: Sleep for 'millis' milliseconds.
	static void sleep(int millis);

	//: Get the current time (since system boot), in milliseconds.
	static unsigned int get_time();

	//: Suspend the time.
	//: get_time() will continue to return the same value until resume_time() is called.
	static void suspend_time();

	//: Resumes the time.
	//: get_time() will return the current time again.
	static void resume_time();
	
	//: Returns true if MMX technology is available on this CPU.
	static bool detect_mmx();
	
	//: Returns true if 3DNow! technology is available on this CPU.
	static bool detect_3dnow();

	//: Returns true if extended 3DNow! is present on this CPU.
	static bool detect_ext_3dnow();

	//: Returns the signal emitted when WM_QUIT or similar window system quit
	//: message is received.
	static CL_Signal_v0 &sig_quit();
};

#endif