Git Product home page Git Product logo

Comments (5)

colesnicov avatar colesnicov commented on September 26, 2024

Are you looking at the documentation?

This function

void SetShapesTexture(Texture2D texture, Rectangle source)

In the case of an invalid texture, the function will load the default. In the case of an invalid texture, the function will load the default. RayLib does not return error codes, does not use enums. It has its default behavior defined, how it behaves in the event of a failure. In this function, it loads a default, mostly empty texture.

That's a constructor:

(Texture2D){ 1, 1, 1, 1, 7 }

create a new texture with #ID 1, width 1, height 1, mipmap 1 and format 7.

from raylib.

MicroRJ avatar MicroRJ commented on September 26, 2024

Thanks @colesnicov , so what I get from this is that the "default" texture does not refer to RLGL.State.defaultTextureId which is the actual default texture.

from raylib.

colesnicov avatar colesnicov commented on September 26, 2024

Thanks @colesnicov , so what I get from this is that the "default" texture does not refer to RLGL.State.defaultTextureId which is the actual default texture.

I don't see it now, really. I've been here for a few days. And I haven't looked into the source yet...

But I think RLGL.State.defaultTextureId is the texture ID which can be '1' which is the texture ID in this function:

That's a constructor:

(Texture2D){ 1, 1, 1, 1, 7 }

create a new texture with #ID 1, width 1, height 1, mipmap 1 and format 7.

This means that it can easily be the default texture.

It depends on the implementation. If the indexing starts with 0 or if it starts with 1 and 0 it means an error..

Someone more knowledgeable has to answer.

from raylib.

colesnicov avatar colesnicov commented on September 26, 2024

As you can see here : #3962

UNSUPPORTED (log once): POSSIBLE ISSUE: unit 0 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable.

Cite: using zero texture because texture unloadable..

It seems that the texture with ID 0 is the default texture that is uploaded in case of failure? But in the function you pointed to, the ID of the texture is set, in case it is faulty, to 1. Which probably won't be the default texture. **Could it be a mistake? **

Hopefully @rayson5 will be surprised.

from raylib.

raysan5 avatar raysan5 commented on September 26, 2024

@MicroRJ @colesnicov Texture ID 1 is a default internal raylib texture, a 1x1 pixel white texture (RLGL.State.defaultTextureId). OpenGL does not support 0 as a valid texture Id.

Is this code meant to reset the texture to the default texture loaded by?

@MicroRJ Yes, it does.

from raylib.

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.