Code Monkey home page Code Monkey logo

embed-resource's Issues

Not working when called from a C++ namespace

I've been ripping my hair out trying to figure this one out, but for some reason this doesn't work when the resources are loaded from within a namespace in C++ (LOAD_RESOURCE calls), resulting in undefined symbols.

From what I can tell, it's trying to load the resources with the current namespace appended (MyNamespace::_resource_MyResources), which naturally fails.
I went a step further and tried to convert the logic/code from C to C++, so each resource would actually already exist in the same namespace, but that resulted in the same undefined symbols.

Just to reiterate: if I use the same exact code in the global/anonymous namespace (eg. without a namespace), everything just works, but when called from within any kind of namespace, it all breaks down and I have no idea.

I'm really, really hoping someone could shed some light on this and hopefully provide a solution/workaround. I'll see about opening a StackOverflow question regarding this as well, as this might just be a quirk with CMake etc.

Load .glsl with extra character at the end of the string?

Hi. Thanks for creating this great tool!

I'm facing some trouble when using it. I loaded two .glsl files but there are always a duplicated } at the end of the loaded data. I tested to delete the one } in my shader file, but the problem persists. I then changed the } in my file to some other characters, there were always a copy of that character.

The output:

#version 330 core

out vec4 fragColor;

void main() {
    fragColor = vec4(0.5, 0.1, 0.8, 1.0);
}}

My loading code:

include_directories(ext/embed-resource)
add_subdirectory(ext/embed-resource)

embed_resources(MyResources resources/shaders/test_vs.glsl resources/shaders/test_fs.glsl)

 add_executable(target src/MyUtils.cpp src/proj1.cpp ${MyResources})

////////////////////////////////////////
        Resource test_vs = LOAD_RESOURCE(test_vs_glsl);
        Resource test_fs = LOAD_RESOURCE(test_fs_glsl);

I don't see any related issue on this, so may be I'm loading the resource incorrectly? Could you check if this is a bug? Thanks!

Migrate to cpp17

Hi
Would using cpp17 std filesystem remove the dep with boost ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.