Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide
[QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #53776] Wed, 29 April 2020 20:34 Go to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello community,

Is there a way on theIDE to define Internal include in a package depending flags or Operating system we use ?
(the actual option "Add new internal includes" on TheIDE have it "When" condition disabled)

Thanks in advance.

Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55604 is a reply to message #53776] Mon, 23 November 2020 21:50 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello, I allow myself to up the post.

I have the GLFW source code (GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events. https://www.glfw.org), in order to make a package of it I simply copy past all source into my package, however source code of GLFW include source to be Linux, Windows,OSX compatible. By isolating all Windows source code I'm able to make the package work perfectly on my windows.

however, I want it to be cross platform. My main idea was to split all differents OS source code between several files and use the option "internal include" with a condition depending on wich os you are. but, sadly, the internal include have is when condition disabled :
https://i.imgur.com/SVGf6ks.png

How you would handle that problematic using TheIDE ?


EDIT : If I put all source code file in same folder then all file.c got interpreted resulting on many compilation error (yes windows dont know about x11 etc...)

[Updated on: Mon, 23 November 2020 21:51]

Report message to a moderator

Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55605 is a reply to message #55604] Mon, 23 November 2020 22:39 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1087
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Xemuth,

Sorry for off topic, but what is the main selling point to use GLFW over U++. Seems that we offer similar feathers - OepnGL for Windows and Linux with windowing system. Do you want to try Vulcan? Maybe it is good time to write VulcanCtrl Wink

If we are lack of some other feathers like GLLock please let us know.

Backing to your topic - you could analyze CtrlCore and see how multi-platform problem was solved Smile

Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 23 November 2020 22:48]

Report message to a moderator

Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55616 is a reply to message #55605] Tue, 24 November 2020 04:16 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Klugier,

No I'm not yet doing some Vulkan Very Happy (when the time will come I will try to create the VulkanCtrl)
I'm actually working on the engine I have barely spoken here (hope I will be able to present it soon !)

All Features I want to implement to the engine is first tested on GLFW (without the engine) for one main reason :

-All the book I have, all topic and tutorial about OpenGL with C++ are for 100% of it (I have never seen something else) using GLFW. Also it is the most common way of sharing simple test case on all coding website (stackoverflow / Game dev exchange etc...)

Furthermore, All features of the engine are tested with U++ OpenGL Ctrl on many differents computers (some with older OpenGL version).

At the moment I dont have found something working on GLFW which dont work on U++ GLCtrl but I wont be surprised if it happen on further. Some OpenGL advanced features need to be initialized at context creation (maybe I'm wrong, I have not yet reach thoses features)
Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55635 is a reply to message #55604] Thu, 26 November 2020 10:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
Xemuth wrote on Mon, 23 November 2020 21:50
Hello, I allow myself to up the post.

I have the GLFW source code (GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events. https://www.glfw.org), in order to make a package of it I simply copy past all source into my package, however source code of GLFW include source to be Linux, Windows,OSX compatible. By isolating all Windows source code I'm able to make the package work perfectly on my windows.

however, I want it to be cross platform. My main idea was to split all differents OS source code between several files and use the option "internal include" with a condition depending on wich os you are. but, sadly, the internal include have is when condition disabled :
https://i.imgur.com/SVGf6ks.png

How you would handle that problematic using TheIDE ?


EDIT : If I put all source code file in same folder then all file.c got interpreted resulting on many compilation error (yes windows dont know about x11 etc...)


How many .c files are there?

There are various strategies for importing external libraries in source form, I bet we can find the one appropriate, or even add it...

I do not think internal include is helpful here (but I might be wrong).

Mierk
Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55636 is a reply to message #55635] Thu, 26 November 2020 14:58 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Mirek,

in 60 files, only 8 are for windows, 17 are for GLFW core and the reste is for other OS :
https://i.imgur.com/3mcR5BD.png
Top window is all my GLFW + Windows file (working)
And the bottom window is the complete source code of GLFW (including Windows, OSX, Linux)
Their is only 60 file so adding a simple #ifdef LINUX / WIN32 at top of each file should be good (like in CtrlCore). no need to have conditional internal includes here

Thanks for your help !
Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55637 is a reply to message #55636] Thu, 26 November 2020 15:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
What about using trick from plugin/png/pnglib.c?

That is if they can be grouped into SCU, which is IMO likely...
Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55641 is a reply to message #55637] Thu, 26 November 2020 17:17 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
indeed, the trick from plugin/png/pnglib.c is perfect, it do the same as internal include but with option of condition. Thanks mirek that's perfect !
Re: [QUESTION]Is it possible to do internal include depending on Operating system or Flag we use/provide [message #55642 is a reply to message #55641] Thu, 26 November 2020 17:39 Go to previous message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
Xemuth wrote on Thu, 26 November 2020 17:17
indeed, the trick from plugin/png/pnglib.c is perfect, it do the same as internal include but with option of condition. Thanks mirek that's perfect !


If it works... That depends on the library you are importing.
Previous Topic: Accessing documentation navigator from code
Next Topic: Help regression and possible improvements in the latest builds
Goto Forum:
  


Current Time: Sat Dec 14 14:47:39 CET 2024

Total time taken to generate the page: 0.04385 seconds