C++ externs and Shaders

BlitzMax Forums/OpenGL Module/C++ externs and Shaders

Drey(Posted 2006) [#1]
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.


Chris C(Posted 2006) [#2]
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


Drey(Posted 2006) [#3]
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.


Dreamora(Posted 2006) [#4]
Pub.GLEW will help you :-)

And HLSL / GLSL is its own language that is compiled ...
Although its syntax has similarities to C syntax.


Drey(Posted 2006) [#5]
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?


Tom(Posted 2006) [#6]
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.


Drey(Posted 2006) [#7]
That's awesome...this is just awesome...shaders on the way! :)