sdl-image

How to statically compile an SDL game on Windows

I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwin/mingw/gcc. As far as I can tell all existing public versions...

Using .reset() to free a boost::shared_ptr with sole ownership

I'm storing an object (TTF_Font) in a shared_ptr that is provided to me from a third-party API. I cannot use new or delete on the object, so the shared_ptr is also provided a "freeing" functor. // Functor struct CloseFont { void operator()(TTF_Font* font) const { if(font != NULL) { TTF_CloseFont(font); ...

Is there a better way to load in a big animation?

Maybe not really big, but a hundred frames or something. Is the only way to load it in by making an array and loading each image individually? load_image() is a function I made which loads the images and converts their BPP. expl[0] = load_image( "explode1.gif" ); expl[1] = load_image( "explode2.gif" ); expl[2] = load_image( "explode3.g...

SDL_image/C++ OpenGL Program: IMG_Load() produces fuzzy images

I'm trying to load an image file and use it as a texture for a cube. I'm using SDL_image to do that. I used this image because I've found it in various file formats (tga, tif, jpg, png, bmp) The code : SDL_Surface * texture; //load an image to an SDL surface (i.e. a buffer) texture = IMG_Load("/Users/Foo/Code/xcode/test/lena.bmp")...

C++: Cannot instantiate a pointer directly

This is an SDL problem, however I have the strong feeling that the problem I came across is not related to SDL, but more to C++ / pointers in general. To make a long story short, this code doesn't work (edited to show what I really did): player->picture = IMG_Load("player"); SDL_BlitSurface(player->picture, NULL, screen, &pictureLocati...

Problem linking SDL_Image against libpng

I'm trying to compile SDL_Image 1.2.10 with MinGW + MSys (gcc 4.5.0) on Windows, I have compiled all the requires libs (zlib 1.2.5, libpng 1.4.2, libjpeg 8a, libtiff 3.9.2). SDL_Image compiles fine, but fails to link to libpng, throwing .libs/IMG_png.o:IMG_png.c:(.text+0x16): undefined reference errors on various png structs. If I run ....

SDL_image's IMG_Load do not work

I am using IMG_Load() to load png file, but it simply not working. loadedImage = IMG_Load(filename.c_str()); after this sentence, loadedImage is still NULL,not error happened. PS:I am using VS C++2008, png file is in the develop folder. Here is my code:(It is exactly what Lazy Foo like) //The headers include "SDL.h" include "SDL_image...

SDL/MSVC++ Linker Problem

I get this error: ...\visual studio 2010\Projects\SDLT\Debug\SDLT.exe not found or not built by the last incremental link; performing full link I have include, library, and additional file dependencies setup but I keep getting the link error. For include: C:\SDL-1.2.14\include;C:\SDL-1.2.14\SDL_image-1.2.10\include; For libraries: C:...