I like computer graphics and digital image processing, and therefore made a painting program in my spare time. This program works on RGBA by default for almost every filter. So possibly it will rescale correctly for you. Does it do what you want? http://sourceforge.n...ects/lodepaint/
If it doesn't work, then pick foreground color R=0, B=0, G=0, A=0 (so black and fully transparent, where black is the same color as the outlines of the image), and floodfill that on the transparent areas. Then try the resizing again.
First of all, I think it is easier with the following code by using LodePNG_decode32_file which does everything (loading file, decoding, using RGBA format) at once. Also note the "free" at the end, otherwise you'll have a memory leak, the complete memory of the texture will remain in RAM for nothing. OpenGL makes a copy of this data, the original one can be freed.
If you're working in C++, you can also use the C++ version of LodePNG.
If you include all source files, normally it should be able to link. What happens if you use the code above? Probably the sample was for an older version of LodePNG. Does your project already exist out of multiple source files, is using functions from other source files possible, and are there differences in settings related to this file in your IDE? Does your IDE support mixing C and C++ code? Try renaming lodepng.c into lodepng.cpp?
I am working on a 3D game, I'd like to overlay the 3D scene with some GUI elements with transparency... The engine I am working with has got loaders for TGA and BMP files, my first guess was to try incorporate PNG in it. I am trying to use lodePNG, which any recommend. I included lodepng.h to the header files and lodepng.c to the source files. I included the header in my class and created this function from a sample I saw:
Here's what I find important in TD games, I can express it much better in words here than in the poll.
1) I don't want multiplayer at all. I want single player in Flash, (both multiplayer and installing are too much of a hassle, and I use Linux)
2) There must be a campaign with upgrades between missions! There must be upgrades and the ability to replay earlier levels with the upgrades. There must be hard to earn skill points to do these upgrades, and there must be enough of them and hard enough to earn them (but not discouragingly hard) to keep you busy for hours or even days. GemCraft's upgrade system was fantastic!
3) Building mazes is nice but there are very fine games without maze building too, such as GemCraft.
4) There must be a mode where there keep coming progressively harder waves forever. I hate it when after 50 waves the game suddenly stops while you could have kept going due to your nice buildup.
5) It's very important that there are different towers for different strategies, and types of towers that are good against types of enemies. The splash damage vs single hit damage and air vs ground in Desktop TD was a good example, and the colors in GemCraft are another good example. And things that slow down, boost, etc..., obviously are very interesting.
Best TD game I've ever played is GemCraft 0 and GemCraft 1. Second best are the ones with the balloons and monkeys from Ninja Kiwi. Third best is Desktop Tower Defense. The one that gave me the most hours of fun was definately the GemCrafts.
By the way, if you want to make a multiplayer TD game, like it seems from the poll options, by no means I want to stop you from doing that, go ahead!
Um what a bad start, imho. Only the first line of code and already it's prevented from compiling on my Linux box!
EDIT: Oh, posts above this already talked about that, sorry for the duplication. However my point still stands. You should have titled the thread "let's make a MFC program" or so if this was the direction you were going.