Comments (5)
Are you looking at the documentation?
This function
Line 97 in f100755
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.
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.
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.
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.
@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)
- [example] `models_point_rendering.c` example fails to build with Clang 18.1.3 on Ubuntu HOT 1
- [rcore] Gamepad detected, input not detected (linux) HOT 6
- [rcore] No suitable DRM connector found on Raspberry Pi with composite output HOT 2
- [raylib] Invalid parser behaviour on long function description HOT 1
- [build] Add an option to `build.zig` to support different `rcore` platforms HOT 2
- Debugger isn't working (mac, nvim) HOT 1
- [base] Add support for Meson Build System. HOT 6
- [raylib_parser] Segmentation fault HOT 1
- raylib Security Policy missing HOT 18
- [rcore] Incorrect line height when drawing text with line breaks HOT 1
- [rtexture] Drawing texture with negative width or height draws nothing HOT 1
- [rcore] Implement GetApplicationDirectory for FreeBSD
- [module] InitWindow( 0, 0, "Test"); crash on Samsung S24 dark mode (OK on Tablet S9+) HOT 14
- [rmodels] .mtl texture file does not automatically apply to .obj model file when displayed. HOT 5
- [rcore] Parser - invalid raylib_api.json HOT 11
- [rmodels] .obj file wont render in properly with the corresponding .mtl file. HOT 5
- [rmodels] GLB Animation plays incorrectly. HOT 5
- [rmodels] OBJ model texture not loaded HOT 3
- [rlgl] rlScalef with negative parameter disappears everything except lines HOT 2
- [rlgl] `glVertexAttribPointer()` error client-side with WebGL 2.0 (OpenGL ES 3.0) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib.