VOGONS


First post, by Termina

User metadata
Rank Newbie
Rank
Newbie

I've been trying to get the source-code built so it will use OpenGL. I found some opengl headers which the configure script is happy with, however it fails when trying to link to -lGL.

I'm assuming that Dosbox is supposed to compile with OpenGL on OSX - please correct me if I'm wrong.

There isn't a libGL.a or GL.a anywhere on my system. I've used MacOS stub libraries when building other opengl programs using Codewarrior, and wondered if there's a way of either getting Dosbox to link to these or of converting them to the .a format. Or thirdly if anyone knows where I could get the GL lib to make the configure script happy.

Reply 1 of 4, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

opengl is optional

Just try to find out which library on mac os x holds the opengl support.

create a symlink to it and name it libGL.a

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 4, by Termina

User metadata
Rank Newbie
Rank
Newbie

I found that the Mesa libGL.a resides under /usr/X11R6/lib. Linking to it works and opengl is used, however its horribly slow. Looking on the Mesa website it seems likely that its only doing software rendering.

Surely there's a way of hooking into OSX's opengl. I'm not that knowledgable of OSX else I'd know how to do it :\

Reply 3 of 4, by Termina

User metadata
Rank Newbie
Rank
Newbie

I'm trying to get dosbox compiling using Codewarrior 8.3. Not only will this enable me to use apple's opengl and get hardware acceleration, but it may also produce more optimized code.

Anyway, I'm stuck with a compile error when building core_normal.cpp.

It includes the header "instructions.h" which defines the macro ADDB with 4 arguments:-

#define ADDB(op1, op2, load, save) \ etc.

However it later includes the header "prefix_none.h" which uses ADDB without args:-

RMEbGb(ADDB); break;

Codewarrior is saying that ADDB in this instance is undefined. I'm not really understanding what's intended by the code in prefix_none.h. Is it meant to use the ADDB that's in instructions.h or another defined elsewhere? Anything that illuminates this for me would be a big help 😀

Reply 4 of 4, by Termina

User metadata
Rank Newbie
Rank
Newbie

Back with using gcc, I found that if it compiles without needing -lGL at all. The -framework OpenGL statement does all that's needed. So it'd be a good idea to remove those from the Makefile and the configure script when MacOSX is the platform.

On the other hand, the build I produced using the default compiler flags etc is still very slow (much slower than the released binary), and OpenGL doesn't seem at all accelerated. I'd still like to get it built using Codewarrior if someone can help me understand that code, as right now I'm really stuck on it :\