Skeletal Animation Multithread Face
Functions
main.cpp File Reference
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <boost/process.hpp>
#include <filesystem>
#include "./include/rendering.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 11 of file main.cpp.

12{
13 // Process cmd
14 auto process_cmd = boost::process::search_path("python3").string();
15
16 // Process name
17 std::string process_name = (std::filesystem::current_path() /
18 "face_mesh_server.py").string();
19
20 // Begin forking
21 int fork_id = fork();
22
23 // Initialize child errors
24 int err;
25
26 if (fork_id == 0)
27 {
28 // Execute child process
29 err = execlp(process_cmd.c_str(), process_cmd.c_str(), process_name.data(), NULL);
30 if (err == -1)
31 {
32 std::cout << "Could not execute python server" << std::endl;
33 }
34 }
35 else
36 {
37 // Sleep for a bit to make sure that the server has woken up
38 sleep(1);
39
40 // Initialize cpp client and render in the parent process
41 Rendering rendering;
42
43 wait(NULL);
44 }
45}
This class performs the rendering of the scene. This has been included inside a class for better orga...
Definition: rendering.h:22