Jump to content


Photo

TDM on OS X (test build)


  • Please log in to reply
58 replies to this topic

#51 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1119 posts

Posted 21 June 2018 - 10:39 AM

First thing that has to be fixed is

#elif defined( MACOS_X )

As far as I see, this macro is defined in XCode projects.

Probably it's better to use __APPLE__. In one place it even checks for either macro to be present.

 

However, there are already too many usages of MACOS_X in the code, so changing all of them does not sound like a good idea.

I have added automatic setting of MACOS_X macro in sys_public.h, which is included at the very beginning of precompiled header.

Committed in svn rev 7492.

I hope this will cover all places where MACOS_X is used, or at least most of them.
 
 

EDIT Btw which opengl version is required by TDM, anything newer then opengl 4.1? Because i keep on hitting problems in qgl.h, see the attached log output.

It uses something like OpenGL 2.1 with some extensions from OpenGL 3.0. Currently OpenGL 3.0 should be absolutely enough to run everything in TDM.

 

These errors say that typedefs for function pointers are undefined. These typedefs must be defined in glext.h header (the one which declared OpenGL extensions).

This header is located inside renderer directory, and it should be included from qgl.h.

Check qgl.h file: perhaps there is some ugly hack which blocks the include.

 


  • nbohr1more likes this

#52 damiel

damiel

    Member

  • Member
  • PipPip
  • 22 posts

Posted 21 June 2018 - 11:09 AM

As far as I see, this macro is defined in XCode projects.

Probably it's better to use __APPLE__. In one place it even checks for either macro to be present.

 

However, there are already too many usages of MACOS_X in the code, so changing all of them does not sound like a good idea.

I have added automatic setting of MACOS_X macro in sys_public.h, which is included at the very beginning of precompiled header.

Committed in svn rev 7492.

I hope this will cover all places where MACOS_X is used, or at least most of them.
 
 

It uses something like OpenGL 2.1 with some extensions from OpenGL 3.0. Currently OpenGL 3.0 should be absolutely enough to run everything in TDM.

 

These errors say that typedefs for function pointers are undefined. These typedefs must be defined in glext.h header (the one which declared OpenGL extensions).

This header is located inside renderer directory, and it should be included from qgl.h.

Check qgl.h file: perhaps there is some ugly hack which blocks the include.

 

This seems to work as fine and also revealed a problem in Math.h which tries to include ppc_intrinsics.h which is not existing in modern macOS SDKs, but there is a workaround. So something like 

#if defined(__ppc__)
#include <ppc_intrinsics.h>
#endif

 will help there.

 

I will take a closer look at qgl.h to see if i can resolve the issue.


  • nbohr1more likes this

#53 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1119 posts

Posted 21 June 2018 - 12:04 PM

This seems to work as fine and also revealed a problem in Math.h which tries to include ppc_intrinsics.h which is not existing in modern macOS SDKs

Committed a fix in svn rev 7493.



#54 damiel

damiel

    Member

  • Member
  • PipPip
  • 22 posts

Posted 21 June 2018 - 12:21 PM

Committed a fix in svn rev 7493.

 

I checked your fix but it doesnt seem to work. If you want to use ifdef instead of ifdefine i think you have to remove the braces around __ppc__

 

EDIT

 

I just checked, yes you have to remove the braces to make it work.


Edited by damiel, 21 June 2018 - 12:22 PM.


#55 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1119 posts

Posted 21 June 2018 - 12:25 PM

I checked your fix but it doesnt seem to work. If you want to use ifdef instead of ifdefine i think you have to remove the braces around __ppc__

Oops, sorry.

Fixed in rev 7494.



#56 damiel

damiel

    Member

  • Member
  • PipPip
  • 22 posts

Posted 22 June 2018 - 01:40 PM

Small status update: I havent been able to resolve the issue related to qgl.h yet. From the error messages itself it seems there is a declaration collision, between the glext.h provided by TDM and gltypes.h provided by the macOS SDK/OpenGL framework and i havent found a way yet to untangle this mess... the gltypes.h is included by the OpenGl headers used by macOS... I keep trying to research this problem.



#57 damiel

damiel

    Member

  • Member
  • PipPip
  • 22 posts

Posted 23 June 2018 - 11:13 AM

Sorry for the double post, I was able to remove a tiny part of the error messages but the majority is still there. I had to define

#define GL_ARB_shader_objects 0

right after including the opengl header. Later it will be set again to 1 in glext.h so i hope this is fine. But there are still plenty of error messages left and i out of ideas right now...

(not that i had many to begin with :laugh: )

 

EDIT i did it, i managed to overcome the first encountered hurdles, found some new errors that need to be fixed, i will see if i can fix those aswell.

 

EDIT2 Next show stopper:

idlib/StdFilesystem.cpp:26:11: fatal error: 'experimental/filesystem' file not found
        #include <experimental/filesystem>

The comments related to the code suggest that this should work for both gcc and clang. Any ideas? :)

 

EDIT3 I should share what other fixes i have so far:

 

In qgl.h line 30

#include <OpenGL/OpenGL.h>

This header is a bit of magic to me, it seems to be related to Core OpenGl/CGL which is macOS equivalent to glx on Linux or WGL on windows.

 

Other thing i had to fix was Simd.cpp line 257

#elif MACOS_X

into

#elif defined(MACOS_X)

EDIT4 After some research it seems the version of libc++ which does not have this header yet, the only solution for this that were suggested was to either use gcc which is kinda messy because alot of places expect clang to be the main compiler or to use a beta release of xcode and its commandline tools. Here is a related stackoverflow thread about it.


Edited by damiel, 23 June 2018 - 05:03 PM.


#58 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1119 posts

Posted 24 June 2018 - 04:19 AM

right after including the opengl header. Later it will be set again to 1 in glext.h so i hope this is fine. But there are still plenty of error messages left and i out of ideas right now...
(not that i had many to begin with :laugh: )

Probably you should add these includes of OpenGL and remove the other ones?
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>
 

idlib/StdFilesystem.cpp:26:11: fatal error: 'experimental/filesystem' file not found
        #include <experimental/filesystem>
EDIT4 After some research it seems the version of libc++ which does not have this header yet, the only solution for this that were suggested was to either use gcc which is kinda messy because alot of places expect clang to be the main compiler or to use a beta release of xcode and its commandline tools. Here is a related stackoverflow thread about it.

You should either include <experimental/filesystem> or simply <filesystem>, depending on whatever is present on your machine.
Setting appropriate ifdefs is a separate question.

#59 damiel

damiel

    Member

  • Member
  • PipPip
  • 22 posts

Posted 24 June 2018 - 05:29 AM

Probably you should add these includes of OpenGL and remove the other ones?

#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>
 
You should either include <experimental/filesystem> or simply <filesystem>, depending on whatever is present on your machine.
Setting appropriate ifdefs is a separate question.

 

 

I am not sure if including all of those 3 headers is the way to go especially because we already include glext.h from TDM so we would get another clash without adding a couple of more ifdefs. (I will play around with those anyways, its worth investigating)

 

And about the filesystem header, the crux is that neither of those two exists on macOS simply because it isnt shipped with xcode and its commandline tools, you either have to wait for it to be shipped by apple or use a custom compiler build either installed by homebrew/fink or by compilling it by hand.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users