Hi!
Porting my game-engine to MorphOS is going well in general. Gfx, sound, music, mouse- and keyboard-control, online-scores are working fine already, so I actually can play our games already. Took about one day to get that far

But... some questions remain. For your information: my test-system is an antique PowerMac G4 with a Radeon 9000.
1. Joystick control
Do I have to use lowlevel-lib? There is that sensor-lib that appears to be the more modern approach. But either I'm blind or there is no documentation / sample-code for this?! Any hints?
Answer: use lowlevel.library
2. TinyGL I
I have it working, but only after I added the (pretty much undocumented) function GLAReinitializeContextWindowed to my window-resize-code. Without that function call the output will become distorted when I resize the window to a certain degree (distorted means pixel-garbage at some areas plus wrong viewport position). Is that behaviour normal? Is my usage of GLAReinitializeContextWindowed correct?
Answer: sounds correct
3. TinyGL II
When the window is rather large (>= 1280 x 900 or so) things get damn slow all of a sudden. Is that a known performance limitation of my system? The max. viewport-size of a Radeon9000 should be 2048x2048 I think, so I'm still inside valid boundaries here.
4. TinyGL III
On my test-system it looks as if GL_CLAMP_TO_EDGE wasn't properly supported, it behaves like GL_CLAMP, bleeding the border-color inside. Of course this effect is most noticable with tiny textures that are mapped on large polygons. Is that a known problem? Or am I missing something?
Answer: This is a bug in the R200- and R300-drivers introduced with MorphOS 3.0. GL_CLAMP behaves like GL_CLAMP_TO_EDGE and vice versa. For now I added a tooltype to my programs so users can manually toggle the behaviour if graphics are corupt on their system. The bug will be fixed with MorphOS 3.5.
5. Screensaver
How do I disable the screensaver? In the SDK-docs the function HIDInput is mentioned. In intuition.library (?). But it's not in the headers?!
Answer: SetAttrs(screen, SA_StopBlanker, TRUE, TAG_DONE);
For games this isn't necessary though, since all kinds of user-inputs prevent the screensaver from kicking in.
6. launching the default browser with an http-URL
On AmigaOS4 this is really trivially and nicely done by simply opening a file on the device URL:
On my MorphOS setup this isn't working. Is that type of URL-opening not supported by MorphOS or is my system misconfigured or is there another way to achieve this?
Answer: use openurl.library, URL_Open
7. out of curiosity:
Is there something like AmigaOS4's compositing engine on MorphOS? To be concrete: is there an API that can draw textured, alpha-blended, filtered triangle-lists apart from TinyGL? Hardware-accelerated functions only.
Answer: apparently no triangles, but for rectangular areas BitMapScale(), BltBitMapRastPortAlpha(), BltBitMapAlphaProcessPixelArray and ProcessPixelArray are available.
8. mouse-pointer picture
The function SetWindowPointer doesn't work for me. It simply has no effect when called for my window. Isn't that syntax correct?
SetWindowPointer(window_handle,WA_PointerType,POINTERTYPE_BUSY,TAG_DONE);
Defining one initial pointer-type for the window during OpenWindow works.
Am I missing some special init-code for SetWindowPointer to work as expected?
Answer: Don't use SetWindowPointer() but SetAttrs(): SetAttrs(window, WA_PointerType, POINTERTYPE_BUSY, TAG_DONE);
9. TinyGL IV:
GLASetSync has no effect. No matter if I use a screen-context or window-context and no matter when I call GLASetSync, it has zero effect, the GL output is always
not vsynced. Is this a known limitation/bug on my Radeon9000-system? Or is there some additional setup I need to do?
As a workaround I tried WaitTOF, but this seems to misbehave just like it does on AmigaOS4/RadeonHD: it doesn't do a real vsync but just seems to wait for some 1/70 seconds or so (you can spot a nice tearing moving down the screen), not useful at all.
Answer: Window-contexts are not vsynced, only double-buffered screen-contexts, but those are synced by default. WaitTOF should never be used.
Nevertheless the problem that the screen-context was not vsynced remained.
The reason was that I accidentially called GLAReinitializeContextWindowed on the context... making it a window context again...

10. ASL screen mode requester
ASLSM_MinDepth is ignored on my system. I explicitely request screen-modes with a depth of at least 16 bits through that attribute, but the requester also shows 8 bit palette modes. System bug?
Answer: System bug. It looks like ASLSM_MinDepth only sets minimum depth to the depth slider. It does not filter any screenmodes according to MinDepth/MaxDepth setting.
11. Mouse Capture
Is there a better way to capture the mouse to stay inside the application's main window than to reposition it via DoIO? At least on my system this results in a huge performance penalty (in fullscreen mode this is not needed and therefore no issue, luckily).
Answer: Install an interrupt-handler to catch the IECLASS_RAWMOUSE events before they are delivered to the normal event-handler. Extract the x/y deltas and then set the event's coordinates to zero, which will effectively cancel any mouse-pointer movement. Check FodQuake sources, file in_morphos.c . An alternative would be to use WM_ObtainEvents and WM_ReleaseEvents.
Thanks for your help!
Daniel
-
Edited to integrate answers.