ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
gencode.cpp
Go to the documentation of this file.
1#include "mx2-ollama.hpp"
2
3int main(int argc, char **argv) {
4 std::string filename = "shader.glsl";
5 std::string host = "localhost";
6 std::string model = "codellama:7b";
7
8 if (argc >= 2)
9 host = argv[1];
10 if (argc >= 3)
11 model = argv[2];
12 if (argc >= 4)
13 filename = argv[3];
14
15 std::cout << "ACMX2 Ai Shader Generator..\n";
16 std::cout << "(C) 2025 LostSideDead Software\n";
17 std::cout.flush();
18
19 std::cout << "What do you want the shader to do: ";
20 std::string total;
21 std::getline(std::cin, total);
22
23 try {
24 mx::ObjectRequest request(host, model, filename);
25 request.setPrompt(total);
26 std::string code = request.generateCode();
27 if (code.empty()) {
28 std::cout << "Failed to generate code\n";
29 return EXIT_FAILURE;
30 }
31 } catch (const mx::ObjectRequestException &e) {
32 std::cout << "Error: " << e.what() << "\n";
33 return EXIT_FAILURE;
34 }
35 return 0;
36}
int main(int argc, char **argv)
Application entry point.
virtual const char * what() const noexcept override