star plugin
This commit is contained in:
parent
839537af37
commit
58fe69fd5d
@ -1 +1,9 @@
|
|||||||
add_subdirectory("./http")
|
option(ENABLE_PLUGIN_HTTP "Enable http plugin" ON)
|
||||||
|
if(ENABLE_PLUGIN_HTTP)
|
||||||
|
add_subdirectory("./http")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(ENABLE_PLUGIN_STAR "Enable star plugin" ON)
|
||||||
|
if(ENABLE_PLUGIN_STAR)
|
||||||
|
add_subdirectory("./star")
|
||||||
|
endif()
|
3
src/graph/plugins/star/CMakeLists.txt
Normal file
3
src/graph/plugins/star/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
file(GLOB_RECURSE STAR_SOURCES "./*.c")
|
||||||
|
add_library(star SHARED ${STAR_SOURCES})
|
||||||
|
set_target_properties(star PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
|
23
src/graph/plugins/star/star.c
Normal file
23
src/graph/plugins/star/star.c
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <graph/plugins/plugin.h>
|
||||||
|
|
||||||
|
int run();
|
||||||
|
int destroy();
|
||||||
|
|
||||||
|
plugin_t plugin = {.version=1, .run_method=&run, .destroy_method=&destroy, .update_callback=0, .argc=0, .argv=0};
|
||||||
|
|
||||||
|
int run() {
|
||||||
|
point_t points[6] = {
|
||||||
|
{2/4.0, 2/2.0},
|
||||||
|
{3/4.0, 0/2.0},
|
||||||
|
{0/4.0, 1/2.0},
|
||||||
|
{4/4.0, 1/2.0},
|
||||||
|
{1/4.0, 0/2.0},
|
||||||
|
{2/4.0, 2/2.0}
|
||||||
|
};
|
||||||
|
|
||||||
|
plugin.update_callback(0, "star", points, 6);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int destroy() { return 0; }
|
Loading…
Reference in New Issue
Block a user