I have made a python program which will create an OpenGL and render a teapot (GLUT standard teapot) with a shader that I specify. The shader is specified as follows:
- I have a file called "index.ini" which contains the file paths to a vertex shader and pixel shader file
- The program gets the contents of "index.ini" using "sys.argv[1]"
- I run the program from CMD with the following: "test.py index.ini"
I want to be able to right click on "index.ini" and open it by default with a C++ program, which will get the path to "index.ini" through "argv" and pass it to CMD, where I can make a call such as "test.py index.ini", using "system()". I have tried the following, but the program just hangs and then crashes.
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(char *argv[])
{
string toCall="<PATH>\\test.py ";
string file=argv[1];
cout<<argv[1]<<endl;
system("pause");
string finalCall = toCall + file;
system(finalCall.c_str());
}
Thanks :)