Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Tools and Demos build using OpenGL Render System on Linux #24

Closed
psi29a opened this issue Sep 5, 2014 · 16 comments

Comments

Projects
None yet
5 participants
@psi29a
Copy link
Contributor

commented Sep 5, 2014

While targeting the Ogre Render System, everything compiles just fine with:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMYGUI_RENDERSYSTEM=3 ../mygui; make -j8

as shown here:
https://travis-ci.org/psi29a/mygui/jobs/34474097

however using the OpenGL Render System, it bombs out because it requires windows.h and the rabbit hole goes downwards from there. Doing this:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMYGUI_RENDERSYSTEM=4 ../mygui; make -j8

fails as shown here:
https://travis-ci.org/psi29a/mygui/jobs/34474098

The only way to make it through is to disable the tools and demos, as either would require compiling Common which is where the problem is.

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMYGUI_RENDERSYSTEM=4 -DMYGUI_BUILD_DEMOS=FALSE -DMYGUI_BUILD_TOOLS=FALSE ../mygui; make -j8

I would expect that I should be able to do both with demos and tools without requiring windows. Perhaps there is some misplaced #ifdef logic going on?

@psi29a psi29a added the bug label Sep 5, 2014

@psi29a psi29a modified the milestones: Future, MyGUI 3.2.2 Sep 5, 2014

@Altren

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2014

There are no code for demos and tools for OpenGL under linux. So this never was implemented yet.

@Altren Altren added enhancement and removed bug labels Sep 5, 2014

@Altren Altren changed the title Building Tools or Demos using OpenGL Render System fails on Linux Implement Tools and Demos build using OpenGL Render System on Linux Sep 5, 2014

@psi29a

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2014

Odd, because Common builds just fine with Ogre platform. What is going on that it doesn't work when using OpenGL platform?

@Altren

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2014

Windows creation logic uses WinAPI, texture loading is made with GDI+. So it is simply not cross-platform code.

@psi29a

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2014

OK, so for now... it is on the TODO list. :)

I'll keep it out of our travis tests for now. Sadly we can't say on which platform we run with certain variables.

@psi29a

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2014

Because of the way that travis works, I can't just set MYGUI_BUILD_UNITTESTS=TRUE on Ogre Platform and not OpenGL... it either has to be TRUE for all platforms or FALSE for all platforms.

So until the OpenGL demos are fixed or disabled from building in cmake by testing for windows, we'll have to leave this option out.

I think the quickest way is through cmake to not build windows only tests on non-windows environments.

@Altren

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2014

You was wrong and it is possible to build demos, tools and unit tests only on some platforms. OpenGL implementation might be needed, but until we find someone who can implement crossplatform implementation it will be missing. As far as I remember noone needed it yet anyway.

@psi29a

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2014

I was or am wrong?

I mean that that building tools and plugins on Ogre Platform on Linux works! I know that you say that the OpenGL Platform on Linux has windows only code in it. What I'm saying is that we, in cmake, can ignore building any code that non-windows on non-windows platforms. (This is normal btw, having windows specific code shouldn't be made to be cross-platform.)

This would allow for travis to build with:
-DMYGUI_BUILD_DEMOS=TRUE -DMYGUI_BUILD_TOOLS=TRUE
across all platforms.

As I said before, I can't say to build these on one platform (Ogre) and not the other (OpenGL).

@psi29a

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2014

I stand corrected, I am wrong.:
23ef705

I see what you did, but still... shouldn't this be handled in cmake anyway? Test to see what your host OS is, then not compile code paths that aren't meant for the host OS to begin with.

Also, why did you disable Render System 1 and 2? Shouldn't we should be tested on all code paths?

@psi29a

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2014

Another tip when dealing with travis, make a branch and push the branch up with the changes you've made to .travis.yml

What will happen is that you can experiment and pushes changes and each change triggers a build. When you are satisfied with the results, then just copy the .travis.yml file out of tree, delete the branch locally and remotely, then mv the copy to your master branch then commit.

git branch -d travis # to delete the local branch
git push origin --delete travis # deletes the remote branch as well

This avoids having a long string of commits just for getting your travis file just right.

@Altren

This comment has been minimized.

Copy link
Contributor

commented Sep 6, 2014

Also, why did you disable Render System 1 and 2? Shouldn't we should be tested on all code paths?

Dummy have win32 code in demos and there is no need to build platform itself, since it is almost empty. Render System 2 is empty and number was reserved for something.

@jirojo2

This comment has been minimized.

Copy link

commented Sep 21, 2014

Windows creation logic uses WinAPI, texture loading is made with GDI+. So it is simply not cross-platform code.

I saw OpenGL implementation in Commons is Windows dependant... I can try to port it to linux, it would be usefull for me to get the tools without the ogre rendersystem, but... I am a newbie in this kind of implementations... might never get it done!

@ghost

This comment has been minimized.

Copy link

commented Sep 21, 2014

Feel free to try it! IMO, it would be best to use an existing OpenGL framework such as GLFW (http://www.glfw.org/), or SDL2, or SFML, so we don't have to worry about maintaining any platform specific code.

@ghost ghost removed this from the MyGUI 3.2.2 milestone Feb 2, 2015

@xzwang2005

This comment has been minimized.

Copy link
Contributor

commented May 23, 2015

is BaseManager the only class that have windows dependent code? I'll try to replace the existing code with SDL2 + SDL_image 2. However, that requires these two libraries and their dependencies be included in MyGUI's cmake script. I have no idea how to do this part.

@Altren

This comment has been minimized.

Copy link
Contributor

commented Nov 23, 2016

Done, OpenGL platforms use SDL now.

@Altren Altren closed this Nov 23, 2016

@colesnicov

This comment has been minimized.

Copy link

commented Dec 24, 2016

Hi. I wrote here on comments about this. I will got this problem when i uncheck options (Samples, Tools and OIS examples) :-/

@colesnicov

This comment has been minimized.

Copy link

commented Dec 25, 2016

OK. Worked. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.