'\" t .\" Title: s3d_mainloop .\" Author: Simon Wunderlich .\" Generator: DocBook XSL Stylesheets .\" .\" Manual: s3d Manual .\" Source: s3d .\" Language: English .\" .TH "S3D_MAINLOOP" "3" "" "s3d" "s3d Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" s3d_mainloop \- set mainloop of program .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ s3d_mainloop('u .BI "int s3d_mainloop(void(*)(void)\ " "f" ");" .SH "DESCRIPTION" .PP Takes a function as argument\&. It will loop this function until a quit\-event is received\&. You can pass NULL if you have no function to be looped, but its better to sleep some time if you have nothing to do anyway to save cpu\-time\&. .sp .if n \{\ .RS 4 .\} .nf void mainloop(void) { usleep(1000); // sleep 1 ms in every cycle } \&.\&.\&. s3d_mainloop(mainloop()); .fi .if n \{\ .RE .\} .SH "AUTHOR" .PP \fBSimon Wunderlich\fR .RS 4 Author of s3d .RE