Am 29.06.2017 um 21:24 schrieb Fabian Greffrath:
> control: tags -1 +patch
> 
> Am Donnerstag, den 29.06.2017, 12:04 +0100 schrieb James Cowgill:
>> It looks to me like the game loop has no sleeps or other waiting in
>> it.
>> It has probably always consumed 100% CPU.
> 
> Good catch! I have simply added a usleep(10) call in the main loop,
> effectively capping the game at about 100 FPS, and it settled at around
> 4% CPU consumption:
> 
> --- 3dchess-0.8.1.orig/src/main.c
> +++ 3dchess-0.8.1/src/main.c
> @@ -201,6 +201,7 @@ DoMain3DcLoop(void)
>            XtDispatchEvent(&event);
>          }
>  
> +    usleep(10);
>      } /* End game loop */
>  
>    return;

Well done! I need to finish some stuff here and test your patch soon.

Cheers,

Markus


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to