Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: K-Sys on February 19, 2021, 11:16:59 am

Title: Changing default properties on new files
Post by: K-Sys on February 19, 2021, 11:16:59 am
Hello,
I recently started to learn Vulkan and successfully compiled everything with CodeBlocks so far.
Now I'm starting to write some shaders and wanted to automatically compile them with the rest of the project.
I managed to set up a custom compile command for them (via advanced compiler options, for file endings .vert and .frag) and that works great.

However when adding those files to my project or creating new ones the compile option in the files properties is unchecked, which means they won't actually get compiled unless i manually check that box for each file.
In contrast when creating a new .cpp file the compile option and the link option both are checked by default.

Is there any way to change this behaviour, so all my shader files (.vert and .frag) get the compile option checked by default?
I couldn't find any setting for that, nor a solution when googling for the problem.
Title: Re: Changing default properties on new files
Post by: oBFusCATed on February 19, 2021, 06:56:45 pm
What happens if you add them to "Sources" in Projects -> Project tree -> Edit file types & categories?
I don't guarantee that it will work. :)
Title: Re: Changing default properties on new files
Post by: K-Sys on February 20, 2021, 10:44:10 am
No that doesn't seem to work either.
I also tried creating a new category for shaders, but there doesn't seem to be a setting to change those default properties of new files.
Title: Re: Changing default properties on new files
Post by: oBFusCATed on February 20, 2021, 12:28:31 pm
Then you'll have to read to source :)
Title: Re: Changing default properties on new files
Post by: K-Sys on February 21, 2021, 09:51:35 am
What do you mean by that?
Title: Re: Changing default properties on new files
Post by: oBFusCATed on February 21, 2021, 12:25:18 pm
s/to source/the source.

That you'll have to find the relevant part of the code and see what it is doing and if there is a way to do what you want to do.  ;)
Title: Re: Changing default properties on new files
Post by: K-Sys on February 22, 2021, 03:27:49 pm
That is probably not worth doing in my case, since i have only a small project for learning. But thanks for your help.
Title: Re: Changing default properties on new files
Post by: benkenobi01 on February 22, 2021, 06:25:28 pm
s/to source/the source.

That you'll have to find the relevant part of the code and see what it is doing and if there is a way to do what you want to do.  ;)
In that case he better go with something else than codeblocks if he doesn't want to utterly waste his time and if you people here could stop with these genius reply like: "you should check the source code" accompanied with the blink eye emoticon.
Title: Re: Changing default properties on new files
Post by: oBFusCATed on February 22, 2021, 07:47:15 pm
benkenobi01:
Keep in mind that any work done on codeblocks is done by volunteers.
So we (the volunteers) have three options: 1. ignore the topic, 2. give some suggestions, 3. do the work.
If we don't have the time for 3., are you suggesting that we should stick to 1.?
How is that better than 2.?