C++ externs and Shaders
BlitzMax Forums/OpenGL Module/C++ externs and Shaders
| ||
I'm going to dive deeper into shaders soon to see if it's possible to write shader ops in C++ and extern them to blitzmax. All i want to do is right shaders in C++. I still want to load vertexs and such through max. |
| ||
shaders have their own b*****rd child of C that they use, the code is compiled (usually on the fly) into code that your individual gfx card can run, it is not run on your cpu and is not "real" C |
| ||
yeah, i understand those things..but don't you write them in C++ or are truly their own language that has it's own compiler? I didn't think that's the case, the bigger picture is how to intergrade it into blitzmax. |
| ||
Pub.GLEW will help you :-) And HLSL / GLSL is its own language that is compiled ... Although its syntax has similarities to C syntax. |
| ||
so let me get this straight. I write some code in notepad. Then i have an openGL call compile the file(By passing the file) then executing it with another call or similar? |
| ||
Pretty much yes. Wether the shader source is from a text file, or a string within max, it is passed as a string array via some function calls, it's then compiled, attached and linked. Then you can enable/disable it before drawing geometry. |
| ||
That's awesome...this is just awesome...shaders on the way! :) |