Code Monkey home page Code Monkey logo

Comments (9)

ptitSeb avatar ptitSeb commented on July 17, 2024

I don't think renaming anything is the solution here. I think I build some stuff with RayLib before with gl4es (ManiaDrive use RayLib IIRC) on the Pandora and it worked fine.

from gl4es.

afxgroup avatar afxgroup commented on July 17, 2024

That's strange. There are rlColor4f, rlNormal3f and rlEnd that are in both libraries.

from gl4es.

ptitSeb avatar ptitSeb commented on July 17, 2024

Ah ok, I see. You can try renaming those one if you want then. Are you building a static version of gl4es?

from gl4es.

afxgroup avatar afxgroup commented on July 17, 2024

Yes. It is the static version of gl4es. What about something like rl -> gl4es

from gl4es.

ptitSeb avatar ptitSeb commented on July 17, 2024

there are already many gl4es_ functions,, so you might create more name colision. Try rl4es_ instead ;)

from gl4es.

afxgroup avatar afxgroup commented on July 17, 2024

Another question regard Raylib5. When I try the shaders examples (version 100). I get the following error:

Compile error: ERROR: 57:1: 'gl4es_transpose' : function already has a body

What does it means? That it is included in both vertex and fragment shader?

from gl4es.

ptitSeb avatar ptitSeb commented on July 17, 2024

That's a bug in the shader transformation (from opengl to gles2). I need to have a look at that (but not sure when I'll do that).

from gl4es.

afxgroup avatar afxgroup commented on July 17, 2024

Well, Raylib is your friend and it is really easy to compile and test.
However this happens when there is already a transpose function (f.e. https://github.com/raysan5/raylib/blob/master/examples/shaders/resources/shaders/glsl100/lighting.vs)
So this code:

    if(strstr(Tmp, "transpose(") || strstr(Tmp, "transpose ") || strstr(Tmp, "transpose\t")) {
      Tmp = gl4es_inplace_insert(gl4es_getline(Tmp, headline), gl4es_transpose, Tmp, &tmpsize);
      gl4es_inplace_replace(Tmp, &tmpsize, "transpose", "gl4es_transpose");
      // don't increment headline count, as all variying and attributes should be created before
    }

Will insert the gl4es_transpose functions on top and rename the existent one

from gl4es.

afxgroup avatar afxgroup commented on July 17, 2024

A possible workaround could be something like this:
Change gl4es_transpose to:

static const char* gl4es_transpose2 =
"mat2 gl4es_transpose(mat2 m) {\n"
" return mat2(m[0][0], m[1][0],\n"
"             m[0][1], m[1][1]);\n"
"}\n";

static const char* gl4es_transpose3 =
"mat3 gl4es_transpose(mat3 m) {\n"
" return mat3(m[0][0], m[1][0], m[2][0],\n"
"             m[0][1], m[1][1], m[2][1],\n"
"             m[0][2], m[1][2], m[2][2]);\n"
"}\n";

static const char* gl4es_transpose4 =
"mat4 gl4es_transpose(mat4 m) {\n"
" return mat4(m[0][0], m[1][0], m[2][0], m[3][0],\n"
"             m[0][1], m[1][1], m[2][1], m[3][1],\n"
"             m[0][2], m[1][2], m[2][2], m[3][2],\n"
"             m[0][3], m[1][3], m[2][3], m[3][3]);\n"
"}\n";

And the replace function with:

    if(strstr(Tmp, "transpose(") || strstr(Tmp, "transpose ") || strstr(Tmp, "transpose\t")) {
      if (gl4es_find_string(Tmp, "mat2 transpose") == NULL)
        Tmp = gl4es_inplace_insert(gl4es_getline(Tmp, headline), gl4es_transpose2, Tmp, &tmpsize);
      if (gl4es_find_string(Tmp, "mat3 transpose") == NULL)
        Tmp = gl4es_inplace_insert(gl4es_getline(Tmp, headline), gl4es_transpose3, Tmp, &tmpsize);
      if (gl4es_find_string(Tmp, "mat4 transpose") == NULL)
        Tmp = gl4es_inplace_insert(gl4es_getline(Tmp, headline), gl4es_transpose4, Tmp, &tmpsize);
      gl4es_inplace_replace(Tmp, &tmpsize, "transpose", "gl4es_transpose");
      // don't increment headline count, as all variying and attributes should be created before
    }

However this will work only if the functions are defined like mat2 transpose( (and so on) otherwise ith will not work.
A possible other solution could be:
Create a Tmp1 string and replace all \n, \t and spaces. Check for mat2transpose( and do the previous replace code

from gl4es.

Related Issues (20)

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.