Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?  (Read 9133 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #15 on: June 06, 2012, 05:51:22 pm »
A 50 MB archive? That doesn't look very minimal, sorry.

Here is what I mean:
http://en.sfml-dev.org/forums/index.php?topic=5559.msg36368#msg36368
Laurent Gomila - SFML developer

Haikarainen

  • Guest
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #16 on: June 06, 2012, 06:05:00 pm »
A 50 MB archive? That doesn't look very minimal, sorry.

Here is what I mean:
http://en.sfml-dev.org/forums/index.php?topic=5559.msg36368#msg36368

It is minimal, i just packed the  3 textures as well. It is 1 main.cpp file that just loads the textures, opens a window and quits.

EDIT: Only code here: https://legacy.sfmluploads.org/code/123
« Last Edit: June 06, 2012, 06:09:24 pm by Haikarainen »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #17 on: June 06, 2012, 06:25:34 pm »
Ah, then a simple
image.create(width, height);
has the same effect, and doesn't require an additional file.
« Last Edit: June 06, 2012, 06:30:39 pm by Laurent »
Laurent Gomila - SFML developer

Haikarainen

  • Guest
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #18 on: June 06, 2012, 06:37:37 pm »
Ah, then a simple
image.create(width, height);
has the same effect, and doesn't require an additional file.

That is weird, changed it to creating a texture of the same size and that seem to work. Also when I experimented yesterday and loaded like 15 different textures (most small) I got a sfml error that said something like "could not load image: out of memory". Is there any destructor or delete I am missing? Might it be that libpng or the implementation of it handles large files badly, maybe creating a faulty pixelsptr?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #19 on: June 06, 2012, 06:48:16 pm »
Hmm interesting. I have no idea what happens inside stb_image (the lib I use to load images). If you have some time and motivation, you can try debugging inside SFML/stb_image code.
Laurent Gomila - SFML developer

Haikarainen

  • Guest
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #20 on: June 06, 2012, 07:03:21 pm »
Hmm interesting. I have no idea what happens inside stb_image (the lib I use to load images). If you have some time and motivation, you can try debugging inside SFML/stb_image code.

I just did, apparently stb takes a shortcut when dealing with pngs, and does not split the png streams as its supposed to, making  large pictures unreliable (not as complicated for programmer, speed might also increate, but memory allocation is way larger when loading the image).

I changed the files to jpegs and now it loads perfectly!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: OpenGL Problems: GL_OUT_OF_MEMORY, ensureGlContext?
« Reply #21 on: June 06, 2012, 08:12:17 pm »
Nice. Thank you for your investigation :)
Laurent Gomila - SFML developer

 

anything