Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Activating Draw Sprocket Context  (Read 337 times)

Zingerpop

  • 4 MB
  • **
  • Posts: 4
Activating Draw Sprocket Context
« on: February 13, 2026, 10:12:31 PM »

Hey gang,

As I've been diving into the world of Power PC Macs, I decided to work on a small tanks game for Mac OS 9 using Apple's Game Sprockets library.

My issue is, I cannot figure out how to get Draw Sprocket to activate a context. I have been using Apple's Game Sprocket documentation, but it returns error code -108 each time I call DSpContext_SetState to activate the context, which is not listed in the result code section.

I do see a -108 for Sound Sprocket, which is for a memFullError. I'm hesitant to make the assumption that this is also a memFullError (could be wrong though!).

Does anyone have access to some sample code I could look at? I did try to look around a bit online, but I don't think this library was ever widely used, even at the time. In case you wanted to see what I've got I did upload it to this post as a txt file. Error is raised at line 115.

For reference, I'm using Code Warrior 5.1.1 and writing this in pure C. Draw Sprocket Lib on this system is version 1.7.8. Super appreciate any pointers! Thanks in advance.
Logged

Zingerpop

  • 4 MB
  • **
  • Posts: 4
Re: Activating Draw Sprocket Context
« Reply #1 on: February 14, 2026, 03:00:32 PM »

Ah! Did some more research and digging and found the answer. Posting this in case someone comes along after me with the same issue.

Poking through the DrawSprocket.h file, I saw it also included MacErrors.h which is probably where the -108 error code was coming from.

I see -108 in that file, and it does in fact correlate to memFullError. It also includes a helpful comment:
Code: [Select]
memFullErr = -108,   /*Not enough room in heap zone*/
I opened Code Warrior's Project Settings > Target > PPC Target and increased minimum heap size to 1024k, and preferred heap size to 2048k. Will probably need to adjust those later on since I'm not sure how much heap (or stack memory) I'm going to need.

Anyway, worked like a charm after that! Cheers!
Logged
Pages: [1]   Go Up

Recent Topics