Jump to content
The Dark Mod Forums

TDM on OS X (test build)


greebo

Recommended Posts

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.

 

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 5 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...