Closed eduardfrigola closed 8 months ago
Thanks for your work here. I will examine each of those things individually.
ofxNDIdynloader.cpp Line 71. There is indeed a mistake here. m_hNDILib is not defined for OSX in ofxNDIdynloader.h. There has been a "to be checked" comment for some time and you have done so. The other changes support it.
The full path is reconstructed in ReadYUVpixels because with a change to Openframeworks 12, the shader load failed. It requires full paths rather than relative to the data folder. Any change here and the shader load would fail again.
Edit - I will use an Openframeworks function to get the full path instead of GetCurrentModule.
In SetFormat, doesFileExist was used back in 2022 but _access was used given the full path with the change. "ofFile::doesFileExist(shaderpath, false)" is probably better to test for GL2, GL3 etc. I can manage these changes.
Thanks, I have not been working with ofFile lately so was not aware with those issues. Seeing all this issues for checking files, do you think it will be beneficial to embed the shaders in the source code? Or it is needed that the user can modify those?
I looked at doing that to remove dependency on the shader files, but as far as I can see, ofShader::load requires a file path. There is a lower level "setupShaderFromSource" but I could not work out how to use it without some complexity.
I have succesfully implemented that in the past. I can give you a hand with that.
Relevant parts of the implementation: Define string converter link:
#define STRINGIFY(A) #A
Include the shaders and setup from source link:
string defaultVertSource =
#include "defaultVertexShader.h"
;
string drawFragSource =
#include "GradientShader.h"
;
shader.setupShaderFromSource(GL_VERTEX_SHADER, defaultVertSource);
shader.setupShaderFromSource(GL_FRAGMENT_SHADER, drawFragSource);
shader.bindDefaults();
shader.linkProgram();
This are the shaders in separate files: https://github.com/PlaymodesStudio/ofxOceanodeTextures/blob/addon/src/shaders/GradientShader.h https://github.com/PlaymodesStudio/ofxOceanodeTextures/blob/addon/src/shaders/defaultVertexShader.h
R"(
#version 410
uniform mat4 modelViewProjectionMatrix;
layout(location = 0) in vec4 position;
void main(){
gl_Position = modelViewProjectionMatrix * position;
}
)"
Thanks very much for that. I will look into it carefully.
The latest files are now in the repository. I hope it works for OSX.
I made conditionals to use the openframeworks file functions for macos and linux, and leave the windows untouched. Can you test this on windows? On macOS compiles fine.