loading fragment program

For the moment, my fragment program is in a separate file, and I load it with a fread… But doing this, my program doesn’t work if I don’t have the FP file in the good directory, and I want to have only one executable file ! So how can I load my FP ?
If I write it directly to a string, it isn’t very nice to edit it…

Originally posted by Acheum:
my program doesn’t work if I don’t have the FP file in the good directory

Well, keep the file in the good directory then…
http://www.faqs.org/faqs/usenet/posting-rules/part1/

Originally posted by roffe:
Well, keep the file in the good directory then…
http://www.faqs.org/faqs/usenet/posting-rules/part1/

No, I don’t want to have multiple files for my program, I would like to have only one file : the executable !
I don’t wand text files in addition !

if you are developping a windows application, you can use resources. I don’t kwow how it work but I kwow it’s possible to store in the exe some data like bitmap, icons, text, bugs (duh !!!), …
the MSDN should help you.

If you want your text file to be a resource of the executable, where’s the benefit of putting your fragment program into a text file? Just use a constant.

@deiussum:
>>just use a constant.
i’m sure that he don’t know how to write a char-pointer constant over more than one line, like this:

—more cpp code here—

char *simpleVShader = “!!ARBvp1.0”

“PARAM mvp[4] = { state.matrix.mvp };”

“MOV result.color, vertex.color;”
“DP4 result.position.x, mvp[0], vertex.position;”
“DP4 result.position.y, mvp[1], vertex.position;”
“DP4 result.position.z, mvp[2], vertex.position;”
“DP4 result.position.w, mvp[3], vertex.position;”

“END”;

—more cpp code here—

[This message has been edited by DJSnow (edited 08-06-2003).]

Thanks for your answers !

Originally posted by DJSnow:
[b]@deiussum:
>>just use a constant.
i’m sure that he don’t know how to write a char-pointer constant over more than one line, like this:

[quote]

—more cpp code here—

char *simpleVShader = “!!ARBvp1.0”

“PARAM mvp[4] = { state.matrix.mvp };”

“MOV result.color, vertex.color;”
“DP4 result.position.x, mvp[0], vertex.position;”
“DP4 result.position.y, mvp[1], vertex.position;”
“DP4 result.position.z, mvp[2], vertex.position;”
“DP4 result.position.w, mvp[3], vertex.position;”

“END”;

—more cpp code here—

[/b][/QUOTE]

This doesn’t work on the compilation…

Or try :

—more cpp code here—

char *simpleVShader =
“!!ARBvp1.0
PARAM mvp[4] = { state.matrix.mvp };
MOV result.color, vertex.color;
DP4 result.position.x, mvp[0], vertex.position;
DP4 result.position.y, mvp[1], vertex.position;
DP4 result.position.z, mvp[2], vertex.position;
DP4 result.position.w, mvp[3], vertex.position;
END”;

—more cpp code here—

Note : if you want to insert comments, finish the commented line with ’
' instead of '', for instance :

"!!ARBvp1.0\

My comment


END"