Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Omerta7486

  • Rank

Personal Information

  • Role
    Amateur / Hobbyist
    Creative Director
    Game Designer
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Lol. Well, I meant impact performance of the computer, but, yes, music at first can be a distraction to beginners. And, even though I have been programming for nearly 16 years, I still try to avoid music with words, or any music I am not well acquainted to! Heh.
  2. Omerta7486

    C++ compiled EXE not running

    [UPDATE] I have output the contents of SDL_Log to the console at the end of my application as has been suggested. Hopefully this will cut down on my questions for basic library stuff. Thank you all for your patience and kindness everyone.
  3. Omerta7486

    C++ compiled EXE not running

    Thank you, fastcall, but I switched over to stb_image and it worked perfectly. See my previous post on page 1. Thank you, again.
  4. Omerta7486

    C++ compiled EXE not running

    @fastcall22 I meant that it couldn't initialize PNG formats, not that it could error log. Exiting main from that point tells me that it didn't initialize. I don't understand why when run in CodeBlocks it can decode PNGs, but when run as an exe it can't. I don't have libpng.dll, so if SDL Image needs it, shouldn't it not work even when run in CodeBlocks under "release?" [Update] Aha! I switched over to stb_image, grabbed the raw RGBA stream, stuffed it into an SDL surface, and blah, blah, blah. Here it is running from exe. Thank you everyone for your help! Cheers! -Omerta
  5. Omerta7486

    C++ compiled EXE not running

    Thank you all for the replies. After further testing, I found that the exe doesn't immediately close(it also does nothing but show a blank renderer) if I comment out this: if(!IMG_Init(IMG_INIT_PNG)) { SDL_Log("Unable to initialize loader: %s", IMG_GetError()); return EXIT_FAILURE; } It seems to be unable to do this one action, but without SDL Image initializing PNGs it doesn't draw anything. This was what SDL Image's website said about this: It sounds like I do in fact have to have libpng to use SDL_Image. @fleabay You said in my other thread that you use SDL Image, correct? Are you on Linux or Unix, or do you have libpng or zlib by any chance? @Randy Gaul had suggested using stb_image instead, I may end up looking at that one. It creates raw RGBA streams from PNGs, which I can load into a surface(I'll have to see, but I know I saw that it can be done).
  6. Hello everyone, I have a strange problem. I have been coding C++ with CodeBlocks 17.12 using SDL 2.0.8 and SDL Image 2.0.3. I have been using MingGW and the GCC GNU compiler. When I run my app in CodeBlocks under either Debug or Release it runs fine, but when I go to my Release output folder and double click my EXE, it merely opens and immediately closes. I have the SDL and SDL image dlls in the folder with my release build, and I'm not getting errors that any dlls are missing. This is strange! Help would be much appreciated, Thank you, -Omerta
  7. Omerta7486

    PNG loading with libpng

    @Randy Gaul Thank you. I'm going to begin testing stb_image. it seems very promising. @fleabay It's definitely not the image files. I used two different pngs, plus I tried it with a tif and bmp. I created all files myself, and as a studied graphic artist I highly doubt I did anything wrong with them. 8bpc/32bpp/standard compression for the pngs. Standard 24bpp true color format for the bmp. The tif I created just to round my bases. I've never used tif, but I used default settings on save, so... One question: I see you used '/' instead of '\\', are you on Unix or Linux? That may be the difference. I'm on Windows 10. As a side note, I did notice that I hadn't escaped my backslashes, and I also didn't use the origin identifier in my path. But, even after fixing my blunder, it still crashes upon loading ANY image. [UPDATE] I have gotten SDL_Image to work. There were 2 problems, I noticed I didn't have all of the dlls in the right places, and I also hadn't input the path correctly. Here it is, working: Thank you, both. You were both very helpful!
  8. I program much better when I put on music than when I don't. I find when I program in silence, I make mistakes, get frustrated at the code and myself, and eventually shut down mentally. If I put on some music, it soothes my thinking, and if I get frustrated, I can turn my mind to the music for a second and get lost in thought. I normally listen to heavy metal when drawing/writing, Black Sabbath, Dio, AC/DC, Motorhead, Black Label Society, Pantera, but when I code, I find Bach, Chopin, Liszt, Beethoven, Mozart, Tchaikovsky, and Vivaldi better. And, no, it doesn't seem to impact performance at all.
  9. Hey, everyone, I've been teaching myself C++ for the past week, although I've been coding and tinkering with games for almost 16 years. I'm comfortable with the C++ syntax already and have been chugging along fine, but I've hit a bit of a snag. I'm using CodeBlocks 17.12, SDL 2.0.8, and SDL Image 2.0.3, and I am trying to load a PNG file in for use as a sprite. I have SDL linked perfectly fine, and have been messing around with it's commands for a couple of days with no problems. Loading BMPs, editing pixel matrices, getting user input, basic loop timing and flow, etc. Yesterday, I tried to install SDL Image, and I have the library installed to the point that CodeBlocks can pick up it's syntax and I can use auto finish on it's commands, and there are no compilation errors. The problem comes when I run my code. Through process of elimination(thanks to my in-built error checking), I have narrowed it down to this code: /*** -INITIALIZE PNG LOADING- ***/ int flags=IMG_INIT_PNG; int initted=IMG_Init(flags); if((initted&&flags) != flags) { SDL_Log("Unable to initialize image load: %s", IMG_GetError()); return EXIT_FAILURE; } /*** -LOAD IMAGES- ***/ SDL_Surface *image; SDL_RWops *rwop; rwop=SDL_RWFromFile("\media\die.png", "rb"); image=IMG_LoadPNG_RW(rwop); if(!image) { SDL_Log("Unable to initialize load image: %s", IMG_GetError()); return EXIT_FAILURE; } If I comment block all the Load Images part it runs(even with the PNG Loading part still in), but if I dont, it exits due to the error. After digging around to see what could be wrong I went to the SDL Image website to read that PNG files may need libPNG and zlib. I tried for hours to install those two libraries, but it looks like no matter which archive I download it's just full of UNIX garbage that I can't use on Windows. This, however, doesn't seem to be the path I needed to take, as through testing BMPs do the same thing(Which SDL Image says should load natively). I don't know if there is an error in my code, or if I need libPNG and zlib. I'm lost here. Help would be greatly appreciated, thanks, -Omerta
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!