OSX Support

Moderator: andrewmac

10 posts Page 1 of 1
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Fri Jan 01, 2016 10:18 pm
I've been working on OSX support over the holidays. It's almost ready. Just a few more things to fix up. For now this is just OpenGL. I've tested bgfx samples with Metal but I haven't got Metal working in Torque 6 yet. That will most likely be next after fixing SkyLight.

Early screenshots:
Image
Image
lowlevelsoul
Posts: 23
Joined: Mon Mar 30, 2015 10:02 pm
by lowlevelsoul » Sun Feb 21, 2016 9:22 am
Awesome stuff! I was just lamenting the slightly broken Mac build own the scene partition thread.
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Mon Feb 22, 2016 5:16 pm
@
User avatar
lowlevelsoul
: This is a sort of pet project of mine. I have a macbook but use windows on desktop for primary development so anytime I'm being lazy and watching TV on the sofa, etc I'll work on OSX support. Lately I'm having issues with order of operations. Basically I'm trying to initialize the graphics on a window that's not fully open (I'm assuming) and it results in a GL invalid framebuffer operation but I'm not sure why it's not "ready". I'm relatively new to Cocoa and Objective-C and all that so my development in these areas can be a bit slow :)
lowlevelsoul
Posts: 23
Joined: Mon Mar 30, 2015 10:02 pm
by lowlevelsoul » Tue Feb 23, 2016 7:27 am
I wouldn't be much use here - I tend to use SDL when writing mac gfx stuff. Dealing with Cocoa windowing can be a pain.

But It's odd, because I had a similar issue with Android - I had to wait until the window was "ready"which wasn't the same as it having been created. This was a bit easier than on OSX, because the window creation happened on a different thread and so I just waited for the message to be processed.

The thing about SDL is that it won't return from the window creation function, until the window is ready and so you end up creating the gl context outside of the message loop. I can have a look at it (when I have time) and see if anythings amiss - but I may be as much in the dark as you are.
LukasPJ
Site Admin
Posts: 342
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Tue May 03, 2016 11:22 am
Oi, get your act together!

dglMac_Binding.h -> there are no dglSetFSAASamples defined anywhere.

osxCocoaUtilities.mm ->
#import "fileDialog.h"

should be:
#import "platform/nativeDialogs/fileDialog.h"


Also, I get this message:
ld: framework not found Metal
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Tue May 03, 2016 3:54 pm
:D there is nothing in dglMac_binding.h that's still being used. You can kill it, I thought I already did.

Regarding the metal problem, it should be detecting that your system doesn't support metal. Maybe try forcing this to 0 to disable metal support:
https://github.com/andr3wmac/Torque6/bl ... .h#L46-L51

I'll try to take another look at OSX support soon.
LukasPJ
Site Admin
Posts: 342
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Tue May 03, 2016 9:41 pm
andrewmac wrote::D there is nothing in dglMac_binding.h that's still being used. You can kill it, I thought I already did.

Regarding the metal problem, it should be detecting that your system doesn't support metal. Maybe try forcing this to 0 to disable metal support:
https://github.com/andr3wmac/Torque6/bl ... .h#L46-L51

I'll try to take another look at OSX support soon.


Should totally mention, I'm running Yosemite on a Macbook Pro from Mid 2015. I'll have a go at disabling Metal support tomorrow or the day after ;)
LukasPJ
Site Admin
Posts: 342
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Tue May 03, 2016 10:52 pm
Alright, so just tried it again with that config setting you said. This is the full output:

DKR1707:build dklukjor$ make debug64
./genie_mac gmake
Building configurations...
Running action 'gmake'...
Generating ../gmake/Makefile...
Generating ../gmake/Torque6App.make...
Generating ../gmake/Torque6.make...
Generating ../gmake/lib/assimp.make...
Generating ../gmake/lib/bgfx.make...
Generating ../gmake/lib/bullet.make...
Generating ../gmake/lib/ljpeg.make...
Generating ../gmake/lib/lpng.make...
Generating ../gmake/lib/zlib.make...
Generating ../gmake/plugins/Sky.make...
Generating ../gmake/plugins/Terrain.make...
Generating ../gmake/plugins/Particles.make...
Generating ../gmake/plugins/CSG.make...
Done.
/Library/Developer/CommandLineTools/usr/bin/make -R -C ./gmake config=debug64
==== Building assimp (debug64) ====
Archiving assimp
==== Building bgfx (debug64) ====
Archiving bgfx
==== Building bullet (debug64) ====
Archiving bullet
==== Building ljpeg (debug64) ====
Archiving ljpeg
==== Building lpng (debug64) ====
Archiving lpng
==== Building zlib (debug64) ====
Archiving zlib
==== Building Torque6 (debug64) ====
Linking Torque6
ld: framework not found Metal
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../bin/libTorque6_DEBUG.dylib] Error 1
make[1]: *** [Torque6] Error 2
make: *** [debug64] Error 2


From what I gathered, it's because of this build configuration: "-framework Metal" on Torque6 and bgfx, but removing it from the lua scripts results in a lot of undefined symbols, so that is not the way to go :P

Edit: some of the undefined symbols:

Code: Select all

==== Building Torque6 (debug64) ====
Linking Torque6
Undefined symbols for architecture x86_64:
  "nsglGetProcAddress(unsigned char const*)", referenced from:
      rmtglGetProcAddress(OpenGL*, char const*) in libbgfx.a(bgfx.o)
  "bgfx::gl::glCullFace", referenced from:
      bgfx::gl::RendererContextGL::submit(bgfx::Frame*, bgfx::ClearQuad&, bgfx::TextVideoMemBlitter&) in libbgfx.a(renderer_gl.o)
  "bgfx::gl::glDisablei", referenced from:
      bgfx::gl::RendererContextGL::submit(bgfx::Frame*, bgfx::ClearQuad&, bgfx::TextVideoMemBlitter&) in libbgfx.a(renderer_gl.o)
  "bgfx::gl::glEndQuery", referenced from:
      bgfx::gl::OcclusionQueryGL::end() in libbgfx.a(renderer_gl.o)
      bgfx::gl::RendererContextGL::init() in libbgfx.a(renderer_gl.o)
      bgfx::gl::TimerQueryGL::end() in libbgfx.a(renderer_gl.o)
  "bgfx::gl::glGetError", referenced from:
      bgfx::gl::glGet(unsigned int) in libbgfx.a(renderer_gl.o)
      bgfx::gl::ProgramGL::create(bgfx::gl::ShaderGL const&, bgfx::gl::ShaderGL const&) in libbgfx.a(renderer_gl.o)
      bgfx::gl::ProgramGL::init() in libbgfx.a(renderer_gl.o)
      bgfx::gl::ProgramGL::destroy() in libbgfx.a(renderer_gl.o)
      bgfx::gl::ProgramGL::bindAttributes(bgfx::VertexDecl const&, unsigned int) const in libbgfx.a(renderer_gl.o)
      bgfx::gl::ProgramGL::bindInstanceData(unsigned int, unsigned int) const in libbgfx.a(renderer_gl.o)
      bgfx::gl::IndexBufferGL::destroy() in libbgfx.a(renderer_gl.o)
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Wed May 04, 2016 3:24 pm
I'll try to find some time to look at OSX again soon, though the issue you're seeing doesn't ring any bells. The majority of the issues I had with OSX are invalid framebuffer operations during initial launch of the application. A good place to start would be to just clone bgfx and try to run the samples on your macbook. If that succeeds and Torque 6 still fails then I must have something messed up in the build scripts.
LukasPJ
Site Admin
Posts: 342
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sat Oct 22, 2016 5:39 pm
Are there any updates on this?
I'm getting the linker issues on both assimp and bgfx.

Here is the full output: http://hastebin.com/gufoqehozi.rb
I've been trying to figure it out, but I failed in figuring it out. Are there anyone who has some suggestions as to why this may be?
10 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest