top of page
Search
kelsimogpom

lsdl image download: A comprehensive guide for beginners and experts



You only installed SDL library. SDL_image and SDL_ttf are different libraries. You can download them via sudo apt-get install libsdl-image1.2-dev libsdl-ttf2.0-dev. There is also another popular SDL extension SDL_mixer: libsdl-mixer1.2-dev


Full text is available as a scanned copy of the original print version. Get a printable copy (PDF file) of the complete article (995K), or click on a page image below to browse page by page. Links to PubMed are also available for Selected References.




lsdl image download



After installing the SDL library itself on your system you'll need Pascal headers to be able to use SDL with FPC. Since version 2.2.2, most SDL units are included with FPC itself. You can of course also download them from JEDI-SDL in case you need some bug fix or a unit not in the version shipped with FPC.


This the version that you get when you download the macOS version of SDL from libsdl.org. In this case, the startup code is only available in source form. It is located on the installation disk image, in the folder devel-lite. After copying the SDL.framework from the disk image to /Library/Frameworks and copying the devel-lite folder anywhere on your hard drive (e.g., in your home directory), you can compile it into libSDLMain.a by opening a Terminal session, navigating to the copied devel-lite folder, and executing the following commands:


First download Compiler (toolchain.7z): -fu/miyoo/releases/download/v1.0/toolchain.7zExtract the "miyoo" directory somewhere, I'll use "/opt", so "/opt/miyoo".Next, download the hello world app, I'll use the simple calculator app from -calcExtract it somewhere, ie "/opt/calc" and open a command shell.


Now, assuming you intend to compile SDL apps using the free MinGW compiler (MinGW?), get the latest version of the SDL from the download section on the SDL website. Get the Development Runtime for Win32, the MinGW version. SDL users tend to favour MSVC when on Windows, so some of the MinGW-specific information is a bit sparse. As-is, the development runtime package needs to be configured and installed before you can compile with it. This requires the help of a more unix-like command line shell, either Cygwin (configured to use MinGW) or MSYS from mingw.org (as described in the first section).


SDL_image is an invaluable add-on library that allows you to use a wide variety of image formats with SDL, including BMP, JPG, GIF, PNG, TGA, PCX and many more (as opposed to just BMPs with SDL alone).


If you want to get up and running quickly without re-compiling from source, simply grab the runtime development package. This time however, you can use the MSVC package. You can link directly to the SDL_image.lib file as it only requires plain vanilla C linkage (no C++ or other MinGW-specific WinMain). Just extract the archive to a location and remember to set the include and lib paths when you compile.


The documentation site for SDL_image is clear and straightforward. It also has an excellent example source to try which serves as a great little intro to both SDL and SDL_Image at the same time. Assuming your SDL/ and SDL_image/ directories are at the same level, create another folder at that same level, called viewimage. Grab the viewimage.c source from the demos directory, as well as a few image files to test. Put the files you download in the viewimage folder. Then you can use this makefile to build the test app:


MinIDE users will just build an SDL project as usual, but add the SDL_image.lib file to the project by dragging that file's icon into the target window, and adding ../SDL_image/include to the include path.


Finally, copy all the .dll files (zlib.dll, jpeg.dll, libpng1.dll, SDL_image.dll and SDL.dll) to the viewimage directory so the app can find them when you run it. The app is a command-line app, so pull up a command prompt and cd to that directory. Test it by running it with the name of one of the demo images:


The following is a minimalistic SConstruct file that is read and parsed by SCons to build your game or application. The following example uses SDL, SDL_mixer and SDL_image for libraries, but you can add more in a similar fashion.


In the example we have a program that uses 3 libraries: SDL, SDL_mixer and SDL_image. You might be wondering why we run sdl-config to add the SDL library, but later add the SDL_mixer and SDL_image libraries to the LIBS variable. The reason is that sdl-config provides all of the compiler and link flags required by SDL, including the linker flag to include SDL as a library, but that's it. SDL_image and SDL_mixer are add-on libraries to SDL, which means they require all the same compiler and link flags as SDL, but you must also explicitly state that you are using these libraries in addition to the main SDL library. 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


bottom of page