--- /dev/null
+#pragma MSP stage(vertex)
+out gl_PerVertex
+{
+ vec4 gl_Position;
+ float gl_ClipDistance[];
+};
+
+#pragma MSP stage(geometry)
+in gl_PerVertex
+{
+ vec4 gl_Position;
+ float gl_ClipDistance[];
+} gl_in[];
+out gl_PerVertex
+{
+ vec4 gl_Position;
+ float gl_ClipDistance[];
+};
+#include <msp/gl/resources.h>
+#include <msp/io/seekable.h>
#include "builtin.h"
#include "parser.h"
using namespace std;
-namespace {
-
-const char builtins_src[] =
- "#pragma MSP stage(vertex)\n"
- "out gl_PerVertex {\n"
- " vec4 gl_Position;\n"
- " float gl_ClipDistance[];\n"
- "};\n"
- "#pragma MSP stage(geometry)\n"
- "in gl_PerVertex {\n"
- " vec4 gl_Position;\n"
- " float gl_ClipDistance[];\n"
- "} gl_in[];\n"
- "out gl_PerVertex {\n"
- " vec4 gl_Position;\n"
- " float gl_ClipDistance[];\n"
- "};\n";
-
-}
-
namespace Msp {
namespace GL {
namespace SL {
{
initialized = true;
+ RefPtr<IO::Seekable> io = Resources::get_builtins().open("_builtin.glsl");
+ if(!io)
+ return 0;
+
Parser parser;
- Module *module = new Module(parser.parse(builtins_src, "<builtin>", BUILTIN_SOURCE));
+ Module *module = new Module(parser.parse(*io, "<builtin>", BUILTIN_SOURCE));
builtins_module = module;
}