Wondering what you think of this idea...
Having a code library, which is designed to provide procedures and macros that will provide access to alternatives to each OS's API functions.
For instance;
Windows SetProp_(), would have a standard procedure name like 'SetProperty(...)' and in-code it would compile a version designed for each OS, be it Linux (g_object_set_property), or Mac (...)..
I know some API features in Windows may not exist in Linux, or Mac, but if a suitable work-around can be written as an alternative, it should provide a much wider function list that can be used in PureBasic regardless of OS.
Env
[Your Thoughts] Macros for Cross-Platform API Functionality
[Your Thoughts] Macros for Cross-Platform API Functionality
Last edited by Env on Wed Feb 16, 2011 1:09 am, edited 1 time in total.
Thanks!
-
- Addict
- Posts: 1675
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: [Your Thoughts] Macros for Cross-Platform API Alternativ
Sounds like a neat idea to me!
Would make cross-platform development a lot easier too.
Although such a project would be a HUGE undertaking.. You'd need to decide what core components you are going to support, and as your list grows you have to constantly maintain it to keep up with changes in PB Syntax, as well as OS API
Would make cross-platform development a lot easier too.
Although such a project would be a HUGE undertaking.. You'd need to decide what core components you are going to support, and as your list grows you have to constantly maintain it to keep up with changes in PB Syntax, as well as OS API
Re: [Your Thoughts] Macros for Cross-Platform API Alternativ
Aye, no doubt it will be a long time, and a lot of work hours before a complete library can be completed, which in a sense will be never with changes always being made,
but if it were an opensource project, and available via SVN, it may be useful for some, and people can always contribute their own features.
but if it were an opensource project, and available via SVN, it may be useful for some, and people can always contribute their own features.
Thanks!
Re: [Your Thoughts] Macros for Cross-Platform API Functional
Now you see the process required from the pb devs to add thing to purebasic itself. Essentially all pb commands are macros that change depending on the compilers os. If there is a good general knowledge of each os' api it shouldnt be too difficult depending on what commands your wanting to have
Re: [Your Thoughts] Macros for Cross-Platform API Functional
Yeah I know that to be the case, and with this, it may encourage, and assist the PBDevies to add more functionality.
If enough people are interested, I can set up a base for it, and a website for people to contribute their own code to provide a standard function/macro that will perform the same operation using the independent OS' API.
If enough people are interested, I can set up a base for it, and a website for people to contribute their own code to provide a standard function/macro that will perform the same operation using the independent OS' API.
Thanks!