Game Speed discrepancies for different computers

Hey guys,
I have this code for controlling the speed of a simple game written in c++:
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

	DWORD time_count			=  25;        // ms per frame, default if no performance counter
	LONGLONG next_time			=   0;        // time to render next frame
	LONGLONG cur_time			=   0;		  // current time
	LONGLONG perf_cnt			=	0;		  // performance timer frequency
	BOOL move_flag			= TRUE;		  // flag noting if we have moved yet

if (move_flag)
{



	// yes, move and clear flag
	actualGame->update();
        move_flag = FALSE;
}


	cur_time = timeGetTime();

	
// is it time to render the frame?
if (cur_time > next_time) 
{
// yes, render the frame
        actualGame->draw();
	// set time for next frame
	next_time += time_count;

       // If we get more than a frame ahead, allow us to drop one
// Otherwise, we will never catch up if we let the error
// accumulate, and message handling will suffer
	if (next_time < cur_time)
	{
		next_time = cur_time + time_count;
	}

	// flag that we need to move objects again
	move_flag = TRUE;
}


The problem still is, on SOME computers the game runs as expected and on SOME runs very fast.

Any suggestion what's wrong??
Last edited on
What i would do is look at the operating system, and the processor type. There is such thing as compatability.
Topic archived. No new replies allowed.