Questions tagged [stb-image]

Single-file public domain (or MIT licensed) library for image loading/decoding from file/memory. Implemented for C/C++ by Sean Barrett.

Single-file public domain (or MIT licensed) library for image loading/decoding from file/memory. Implemented for C/C++ by Sean Barrett.

Resources:

101 questions
0
votes
1 answer

freeimage write to pixels

I am trying to write some vertices in a file using freeimage (but I am open to solutions with stb_image also). I am trying to use the code from the Computer Graphics : Principles and Practice 3rd ed, chapter 3 , listing 3.6. I am not sure how to…
George
  • 5,808
  • 15
  • 83
  • 160
0
votes
1 answer

Rendering white box textures in STB/Opengl

Program compiles fine. Quads print. Trying to insert a 32 bit png, but it only prints a white box. What am I doing wrong? I've spent a few days trying to figure it out doing countless tutorials. I don't want to give up. GLfloat…
0
votes
1 answer

Textures not drawing OpenGL

I am having some strange behavior when trying to draw a texture in OpenGL. Currently all this program does for me is draw the background color with no indication of a texture being drawn. I have just moved from Visual Studio (where this code…
SafelyFast
  • 75
  • 1
  • 1
  • 10
-1
votes
0 answers

Some problems with stbi_load

when I start learning texture, I found that the img won't load when I use relative_path,but ABS_path would work. but the codes on docs use relative_path I open the file with ifstream,and relative_path still didn't work(debug onVscode)
-1
votes
1 answer

Is there a way to access and change the saturation values of a grayscale bitmap in c?

I haven't programmed in c for about 9 years, and I've never been that good (with any language) either. Now, I'm trying to brute-force my way back in, converting some Matlab code into c, and some stuff is still very rusty. I'm trying to read an…
-1
votes
1 answer

Assimp load fbx texture failed, POSSIBLE ISSUE: unit 0 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float)

I am using this code to load FBX (note: specific for FBX), the textures unable to load successfully for (unsigned int i = 0; i < mat->GetTextureCount(type); i++) { aiString str; mat->GetTexture(type, i, &str); if (auto…
Nicholas Jela
  • 2,540
  • 7
  • 24
  • 40
-1
votes
1 answer

Png image is not loading corretly. Using stbi_load() opengl

So I have this problem: I am loading image with stbi_load() and then creating texture with glTexImage2D(). When I load .jpg image, then everything works normaly, but when I load .png, then the drawn image is black, where it should be transparent.…
-1
votes
1 answer

stbi_load Method isn't accepting my parameters

bi = ImageIO.read(new File(filename)); width = bi.getWidth(); height = bi.getHeight(); ByteBuffer data = stbi_load("/sprites/" + filename, width, height, 0, 0); For some reason, stbi_load isn't accepting the second, third, and fourth…
ralph367
  • 3
  • 4
-1
votes
2 answers

Producing a JPG via Ray Tracing(Ray Tracing in one Weekend)

I'm following the book Ray Tracing in on Weekend in which the author produces a small Ray Tracer using plain C++ and the result is a PPM image. The author's code Which produces this PPM image. So the author suggests as an exercise to make it so…
RandomOne
  • 3
  • 3
-2
votes
1 answer

Why is it when I open my game with MSI afterburner overlay toggled on none of my textures work how they are supposed to

Whenever I open my game with the MSI afterburner overlay toggled on the textures seem to be shifted by one so the first one gets set to the second one, the second to the third and so on. But if I don`t use the overlay while loading everything is…
-3
votes
1 answer

I get a random color when I am trying to load a texture in opengl

I get a seemingly random color when I try to load a 16x16 png as Texture instad of the texture. The Colors are alomst always something like light blue, dark blue, red, pink. Here is the texture if it helps DirtTexture here is the code of the…
ThatGuy
  • 1
  • 2
1 2 3 4 5 6
7