Thread: Is the tutorial on SDL out dated?

  1. #1
    Registered User
    Join Date
    Feb 2012

    Is the tutorial on SDL out dated?

    After following the tutorial on installing code blocks and getting the same results, I proceeded to the SDL installation tutorial. But when i compared my C:\Program Files (x86)\CodeBlocks folder to the one in the tutorial, it didn't match. I have to go to C:\Program Files (x86)\CodeBlocks\MinGW to find the folders that the tutorial asks to put the new files in. I tried doing it this way but was unable to create an SDL project.

    Anyone else had this problem?

    Thank you for your time

  2. #2
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Liverpool UK
    Code blocks project wizard is a bit hit and miss, You are running a 64bit machine, I dont know the details on the support for that in the current release, I am sure it has been anticipated but you are probably best asking on the code block forums.

    In any case you are far better off creating your own custom project template.

    This means that you start with a new basic project option like console, (or GUI will i think add the required windows stuff too, cant rememeber) then in your project build options you have to link to the folder containing the SDL libraries, and also move the SDL header files folder into the mingw include folder, you dont have to put it there but i would for the sake of keeping all known library headers within the common include path.

    Once you have this setup you can save the project as a user defined template. Then hey presto, the next time you want to start an new SDL project you can select it from your custom list and you will get a new blank canvas, set up for SDL.

    For my own part when i use custom templates i often build a bit of starter code into them, with SDL you might want to supply a basic window context and just open ia 640 * 480 surface say, with a default title like 'my new SDL project" you can then edit it as required each time you use the project.
    Also i often add additional files like a resource one with default exe and window frame icons already linked in, then later you could change the image file path to compile the icon you want for your program.
    You can also do stuff like create a template with an openGL context already setup, and save this as your SDL openGL template, or one with a state machine mapped out, including its basic class etc etc. Its loads better than battling with the 'wizard'

    Theres no real 'installation' going on with SDL or whatever, it is uneccesary, there are no file types to register or anything like that. The basic idea when using third party libraries is to simply link to them as a required library, and also make sure the relevant header files are somewhere the compiler knows about.
    NB with SDL there is a runtime library, or potentially several of them, they are DLL's (for windows at least), they will need to be present in the same folder as your .exe or you won't be able to run your work. It will build, but no runtime action.
    The alternative is to copy it to the appropriate system folder so it is then globally available. Of course this DLL dependancy has to then be taken into account when you are considering distributing your work...
    Last edited by rogster001; 02-01-2012 at 07:44 AM.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Out dated header???
    By Limming in forum C++ Programming
    Replies: 6
    Last Post: 08-26-2008, 11:42 PM
  2. Am I learning out-dated code?
    By c777 in forum C++ Programming
    Replies: 6
    Last Post: 03-20-2006, 06:53 AM
  3. Am I learning out-dated code?
    By JustinAllard in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2005, 05:05 AM
  4. Glaux Out dated with Dev C++
    By Zeusbwr in forum Game Programming
    Replies: 7
    Last Post: 11-26-2004, 01:13 AM
  5. Dated headers
    By alphaoide in forum C++ Programming
    Replies: 2
    Last Post: 11-14-2003, 03:10 AM