Openglide on MacOS X

Developer's Forum, for discussion of bugs, code, and other developmental aspects of OpenGLide.

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-03 @ 21:52

-lglide2x is required. Dosbox loads glide dynamically (dlopen).
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-03 @ 22:03

Code: Select all
gcc bc.c -I/opt/local/include -I/usr/local/include/openglide -arch i386 -lglide2x /usr/local/include/openglide
In file included from /usr/local/include/openglide/sdk2_glide.h:36,
                 from test.h:20,
                 from bc.c:3:
/usr/local/include/openglide/sdk2_3dfx.h:100:4: warning: #warning define FX_ENTRY & FX_CALL for your compiler
ld: in /usr/local/include/openglide, can't map file, errno=22
collect2: ld returned 1 exit status


Code: Select all
g++ bc.c -I/opt/local/include -I/usr/local/include/openglide -arch i386 -lglide2x /usr/local/include/openglide
In file included from /usr/local/include/openglide/sdk2_glide.h:36,
                 from test.h:20,
                 from bc.c:3:
/usr/local/include/openglide/sdk2_3dfx.h:100:4: warning: #warning define FX_ENTRY & FX_CALL for your compiler
In file included from bc.c:3:
test.h: In function ‘int main(int, char**)’:
test.h:43: error: ‘getch’ was not declared in this scope
test.h:62: error: ‘getch’ was not declared in this scope


I'm not sure if I'm doing this right at all. Whether to compile this with gcc or g++ or with something different.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-04 @ 06:42

I don't know what the map file is supposed to be, but try to replace that getch with some sleep or scanf or something (it is there just to make sure the program does not exit immediately). You could also add something like int i = some_really_big number; while(i--); :happy:
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-04 @ 11:04

no luck. Just commenting out getch, just lead to the same error in g++ as in gcc.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-04 @ 15:15

What is that /usr/local/include/openglide after the -lglide2x?
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-04 @ 15:39

forget that, I thought without that it wouldn't find the openglide stuff. I was wrong about that :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-04 @ 15:58

so it compiles without that or do you get the same error?
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-04 @ 15:59

same error.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-14 @ 22:28

One of these days I'm gonna try to get my hands on a MAC...this remote debugging isn't going very well :happy:
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-15 @ 03:54

nope, it's quite frustrating this way and I'm sure if you could tinker around with it directly you'd find the culprit :)

In the meantime, I'm still yours for whatever you throw at me :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-18 @ 13:39

How about this? :happyhappy:
Indeed it seems openglide requires -Wl,-framework,OpenGL and not -lGL and -lGLU (I thought if -lGL wouldn't work it wouldn't compile, not that it would crash :pppt:).
I had all sorts of other problems compiling (how is it that it went that smooth for you?), I'll try to prepare a patch that solves all the problems and see how it goes from there...
Attachments
image.jpg
image.jpg (416.82 KiB) Viewed 5452 times
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby rcblanke » 2009-11-18 @ 14:11

Gratz, keep up the good work, guys!
User avatar
rcblanke
Oldbie
 
Posts: 1318
Joined: 2005-4-01 @ 09:44
Location: Round 42

Re: Openglide on MacOS X

Postby Dominus » 2009-11-18 @ 15:05

Indeed it seems openglide requires -Wl,-framework,OpenGL and not -lGL and -lGLU (I thought if -lGL wouldn't work it wouldn't compile, not that it would crash Sticking Tongue Out).

woot woot woot!!!

I had all sorts of other problems compiling (how is it that it went that smooth for you?), I'll try to prepare a patch that solves all the problems and see how it goes from there...

We did eliminate some stuff before in the other thread, but now that I threw in the framework OpenGL stuff in there, I get problems too, but never mind, I'll wait for your patch :)
Actually I'm really stupid, I *should* have noticed the wrong OpenGL library call, I knew the correct one from Exult... It had to be somethin obvious...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-18 @ 19:02

This seems to work for me with current cvs. Should compile out of the box with only those few CFLAGS and LDFLAGS settings (I used CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-arch i386", don't know if any more are required? Dominus?). The patch is relatively simple, only some minor fixes and I added proper return values to InitialiseOpenGLWindow. It should be noted only the SDL version builds under MacOS X, there is no native version.

Patch tested to compile on:
MacOS X 10.6.2 (xcode 3.2.1) x86 & x86_64 - SDL only
Still working:
MINGW & MSVC6 - SDL & native
Centos5 x86 & x86_64 - SDL & native


BTW, it is interesting that MacOS X 10.6.2 gets detected as i386-darwin in configure, yet gcc builds 64-bit binaries by default (dosbox does not compile without forcing gcc to make 32-bit binaries). Yet, SDL configure script detects it as x86_64-darwin, I can't find why...I could build both SDL and openglide in 64-bit mode, but I couldn't build dosbox...
Attachments
openglide-macosx.diff
(12.28 KiB) Downloaded 372 times
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-18 @ 19:07

I'll give it a try now.

You should be able to build Dosbox in 64bit, I did so via MacPort but it is better to build it in 32bit or else you will lose the dynamic core. And you need to build all the libraries that Dosbox needs in universal, meaning 32- and 64bit. I recommend using MacPorts if you don't want to lose too much hair building all the stuff on OS X :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby Dominus » 2009-11-18 @ 22:14

ok, it is working now. Many thanks! Looks fun now :)

When Tomb Raider starts the actual game I get the console message:
"Warning: Severe Problem: OpenGL GL_EXT_packed_pixels extension is required for OpenGLide!"

Also when I run Dosbox windowed the screen gets very bright whenever Glide initialises.

Lands of Lore 3 has texture errors, if that is of interest :)

In the log this is listed:
--------------------------------------------------------
** OpenGL Information **
--------------------------------------------------------
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 4850 OpenGL Engine
Version: 2.1 ATI-1.6.6
Extensions: GL_ARB_transpose_matrix GL_ARB_vertex_program GL_ARB_vertex_blend GL_ARB_window_pos GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_shading_language_100 GL_EXT_multi_draw_arrays GL_EXT_clip_volume_hint GL_EXT_rescale_normal GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_gpu_program_parameters GL_EXT_geometry_shader4 GL_EXT_transform_feedback GL_APPLE_client_storage GL_APPLE_specular_vector GL_APPLE_transform_hint GL_APPLE_packed_pixels GL_APPLE_fence GL_APPLE_vertex_array_object GL_APPLE_vertex_program_evaluators GL_APPLE_element_array GL_APPLE_flush_render GL_APPLE_aux_depth_stencil GL_NV_texgen_reflection GL_NV_light_max_exponent GL_IBM_rasterpos_clip GL_SGIS_generate_mipmap GL_ARB_imaging GL_ARB_point_parameters GL_ARB_texture_env_crossbar GL_ARB_texture_border_clamp GL_ARB_multitexture GL_ARB_texture_env_add GL_ARB_texture_cube_map GL_ARB_texture_env_dot3 GL_ARB_multisample GL_ARB_texture_env_combine GL_ARB_texture_compression GL_ARB_texture_mirrored_repeat GL_ARB_shadow GL_ARB_depth_texture GL_ARB_shadow_ambient GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_occlusion_query GL_ARB_point_sprite GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ARB_pixel_buffer_object GL_ARB_draw_buffers GL_ARB_shader_texture_lod GL_ARB_color_buffer_float GL_ARB_half_float_vertex GL_ARB_texture_rg GL_ARB_texture_compression_rgtc GL_EXT_compiled_vertex_array GL_EXT_draw_buffers2 GL_EXT_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_texture_rectangle GL_ARB_texture_rectangle GL_EXT_texture_env_add GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_texture_lod_bias GL_EXT_abgr GL_EXT_bgra GL_EXT_stencil_wrap GL_EXT_texture_filter_anisotropic GL_EXT_separate_specular_color GL_EXT_secondary_color GL_EXT_blend_func_separate GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_sRGB GL_EXT_blend_equation_separate GL_EXT_texture_mirror_clamp GL_EXT_packed_depth_stencil GL_EXT_bindable_uniform GL_EXT_texture_integer GL_EXT_gpu_shader4 GL_EXT_framebuffer_sRGB GL_APPLE_flush_buffer_range GL_APPLE_ycbcr_422 GL_APPLE_rgb_422 GL_APPLE_vertex_array_range GL_APPLE_texture_range GL_APPLE_float_pixels GL_ATI_texture_float GL_ARB_texture_float GL_ARB_half_float_pixel GL_APPLE_pixel_buffer GL_APPLE_object_purgeable GL_NV_blend_square GL_NV_fog_distance GL_ATI_texture_mirror_once GL_ATI_blend_equation_separate GL_ATI_blend_weighted_minmax GL_ATI_texture_env_combine3 GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SGI_color_matrix
--------------------------------------------------------
OpenGL Extensions:
--------------------------------------------------------
Severe Problem: OpenGL GL_EXT_packed_pixels extension is required for OpenGLide!Extension GL_EXT_secondary_color is present and ENABLED
Extension GL_ARB_multitexture is present and ENABLED
Extension GL_EXT_fog_coord is present and ENABLED
Extension GL_EXT_texture_env_add is present and ENABLED
Note: OpenGL GL_EXT_texture_env_combine extension is not supported, emulating behavior.
Extension GL_EXT_texture_lod_bias is present and ENABLED
Note: OpenGL GL_SGIS_generate_mipmap extension is supported but disabled by user
Note: OpenGL GL_EXT_paletted_texture extension is not supported, emulating behavior.
Note: OpenGL GL_EXT_vertex_array extension is not supported, emulating behavior.
Extension GL_EXT_blend_func_separate is present and ENABLED
--------------------------------------------------------
MultiTexture Textures Units = 8
--------------------------------------------------------
Setting in Use:
--------------------------------------------------------
Init Full Screen = true
Fog = true
Precision Fix = false
Wrap 565 to 5551 = true
Texture Memory Size = 16 Mb
Frame Buffer Memory Size = 8 Mb
MMX is present
--------------------------------------------------------
--------------------------------------------------------
** Glide Calls **
----------------------------------------------------
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-18 @ 22:31

Yes, I've noticed the GL_EXT_packed_pixels error, but openglide luckily does not abort and it seems to work fine anyway :)

The bright screen is actually the game setting the gamma, but SDL seems only to be able to adjust the gamma of the whole screen not just the window (if that's possible at all).
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-18 @ 22:34

And not being able to switch Dosbox from windowed mode to fullscreen is probably known, right?
Other than that it seems to work fine, only when you start a game/load a game in Tomb Raider it sometimes fails to load... I'll see if I can log it :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-11-18 @ 22:37

yes, haven't been able to crack that one yet :(
But at least, the full screen is retained with the latest cvs, so you just need to set fullscreen before glide activates :)
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-11-18 @ 22:44

oh, it didn't do that before? Lucky me now :)
It has been fun now playing with this. Now I need to find what other glide games I have besides Tomb Raider and Lands of Loare 3 :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

PreviousNext

Return to OpenGLide Development

Who is online

Users browsing this forum: No registered users and 1 guest