Files
projectm/src/libprojectM/PresetFactory.cpp
deltaoscarmike 28f34f53d3 WIP: now some presets shaders are compiled
- HLSL: Lots of HLSLparser fixes
- HLSL: Add Preprocessor macro support
- HLSL: Add functions: modf, tan
- HLSL: Add while loops support
- Shader static code fixes
- Add define DUMP_SHADERS_ON_ERROR
- ShaderEngine.hpp cleanup
- Restore current preset message
- Remove useless messages
2018-06-22 19:38:54 +02:00

25 lines
810 B
C++

#include "PresetFactory.hpp"
const std::string PresetFactory::IDLE_PRESET_PROTOCOL("idle");
std::string PresetFactory::protocol(const std::string & url, std::string & path) {
#ifdef __APPLE__
// NOTE: Brian changed this from url.find_first_of to url.find, since presumably we want to find the first occurence of
// :// and not the first occurence of any colon or forward slash. At least that fixed a bug in the Mac OS X build.
std::size_t pos = url.find("://");
#else
std::size_t pos = url.find_first_of("://");
#endif
if (pos == std::string::npos)
return std::string();
else {
path = url.substr(pos + 3, url.length());
// std::cout << "[PresetFactory] path is " << path << std::endl;
std::cout << "[PresetFactory] url is " << url << std::endl;
return url.substr(0, pos);
}
}