nightingale
Well-known member
So update, I got colour offscreens working using... GWorlds! I messed about with my code a bit more and just couldn't get it to work properly. Even setting the high bit of rowBytes didn't seem to get the desired results. So I gave up and implemented it using GWorlds, and wow, they really are simple. That was a fantastic improvement by Apple.
At this point, I'll do some testing and see if it's even worth implementing a non-GWorld solution.
Right now, my program is just checking whether the system is using original QuickDraw or Colour QuickDraw, and if it's the latter, then it assumes a colour offscreen and uses GWorld for the offscreen. This is problematic because the performance is way worse than just using a B&W GrafPort, which surprised me. My SE/30, for example, which only has 1-bit graphics uses a GWorld because it's running System 7.5.5, and the game is unplayable. I thought the under-the-hood mechanics of how it draws offscreen with GWorlds was essentially the same as creating and drawing to your own GrafPort, it was just doing all the work of setting it up for you. But perhaps it's an entirely different concept. I am limiting my GWorld to 4-bit colour depth (my colour tiles only use 16 colours) but it still seems to really bog down.
Anyway, I wanted to add a check to see whether the screen actually supports 4-bit depth, and if it doesn't, then it would just use my B&W GrafPort offscreen even if GWorlds were available. But when I try to call HasDepth(), Think C tells me it needs a prototype. Is there some library I need to add to make use of HasDepth? I can't seem to find it in any of the header files that come with Think C. I've come across a few calls that don't seem to work. I'm using Think C 5.0 -- maybe these routines were not implemented when this was released? I struggle sometimes trying to match up my development environment with documentation that was written in the same era...
Although I'm not really sure if HasDepth() is the solution I need anyway. I think I'm less interested in whether the screen supports 4-bit than I am in whether the screen is set to 4-bit colour or greater. If there are going to be performance issues on slower machines, I'd like people to be able to set the monitors control panel to B&W and get my more efficient drawing routines, but HasDepth() would still report the screen as being capable of 4-bit depth, I think.
On an interesting side note, I have been using my B&W tiles for so long, that when I started adding colour, I don't like it as much! I'll try to make the colour tiles as beautiful as I can, but I think I prefer playing in B&W...
At this point, I'll do some testing and see if it's even worth implementing a non-GWorld solution.
Right now, my program is just checking whether the system is using original QuickDraw or Colour QuickDraw, and if it's the latter, then it assumes a colour offscreen and uses GWorld for the offscreen. This is problematic because the performance is way worse than just using a B&W GrafPort, which surprised me. My SE/30, for example, which only has 1-bit graphics uses a GWorld because it's running System 7.5.5, and the game is unplayable. I thought the under-the-hood mechanics of how it draws offscreen with GWorlds was essentially the same as creating and drawing to your own GrafPort, it was just doing all the work of setting it up for you. But perhaps it's an entirely different concept. I am limiting my GWorld to 4-bit colour depth (my colour tiles only use 16 colours) but it still seems to really bog down.
Anyway, I wanted to add a check to see whether the screen actually supports 4-bit depth, and if it doesn't, then it would just use my B&W GrafPort offscreen even if GWorlds were available. But when I try to call HasDepth(), Think C tells me it needs a prototype. Is there some library I need to add to make use of HasDepth? I can't seem to find it in any of the header files that come with Think C. I've come across a few calls that don't seem to work. I'm using Think C 5.0 -- maybe these routines were not implemented when this was released? I struggle sometimes trying to match up my development environment with documentation that was written in the same era...
Although I'm not really sure if HasDepth() is the solution I need anyway. I think I'm less interested in whether the screen supports 4-bit than I am in whether the screen is set to 4-bit colour or greater. If there are going to be performance issues on slower machines, I'd like people to be able to set the monitors control panel to B&W and get my more efficient drawing routines, but HasDepth() would still report the screen as being capable of 4-bit depth, I think.
On an interesting side note, I have been using my B&W tiles for so long, that when I started adding colour, I don't like it as much! I'll try to make the colour tiles as beautiful as I can, but I think I prefer playing in B&W...