Horde3D

Next-Generation Graphics Engine
It is currently 23.11.2024, 13:34

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 19.07.2008, 22:12 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
I am currently working up a sample to demonstrate integrating Horde directly with the Cocoa environment on Mac OS X.

Full size image
Image

The sample is basically a direct port of the knight sample to a GUI environment, and is not yet complete. In particular, I am still chasing an FBO bug related to clearing the buffer when in windowed mode (visible in the above image).

I also plan to write a tutorial for the Wiki detailing the process (as well as posting the source code, of course), as there are a couple of likely stumbling blocks along the way.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 19.07.2008, 23:01 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
The app is now basically finished (a few bugs proved easier to track down than I had expected). If you have a Mac, you can download the sample, and give it a spin: newer binary below

Drag in the view to rotate the camera, and use WASD to move.

Along the way I discovered that the samples won't run as is on a PowerPC Mac, because the Geo and Anim files in the content directory were all created on Little Endian machines, and the engine doesn't take endianess into consideration when opening them. Hopefully I can find time to remedy this somewhere down the line.

_________________
Tristam MacDonald - [swiftcoding]


Last edited by swiftcoder on 20.07.2008, 15:22, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: 19.07.2008, 23:27 
Offline

Joined: 22.05.2008, 18:30
Posts: 37
I'll give them a go on the Mac we have on Monday... we'd like to have our game running on the Mac, but we've got one with an ATI x1600, so it may be a no-go area, and we'll need to throw in the forward rendering pipeline again ( we went deferred so our artists could create a better atmosphere, with more lights and shader work available to us. )

The Mac still somewhat scares me for creating binaries for, as I've only ever really done so under Linux and Windows.. we also have the problem in that we don't have XCode installed ( or any development stuff ) on the Mac, so I've been cross-compiling some things from my Linux machine... though currently all I've gotten is the usual "Hello World!" program done and a few SDL tests as CMake didn't seem to want to co-operate in cross-compiling Horde3D much.

At any rate, we need the game finished on one platform first ;) just would be nice to compile to three platforms from the same source tree :) It already does with Windows and Linux, so far! But yea, congrats on getting Cocoa to play nice with Horde.. from what I've heard, it's a bit mental like WinAPI in places ( or worse, straight XLib! hehe )


Top
 Profile  
Reply with quote  
PostPosted: 19.07.2008, 23:53 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
stuckie wrote:
we'd like to have our game running on the Mac, but we've got one with an ATI x1600, so it may be a no-go area, and we'll need to throw in the forward rendering pipeline again...
I am running this on a MacBook Pro, with the x1600 mobility. It runs pretty well, but I haven't tried to get a deferred pipeline running.

Quote:
The Mac still somewhat scares me for creating binaries for, as I've only ever really done so under Linux and Windows.. we also have the problem in that we don't have XCode installed ( or any development stuff ) on the Mac, so I've been cross-compiling some things from my Linux machine... though currently all I've gotten is the usual "Hello World!" program done and a few SDL tests as CMake didn't seem to want to co-operate in cross-compiling Horde3D much.
The CMake setup for Mac pretty much works (although missing many features), though I think you will need to install the XCode tools (just to get the compiler). Cross compiling is a bit hairy, because Apple's GCC is very heavily patched - you pretty much have to build GCC from their sources on linux.

Quote:
But yea, congrats on getting Cocoa to play nice with Horde.. from what I've heard, it's a bit mental like WinAPI in places ( or worse, straight XLib! hehe )
In some ways it is much better (high level, well designed, etc.), unfortunately, it is also written in Objective-C, which is enough different from C++ to give some major headaches on first encounter.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 12:03 
Offline

Joined: 22.05.2008, 18:30
Posts: 37
I forgot I would be heading into uni today, so I've just tried the binary on the Mac here.

It crashes in what seems to be a rather bad way.. having had little experience with Mac development, I'm not quite sure what's wrong, but I do have a backtrace if it's of any use to you:
Code:
Date/Time:      2008-07-20 11:48:42.940 +0100
OS Version:     10.4.11 (Build 8S2167)
Report Version: 4

Command: MacIntegration
Path:    /Users/s.campbell/Desktop/MacIntegration.app/Contents/MacOS/MacIntegration
Parent:  WindowServer [66]

Version: ??? (1.0)

PID:    226
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   com.yourcompany.Horde3D           0x00210fdf EngineLog::writeDebugInfo(char const*, ...) + 21
1   com.yourcompany.Horde3D           0x00219701 setNodeTransform + 245
2   com.yourcompany.MacIntegration    0x000036c4 -[MyOpenGLView drawRect:] + 1210
3   com.apple.AppKit                  0x932f5e91 -[NSView _drawRect:clip:] + 3228
4   com.apple.AppKit                  0x932f4eeb -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 614
5   com.apple.AppKit                  0x93306e4f _recursiveDisplayInRect2 + 149
6   com.apple.CoreFoundation          0x9083eaa8 CFArrayApplyFunction + 307
7   com.apple.AppKit                  0x932f50f3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1134
8   com.apple.AppKit                  0x93306e4f _recursiveDisplayInRect2 + 149
9   com.apple.CoreFoundation          0x9083eaa8 CFArrayApplyFunction + 307
10  com.apple.AppKit                  0x932f50f3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1134
11  com.apple.AppKit                  0x932f3f53 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 217
12  com.apple.AppKit                  0x932f3658 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 290
13  com.apple.AppKit                  0x932f2e42 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 523
14  com.apple.AppKit                  0x932f276e -[NSView displayIfNeeded] + 439
15  com.apple.AppKit                  0x932f2512 -[NSWindow displayIfNeeded] + 168
16  com.apple.AppKit                  0x93297e54 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 1225
17  com.apple.AppKit                  0x9329793a -[NSWindow orderWindow:relativeTo:] + 104
18  com.apple.AppKit                  0x93370038 -[NSWindow orderFront:] + 49
19  com.apple.AppKit                  0x9326e20e -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1171
20  com.apple.AppKit                  0x93265479 loadNib + 260
21  com.apple.AppKit                  0x93264ea9 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 918
22  com.apple.AppKit                  0x93264b0a +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 164
23  com.apple.AppKit                  0x93264a4c +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 392
24  com.apple.AppKit                  0x93264794 NSApplicationMain + 433
25  com.yourcompany.MacIntegration    0x00002006 _start + 216
26  com.yourcompany.MacIntegration    0x00001f2d start + 41

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00000000  ebx: 0x00210fd3  ecx: 0x0031ae00  edx: 0x00000000
  edi: 0x00000000  esi: 0x00000000  ebp: 0xbfffec78  esp: 0xbfffec50
   ss: 0x0000001f  efl: 0x00010286  eip: 0x00210fdf   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037

Model: iMac5,1,  2 processors, Intel Core 2 Duo, 2 GHz, 1 GB
Graphics: ATI Radeon X1600, ATY,RadeonX1600, PCIe, 128 MB


Tried to remove any useless stuff, but may have removed a bit too much ( or maybe even not enough, heh) .. if you do need the rest of it, let me know and I'll post the entire backtrace :)

Course, running it from a terminal gives perhaps slightly more useful errors:
Code:
2008-07-20 11:56:02.319 MacIntegration[248] invalid pixel format attribute
2008-07-20 11:56:02.319 MacIntegration[248] invalid pixel format
2008-07-20 11:56:02.320 MacIntegration[248] invalid context
2008-07-20 11:56:02.323 MacIntegration[248] invalid pixel format attribute
2008-07-20 11:56:02.323 MacIntegration[248] invalid pixel format
2008-07-20 11:56:02.323 MacIntegration[248] invalid context
Bus error


As far as I'm aware, IT are upgrading the Macs to 10.5 sometime this week, which may help.. I may ask nicely for them to shove XCode on this one as well :mrgreen: but basically, this seems to be a clean install of Mac OS X 10.4.11 with very little actually on it.. which was generally why I was trying to cross-compile on my Linux machine so I'd be able to see if it'd work without any extra stuff that XCode may install.

I hope some of those error logs were of use to you, but I think it might just be something like it's built for 10.5 so 10.4 wont run it, or a library isn't fully up to date on this machine.


Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 15:21 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
stuckie wrote:
I hope some of those error logs were of use to you...
Thanks very much, you exposed a bug with the order of initialisation on 10.4 - the new binary should fix this: MacIntegration.app.zip

Also, if you get a chance to run it, does the knight appear transparent (i.e. can you see the ground through him)? He has been on my machine for a few days now, and I am not sure why.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 15:42 
Offline

Joined: 22.05.2008, 18:30
Posts: 37
Well, it now doesn't seem to do the Mac equiv of a segfault when double clicking the .app, however it still doesn't work, I'm afraid.

Running through the console gives some extra help to why though:
Code:
2008-07-20 15:35:02.319 MacIntegration[229] invalid pixel format attribute
2008-07-20 15:35:02.319 MacIntegration[229] invalid pixel format
2008-07-20 15:35:02.320 MacIntegration[229] invalid context
terminate called after throwing an instance of 'std::logic_error'
  what(): basic_string::_S_construct NULL not valid
Abort trap


I'm guessing that some string for checking which OS X version is installed, isn't grabbing it right - hence the NULL? Probably completely wrong, but it's atleast a string error :mrgreen:

Unfortunately, I'm about getting ready to head home for the day, so I won't be able to test anything else till tomorrow... I also don't know if IT will be upgrading this machine first thing in the morning, so I'll head in for when uni opens, so I can test a bit more for you before they do :)


Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 16:00 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
stuckie wrote:
Running through the console gives some extra help to why though:
Code:
2008-07-20 15:35:02.319 MacIntegration[229] invalid pixel format attribute
2008-07-20 15:35:02.319 MacIntegration[229] invalid pixel format
2008-07-20 15:35:02.320 MacIntegration[229] invalid context
terminate called after throwing an instance of 'std::logic_error'
  what(): basic_string::_S_construct NULL not valid
Abort trap
Any idea what hardware this is running on? I can't quite figure out why the pixel format would be unavailable.

Quote:
I'm guessing that some string for checking which OS X version is installed, isn't grabbing it right - hence the NULL? Probably completely wrong, but it's atleast a string error :mrgreen:
I am not handling C++ exceptions at the moment, so who knows where that crops up, but presumably it is due to horde being initialised without a valid OpenGL context.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 23:26 
Offline

Joined: 22.05.2008, 18:30
Posts: 37
Short of what the backtrace states that it's an Intel Core 2 Duo, with a 128mb ATI Radeon X1600, I don't know much else, I'm afraid.. if you can give me a hint of what I'm looking for and where, I'll post the information up as soon as I get in, in the morning :)

[edit]
Alright the About This Mac thing tells me:
2Ghz Intel Core 2 Duo with 1Gb Ram.
It's model identifier is iMac5,1
Amusingly, the graphics card says "ATY RadeonX1600" ... rather than ATI ;)
It's Mac OS X 10.4.11
Kernel Version is Darwin 8.11.1

If you need any more info, let me know :)
[/edit]


Top
 Profile  
Reply with quote  
PostPosted: 01.09.2013, 22:31 
Offline

Joined: 01.09.2013, 22:12
Posts: 2
Hi there,
I am trying to get started with Horde on OSX and this example of yours that you posted in the forum - well years ago. Do you happen to have the source code still? Would you mind sharing? The knight binary works fine on my machine today.

The reason I'm asking is that I am having trouble running the built in examples that come with horde. And it would help a lot to see what you did.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group