These functions provide ability to create several pictures simultaneously. For most of cases it is useless but for widget classes (see Widget classes) they can provide a way to show animation. Also you can write several frames into animated GIF file.
mglGraph
: void
NewFrame ()
¶void
mgl_new_frame (HMGL
gr)
¶Creates new frame. Function returns current frame id. This is not thread safe function in OpenGL mode! Use direct list creation in multi-threading drawing. The function EndFrame()
must be call after the finishing of the frame drawing for each call of this function.
mglGraph
: void
EndFrame ()
¶void
mgl_end_frame (HMGL
gr)
¶Finishes the frame drawing.
mglGraph
: int
GetNumFrame ()
¶int
mgl_get_num_frame (HMGL
gr)
¶Gets the number of created frames.
mglGraph
: void
SetFrame (int
i)
¶void
mgl_set_frame (HMGL
gr, int
i)
¶Finishes the frame drawing and sets drawing data to frame i, which should be in range [0, GetNumFrame()
-1]. This function is similar to EndFrame()
but don’t add frame to the GIF image.
mglGraph
: void
GetFrame (int
i)
¶void
mgl_get_frame (HMGL
gr, int
i)
¶Replaces drawing data by one from frame i. Function work if MGL_VECT_FRAME
is set on (by default).
mglGraph
: void
ShowFrame (int
i)
¶void
mgl_show_frame (HMGL
gr, int
i)
¶Appends drawing data from frame i to current one. Function work if MGL_VECT_FRAME
is set on (by default).
mglGraph
: void
DelFrame (int
i)
¶void
mgl_del_frame (HMGL
gr, int
i)
¶Deletes drawing data for frame i and shift all later frame indexes. Function work if MGL_VECT_FRAME
is set on (by default). Do nothing in OpenGL mode.
mglGraph
: void
ResetFrames ()
¶void
mgl_reset_frames (HMGL
gr)
¶Reset frames counter (start it from zero).
mglGraph
: void
ClearFrame (int
i)
¶void
mgl_clear_frame (HMGL
gr, int
i)
¶Clear list of primitives for current drawing.
mglGraph
: void
StartGIF (const char *
fname, int
ms=100
)
¶void
mgl_start_gif (HMGL
gr, const char *
fname, int
ms)
¶Start writing frames into animated GIF file fname. Parameter ms set the delay between frames in milliseconds. You should not change the picture size during writing the cinema. Use CloseGIF()
to finalize writing. Note, that this function is disabled in OpenGL mode.