Questions tagged [sdl-image]

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.

156 questions
0
votes
1 answer

Weird SDL_Surface->format->BytesPerPixel value

So I'm using SDL_image to load heightmap and create terrain in my OpenGL app. That's how I initialize SDL_image: int flags = IMG_INIT_PNG; int initted = IMG_Init(flags); if((initted & flags) != flags) { printf("IMG_Init: Failed to init required…
Octothorp
  • 135
  • 1
  • 13
0
votes
1 answer

SDL Error: Invalid Renderer on SDL_CreateTextureFromSurface

Alrighty, from what I have researched, it appears that the Invalid Renderer error applies to a variety of cases and I'm lost onto why my code is creating it. I have narrowed it down to a specific area of code //If existing texture is there, free's…
Failbound
  • 31
  • 5
0
votes
0 answers

SDL apps doesn't run on other computers

I figured out the problem, I basically just put all the .dll files into my System32 so the application would look for .dlls in there. Then I gave the exe to a friend with missing .dlls. Sorry for this awful question I've compiled several SDL…
0
votes
1 answer

my IMG_Load method doesn't work with LNK2019 error

I'm trying to make a game on visual studio 2013 with SDL. when I'm typed : SDL_Surface* pTempSurface = IMG_Load("assets/na.png");

error occurred like : Error 2 error LNK2019: unresolved external symbol _IMG_Load referenced in…
kyu
  • 11
  • 2
0
votes
0 answers

Eclipse SDL_Image not showing window

On Eclipse CDT Helios + Mingw64 + SDL2 + SDL_Image: IMG_Init make the window not showing anymore. This problem occurs only on Eclipse. Hand compile(using same configurations) on console and running it works fine. This is my code: #include…
Patric
  • 763
  • 1
  • 8
  • 17
0
votes
1 answer

SDL Window shows final frame from the last time the program was run in the background of a new window when I start up a new instance

I'm making a simple game and just messing around with SDL. I have two images currently, and I am practicing making them the background. I make one the background by calling RenderCopy, the DestroyTexture to clear it from memory, and then I present…
tobydog
  • 23
  • 1
  • 7
0
votes
1 answer

SDL image library linker

I've read many posts on SDL_Image library, but I still cannot solve my problem. I have #include "SDL/SDL_image.h" at the top, but when I go to compile it says "cannot find -lSDL_image". I have the SDL2_image.dll with the main, double checked…
Joshua
  • 1
  • 2
0
votes
0 answers

Reading pixel values of a 16x16 image with SDL

I use SDL_image to load an image to a SDL_Surface. How can I get all this data into a vector pixels? I have tried: Uint32 GetPixel(SDL_Surface *img, int x, int y) { SDL_LockSurface(img); //Convert the pixels to 32 bit Uint32 *pixels = (Uint32…
Ledii
  • 261
  • 1
  • 3
  • 13
0
votes
1 answer

SDL: How to blit a surface onto one created with SDL_CreateRGBSurface correctly?

I'm trying to blit a surface created by IMG_Load (SDL_image) onto one created via SDL_CreateRGBSurface. When both surfaces are loaded with IMG_Load, this works fine, but not when the target surface was created using SDL_CreateRGBSurface. By…
futlib
  • 8,258
  • 13
  • 40
  • 55
0
votes
0 answers

SDL_Image return NULL when trying to load texture

I have model loaded to my screen, but having trouble getting it's texture read. Whenever I try to load the model's texture, it returns NULL. The model and texture resides within the same directory, I can't figure out why the program is having…
user868935
0
votes
1 answer

IMG_Load troubles (unsupported image format)

OS Ubuntu; IDE Codeblocks i wrote my own texture manager class with 'load' function bool TextureManager::load(std::string fileName, std::string id, SDL_Renderer* pRenderer) { SDL_Surface* pTempSurface = IMG_Load(fileName.c_str()); …
ExiD
  • 87
  • 2
  • 12
0
votes
1 answer

ld: framework not found SDL2_image

I want to use SDL2_image frameworks (an extension of SDL2 framework), i've downloaded and copied the SDL2_image frameworks in the folders below: /Library/Frameworks/ /System/Library/Frameworks /Users/ < user > /Library/Frameworks my code works…
BulBul
  • 1,159
  • 3
  • 24
  • 37
0
votes
1 answer

Xcode Included Files Path Confusion

I'm writing a little C++ program in Xcode 5 for fun, but it's my first time using Xcode and I'm confused as to how Xcode handles paths when opening files that are included in the project. I'm using the SDL2_image framework and when I want to load an…
Mason
  • 33
  • 1
  • 5
0
votes
2 answers

SDL_Image not displaying an image

After fixing various other SDL errors, (both with SDL itself and SDL_Image) I have written this error-free code: #include #include #include #include using namespace std; #define null 0 SDL_Window *window…
user2752347
  • 161
  • 6
  • 16
0
votes
1 answer

SDL2 program SIGSEGV on start

I wrote Snake in SDL and now want to port it to Android, which means I had to rewrite parts of it to use SDL2. I replaced the key control and rendering parts and it compiles without any errors. However, when I try to run it it crashes immediately. I…
frankm1
  • 61
  • 7