SDL_image is an image file loading library. It loads images as SDL surfaces, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV.
Questions tagged [sdl-image]
156 questions
0
votes
1 answer
Problems rendering, single buffering-like effect
Situation: I currently am trying to render a few things (images and some text) using SDL_image and SDL in C++. However I am coming across some problems which look to be like buffering issues however with my attempts to fix this, Ive been stuck for…

Tim Ogunmakin
- 95
- 1
- 2
- 10
0
votes
1 answer
SDL C++ Program crashes consistently after about 12 seconds
I am currently making a simple game with SDL in C++. When I compile and run the game in Ubuntu using the command line, the game runs perfectly without problems. However, when I try to compile the same code with Codeblocks in Windows 7, the program…

Ian Tait
- 607
- 1
- 8
- 16
0
votes
1 answer
How do I set up additional SDL libraries in CodeBlocks?
I want to set up SDL_Image, SDL_Mixer and SDL_TTF, but it doesn't seem to work. I'm following Lazy Foo's SDL tutorial and tried setting it up like he says, but it just doesn't work. I put all the include files into include folder, and all the lib…
user2588543
0
votes
1 answer
Texture not displaying, mesh showing up black
It seems every time I try to get texturing working in my OpenGL apps I miss something obvious, and I end up spending many hours debugging. Well it happened again and even though I've been trying to compare my code with an older working app for quite…

Defcronyke
- 611
- 1
- 7
- 21
0
votes
1 answer
Drawing text with SDL_ttf while using other graphics
I am making this game using SDL and I need to be able to text displayed for variables and information etc. The problem is I can't render any text while SDL_OPENGL is a parameter in
SDL_SetVideoMode().
It works perfectly without but then I cant…

2GG
- 23
- 2
0
votes
1 answer
SDL don't load/show the right image
I'm writing a simple game. I'm stock by a bug that i can't figure out what are the causes.
In the code i write this:
DxFrame[0] = ImageLoader("Rome/Ball_Dx/RomeDx1.png");
DxFrame[1] = ImageLoader("Rome/Ball_Dx/RomeDx2.png");
DxFrame[2] =…

EnryFan
- 422
- 3
- 15
0
votes
2 answers
SDL and Xcode (SDL_image being ignored)
ld: warning: ignoring file /Library/Frameworks/SDL_image.framework/SDL_image, file was
built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0
0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being…

user1837155
- 21
- 2
0
votes
1 answer
C - SDL_image -> Loading image from custom resource file
I'm trying to get an SDL_Surface* from a custom resource file.
This custom resource file, is get with this code;
http://content.gpwiki.org/index.php/C:Custom_Resource_Files
I packed a folder, wich contain a bitmap, a jpeg and a WAV sound.
I have a…

Math
- 666
- 8
- 26
0
votes
1 answer
Load PNG with SDLImage in Vala
RWops enemy_rwops = new RWops.from_file("img/enemy.png", "rb");
enemy = SDLImage.load_png(enemy_rwops);
I have that code to load a .png (enemy is a SDL_Surface). However, I get this error:
/tmp/ccGDtjkw.o: In function `':
main.vala.c:(.text+0x59):…

David Gomes
- 5,644
- 16
- 60
- 103
-1
votes
1 answer
Getting a segfault trying to check the format of image loaded with SDL
I'm trying to load an image with SDL2, I've initialized SDL_Image with IMG_INIT_PNG|IMG_INIT_JPG, and I'm trying to open this PNG as so:
typedef std::unique_ptr SDL_Surfacep;
SDL_Surfacep LoadImageFromFile(std::string_view…

Patrick Jeeves
- 371
- 2
- 16
-1
votes
1 answer
How to load multiple images in SDL_image and SDL2?
I've been trying to load 2 images in a SDL window, like a player and an enemy, but SDL2_image loads only one image at a time
here's my code :
#include
#define SDL_MAIN_HANDLED
#include
#include
using namespace…

Shloak
- 15
- 4
-1
votes
1 answer
Problem with SDL2_image.dll and libpng16-16.dll
Problem with SDL2_image.dll and libpng16-16.dll
When calling IMG_Init(IMG_INIT_PNG); I get a "failed" return.
IMG_GetError() returns "Failed loading libpng16-16.dll"
When checking output in debug mode both dlls are loaded and immediately…

enocknitti
- 31
- 8
-1
votes
2 answers
What does this cycle do?What is the point?
int myDrawOrder = sprite->GetDrawOrder();
auto iter = mSprites.begin();
for(;iter != mSprites.end(); ++iter)
{
if(myDrawOrder < (*iter)->GetDrawOrder()) //what does this line mean?
{
break;
}
}
GetDrawOrder() returns the…

Roman Barel
- 1
- 2
-1
votes
1 answer
When using %s to set text in my path it will not find it
I am currently trying to read from multiple directories, but when I set the path using a %s (has a saved array of all the file locations) it will not read.
SDL_Surface* image = SDL_LoadBMP("D:\\UltimateModManager\\mods\\%s\\.umm\\icon.bmp",…
-1
votes
2 answers
Segfault when saving PNG with SDL_image
I have to create an OCR in C using SDL2 and SLD2_image.
Everything works fine on macOS. However, when running my program on Linux I get a segfault when saving the PNG file.
I tried to update the libraries I use (SDL2, SDL2_image and libpng) and was…

Pierre Pelletier
- 3
- 3