Author Topic: GTK3 and SDL2 wizards?  (Read 8757 times)

Offline Wazookie

  • Single posting newcomer
  • *
  • Posts: 2
GTK3 and SDL2 wizards?
« on: January 06, 2014, 05:22:18 pm »
Are there plans to expand the wizards for GTK and SDL to allow picking GTK2 vs GTK3 and SDL vs SDL2?
They still have different include dirs/linker dirs, and so far I've been configuring codeblocks manually to use the newer stuff...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: GTK3 and SDL2 wizards?
« Reply #1 on: January 06, 2014, 06:06:30 pm »
You can right click the wizard and manipulate the script directly.
If you find a working solution, you can provide it here, so we can add it to trunk.

georger_br

  • Guest
Re: GTK3 and SDL2 wizards?
« Reply #2 on: February 06, 2014, 03:03:37 am »
Are there plans to expand the wizards for GTK and SDL to allow picking GTK2 vs GTK3 and SDL vs SDL2?
They still have different include dirs/linker dirs, and so far I've been configuring codeblocks manually to use the newer stuff...
I've attached an updated SDL2 project wizard to this reply. Tested on Windows 8 Pro x64 with stock installs of Code::Blocks 13.12, MinGW32 and SDL2 2.0.1 - I suppose it works on Linux as well since sdl2-config is mentioned in the wizard, but if you're on Linux then you'll have to test.

How to install on Windows:
1) Make a backup copy of C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\config.script because it will be overwritten.
2) Unzip the attached file to C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates
3) Done. Now when creating a new project, the "SDL2 project" template is available.

Details:
1) The template only assumes that stock SDL2 is installed, and only links against SDL2main and SDL2.dll - in other words, if you are using SDL2_image, SDL2_mixer, SDL2_net, or SDL2_ttf, you'll have to manually add those to the Linker settings/Link libraries under Build options.
2) The template includes a post-build step that copies the SDL2 DLLs to the output folder - in other words, you can run the project directly after building. There's no need to copy the DLLs to the output folder nor to any other folder in your PATH.

georger_br

  • Guest
Re: GTK3 and SDL2 wizards?
« Reply #3 on: February 08, 2014, 04:33:59 am »
Just tested it on Code::Blocks 12.11 on Debian Wheezy 32-bit with libsdl2-dev from wheezy-backports, and it worked.

How to install on Linux:
1) Make a backup copy of /usr/share/codeblocks/templates/wizard/config.script because it will be overwritten.
2) Unzip the attached file to /usr/share/codeblocks/templates
2.5) If you're really picky, convert the line endings of /usr/share/codeblocks/templates/wizard/config.script using e.g. dos2unix
3) Done. Now when creating a new project, the "SDL2 project" template is available.