Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for #include #82

Open
bazilmuzik opened this issue Aug 28, 2023 · 1 comment
Open

Support for #include #82

bazilmuzik opened this issue Aug 28, 2023 · 1 comment

Comments

@bazilmuzik
Copy link

There's this wonderfull glsl library called lygia (https://lygia.xyz/) which comes with a ton of incredible utilities, functions, etc.

However it relies heavily on #include that Ofelia doesn't recognize... Or at least I don't know how it could be...
In the attached folder, there's a small example. If you use the command

glslViewer test.frag

It all works fine. The random.glsl file (coming from lygia) is recognized and applied correctly with

#include "random.glsl" (line 5 in test.frag)

But using test.pd, I get this error message when creating the window:

ofShader: GL_FRAGMENT_SHADER shader reports:
0:5(1): preprocessor error: include "random.glsl" not found

On the lygia page, there are many examples on how to implement #include in different cases/languages, including C# and C++ (see the "Design Principle" section). That makes me think, without being a developper, that it should be possible to make it work for Ofelia...

What do you think ?

Thanks in advance

test.zip

@Jonathhhan
Copy link
Collaborator

@bazilmuzik I guess you need to include all the bindings with swig before compiling the external. Here is my attempt: #91

#include inside the PD patch is not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants