• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
lonesock

SOIL: new lightweight image loading lib

130 posts in this topic

Quote:
Original post by syndicatedragon
If anyone is interested, I've packaged the SOIL library as a MacOSX framework. Looking forward to an update, especially size reporting!


I would like that. I am still using a beta version of the library, and it has not failed me yet, however I had to make some changes to make it compile on GCC. An OS X framework would be great.
0

Share this post


Link to post
Share on other sites
Here's a link. It's built as a universal binary, and as "private" framework i.e. it's intended to be copied into the app bundle.

I only have 10.5 machines so I don't know if it works with 10.4. It *should*, but I haven't tested it.

http://shodanproductions.com/misc/SOIL/SOIL_framework_20071110.dmg
0

Share this post


Link to post
Share on other sites
Quote:
Original post by syndicatedragon
... size reporting!
What is size reporting? Like size in bytes?

Anyways great library, and quite efficient I may add. =]
0

Share this post


Link to post
Share on other sites
nice library you have, i managed to fix the problem with loading the texture in soil.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by JMNightmare
Quote:
Original post by syndicatedragon
... size reporting!
What is size reporting? Like size in bytes?

Sometimes SOIL resizes the image on load (if the card needs a power-of-2 size, for example). There have been requests for SOIL to report the original size of the texture as it was loaded, before any manipulation (and/or an easy way to just determine what was the size of the texture that was loaded). I've had a pretty busy few months, but I'm getting some free time again, so development of SOIL is back on. Thanks for your patience everybody!
0

Share this post


Link to post
Share on other sites
Quote:
Original post by muster
nice library you have, i managed to fix the problem with loading the texture in soil.

Thanks! Glad you got it working!
0

Share this post


Link to post
Share on other sites
Hey,

Thank you for an awesome library, first of all. Unfortunately for me, it seems that no matter what I tweak, I invariably receive the following errors:

1>libSOIL.a(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer
1>libSOIL.a(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2

I know I am most likely missing a .lib file but after extensive searching online I have found no resolutions to this problem. Any help would be greatly appreciated.

Thank you in advance,
Ezra
0

Share this post


Link to post
Share on other sites
I had the same linking errors trying to use libSOIL.a with VC9. I fixed it by builiding a new SOIL.lib from the included VC9 project. This also increased the size of the library x 4.
0

Share this post


Link to post
Share on other sites
I've modified soil to support saving uncompressed dds images and fixed bugs with it not being able to distinguish with ARGB8888 and ABGR8888 in its saving and loading of uncompressed dds files.

Additionally I have added SOIL_get_imageinfo_fromfile( const char* filename, SOIL_imageinfo* imageInfo ) which is akin to direct3d's D3DXGetImageInfoFromFile. It allows you to extract the size, format, and other properties of a file without actually loading the entire thing. I needed this because fully parsing an image (png's in particular) just to get some dimension info was too slow for my needs.

Due to being busy with work and such, I'm going to give myself a week to clean up my changes and I'll submit them.
0

Share this post


Link to post
Share on other sites
I have the same problem as EzraBC.
Strange, because last time I used it I had no such problem.
Are we doing something wrong?

I can't use the .sln file to build the library myself because my MSVC version is too old (2005).
0

Share this post


Link to post
Share on other sites
Hi, all.

As you know, SOIL uses stb_image internally for most if the loading/saving functionality. In recent times Sean updated his stb_image code to be thread-safe. In doing so he apparently made a bunch of changes that are compiler specific. I didn't notice at the time, and I was only distributing a precompiled lib made with MinGW. It used to work on all compilers, but now that stb_image uses compiler specific functions, SOIL now needs to be compiled on each target compiler.

SOIL ships with a number of project files: Code::Blocks, a makefile for GCC (Linux and Mac and MSYS folks), Visual Studio 6, 2003, 2005, 2008 (in the VC6, 7.1, 8, 9 directories, respectively). So everybody should be able to build it on their dev machine, in theory. Is this a problem? Should I just have N compiled library files ready to go in the zip?

Jonathan
0

Share this post


Link to post
Share on other sites
Quote:
Original post by lonesock
Is this a problem? Should I just have N compiled library files ready to go in the zip?
Can we get a source-only zip as well? I *never* want any form of binary, so it is wasted space.
0

Share this post


Link to post
Share on other sites
Loving it. Thanks!
Thanks for giving us all the different project files to make the compile process ALOT easier. Since I'm a total noob with compiling libraries and I almost 99.9% of the time won't get the libraries to compile for the stupidest reasons but this one I did since I was supplied with everything. Thanks!

So far the librarys been awesome :)
0

Share this post


Link to post
Share on other sites
This library is all kinds of badass. It was a pleasant surprise when I didn't even have to change a few of my functions to transition from my loaders to SOIL. Maybe that's not as unlikely as it seemed to me at the time...at any rate: Thank you very much, lonesock. You rock!
0

Share this post


Link to post
Share on other sites
hi

i ve got problem with soil for a 2d opengl engine

rendering quality is bad especially when i ve got color gradients on my textures.

dont know why, but I m sure that the problem is related to soil options , because when i use my own LoadBitmap code , i dont get this problem

http://www.vm-games.com/imgs/in_jpg.jpg

http://www.vm-games.com/imgs/in_engine.jpg


i cant explain because i m using the same filtering (linear) with both soil code and load bitmap code

any ideas?
0

Share this post


Link to post
Share on other sites
Quote:
Original post by velk
hi

i ve got problem with soil for a 2d opengl engine

rendering quality is bad especially when i ve got color gradients on my textures.

dont know why, but I m sure that the problem is related to soil options , because when i use my own LoadBitmap code , i dont get this problem

http://www.vm-games.com/imgs/in_jpg.jpg

http://www.vm-games.com/imgs/in_engine.jpg


i cant explain because i m using the same filtering (linear) with both soil code and load bitmap code

any ideas?

Any chance you could post the code you're using to load the image via SOIL? Is it possible you have DXT compression enabled? Depending on the resolution of the original image and the options you've supplied to SOIL, SOIL may be upsizing the image to a power of two, which could lead to stair-stepping like that over long gradients.
0

Share this post


Link to post
Share on other sites
Hi,

I'm also having these same linker errors when I try to use SOIL:

1>libSOIL.a(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer
1>libSOIL.a(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2

MatthewBurk says it was fixed by "building a new SOIL.lib". I wonder if you could go into a little more detail? (I'm kinda new to visual).
0

Share this post


Link to post
Share on other sites
Actually, it fine now. Yeah, its the SOIL.lib file in the project that's provided. Include that and it is fixed.
0

Share this post


Link to post
Share on other sites
Hey, so I was wondering if anyone could help with an issue I have compiling a game in cygwin.

Previously I wrote my own image loader for bitmaps, however, bitmaps kinda sucked in terms of size, so I wanted something to load PNGs. I decided to implement SOIL and it's worked perfectly under Mac OS X. However, when I attempt to compile the SOIL lib and then my game, I get the following errors due to undefined references:


$ make
g++ -Wall -o game_name.exe -I/usr/include/opengl -I/usr/include/w32api
-I./Simple\ OpenGL\ Image\ Library/src drawable.cpp texture.cpp player.cpp
character.cpp main.cpp map.cpp collideable.cpp state.cpp -L/usr/lib/w32api
-L./Simple\ OpenGL\ Image\ Library/lib -lglut32 -lglu32 -lopengl32 -lSOIL

./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x253): undefined reference to `_glReadPixels'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x34a): undefined reference to `_glGetString'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x37c): undefined reference to `_glGetString'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x3ba): undefined reference to `_glGetString'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x3ed): undefined reference to `_glGetString'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x40e): undefined reference to `_glGetString'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x45a): more undefined references to `_glGetString' follow
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x4cb): undefined reference to `_glXGetProcAddressARB'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x8af): undefined reference to `_glTexImage2D'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x9cd): undefined reference to `_glTexImage2D'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xa23): undefined reference to `_glDeleteTextures'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xaa3): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xac3): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xaed): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xb0d): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xb2d): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xc2b): undefined reference to `_glGenTextures'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xc65): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xc85): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xd09): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0xfb6): undefined reference to `_glGetIntegerv'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x1305): undefined reference to `_glTexImage2D'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x1465): undefined reference to `_glTexImage2D'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x14ad): undefined reference to `_glTexImage2D'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x14d4): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x14f1): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x151e): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x1531): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x157a): undefined reference to `_glTexParameteri'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x1594): more undefined references to `_glTexParameteri' follow
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x1611): undefined reference to `_glGenTextures'
./Simple OpenGL Image Library/lib/libSOIL.a(SOIL.o):SOIL.c:(.text+0x1748): undefined reference to `_glTexImage2D'
collect2: ld returned 1 exit status
make: *** [flock_you.exe] Error 1





Edit: removed warnings related to my code
0

Share this post


Link to post
Share on other sites
HI,

1) Congratulations on necro'ing a thread from 3 years ago...

2) gcc (including g++) on OS X uses frameworks, which contain headers and object code in one package. I dont know the full details, but there are various things for you to find online. Mostly they recommend g++ <your various files> -framework OpenGL -framework glut or similar.


0

Share this post


Link to post
Share on other sites
I probably should have rewritten the last line as:

However, when I attempt to compile the SOIL lib and then my game in cygwin, I get the following errors due to undefined references:

This is what compiling on Mac OS X looks like:

$ make
g++ -Wall -o game_name -I./Simple\ OpenGL\ Image\ Library/src drawable.cpp
texture.cpp player.cpp character.cpp main.cpp map.cpp collideable.cpp state.cpp
-L./Simple\ OpenGL\ Image\ Library/lib -framework OpenGL -framework GLUT -framework
CoreFoundation -lSOIL
$


It's very beautiful. But when compiling under cygwin as in my previous post, I seem to get a lot of undefined references to OpenGL library functions. My original code also uses some of the same function, but has no issue compiling them. What do I have to do so that it won't complain about the OpenGL code inside of the SOIL library?

I originally tried linking opengl when recompiling the library, but it said I couldn't link in OpenGL when making a static library.
0

Share this post


Link to post
Share on other sites
So I managed to remove a whole bunch of the undefined references by changing the order in which I called the static libraries, e.g.:


$ make
g++ -Wall -o game_name.exe -I/usr/include/opengl -I/usr/include/w32api
-I./Simple\ OpenGL\ Image\ Library/src drawable.cpp texture.cpp player.cpp
character.cpp main.cpp map.cpp collideable.cpp state.cpp -L/usr/lib/w32api
-L./Simple\ OpenGL\ Image\ Library/lib -lSOIL -lglut32 -lglu32 -lopengl32

./Simple OpenGL Image Library/lib/libSOIL.a(stb_image_aug.o):stb_image_aug.c:(.text+0x6c1): undefined reference to `__assert'
./Simple OpenGL Image Library/lib/libSOIL.a(stb_image_aug.o):stb_image_aug.c:(.text+0x939): undefined reference to `__assert'
./Simple OpenGL Image Library/lib/libSOIL.a(stb_image_aug.o):stb_image_aug.c:(.text+0xc7a): undefined reference to `__assert'
./Simple OpenGL Image Library/lib/libSOIL.a(stb_image_aug.o):stb_image_aug.c:(.text+0x2d44): undefined reference to `__assert'
./Simple OpenGL Image Library/lib/libSOIL.a(stb_image_aug.o):stb_image_aug.c:(.text+0x2ee6): undefined reference to `__assert'
./Simple OpenGL Image Library/lib/libSOIL.a(stb_image_aug.o):stb_image_aug.c:(.text+0x2fb5): more undefined references to `__assert' follow



Any ideas as to how to remove these?
0

Share this post


Link to post
Share on other sites
Figured everything out now. In one of the stb files, you have to add a #define NDEBUG before the line #include <assert.h> so that asserts are turned off. So to recap, if you want to use SOIL in a project that's going to be compiled in cygwin, you need to make sure when you compile that the -lSOIL flag comes before the -lopengl32 flag and that you define NDEBUG before assert.h is included. Hope this helps anyone else who decides to use cygwin to compile.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0