Lite-C - Examples

Examples

The following lite-C program prints "Hello World", then plays a movie file and exits.

void main { printf("Hello, World!"); // message box screen_size.x = 400; screen_size.y = 400; // resize the window int handle = media_play("greetings.mpg",NULL,50); // start a movie in the whole window at volume 50. while(media_playing(handle)) wait(1); // wait until movie was finished sys_exit(NULL); }

The following lite-C program opens a 3D window and displays a spinning sphere

void main { level_load(""); // open an empty level. you can use NULL instead of "" ENTITY* sphere = ent_create("sphere.mdl",vector(0,0,0),NULL); // create sphere model at position (0,0,0) while(1) { sphere->pan += 1; // rotate the sphere with 1 degree per frame wait(1); // wait one frame } }

Read more about this topic:  Lite-C

Famous quotes containing the word examples:

    In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.
    Michel de Montaigne (1533–1592)

    It is hardly to be believed how spiritual reflections when mixed with a little physics can hold people’s attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.
    —G.C. (Georg Christoph)

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)