Image Map Image Map
Results 1 to 4 of 4

Thread: Programming graphics on a Power Macintosh

  1. #1
    Join Date
    Dec 2012
    Location
    Orlando, FL, USA
    Posts
    180

    Default Programming graphics on a Power Macintosh

    Hi folks,

    I am playing around with Codewarrior 10 on my Power Macintosh 7300 and all is good. However now I want to do some graphics programming and I am a bit stumped.

    I assume I need to use QuickDraw for some simple 2D graphics right? Or will the Carbon API allow me to do that too? I guess I am asking for resources (online or books) that teach how to draw graphics (put_pixel and what not) on classic MacOS.

    My system is a Power Macintosh 7300 running MacOS 8.5. I am a seasoned programmer so I am not looking for basic C++ tutorials but rather how to access the graphics part of the MacOS.

    Thanks in advance!

  2. #2

    Default

    On classic Mac OS, QuickDraw is pretty much your only choice. The choice to use Carbon doesn't change this, and on 8.5 I wouldn't use Carbon unless you update to at least 8.6. There isn't much advantage to it except if you want your apps to run natively on OS X as well.

    This code snippet should give you an idea. Scroll down to the main() section and work your way back up as it initializes a graphics context and a window: https://github.com/gohai/macintosh-c...ter/BitPaint.c
    I use my C128 because I am an ornery, stubborn, retro grouch. -- Bob Masse
    Machine room: http://www.floodgap.com/etc/machines.html

  3. #3
    Join Date
    Dec 2012
    Location
    Orlando, FL, USA
    Posts
    180

    Default

    Ah thank you, that program is great. Pretty much what I was looking for. I also found some graphics tutorials on the CodeWarrior 10 reference disk. Between those I should be able to put together something.

    That being said though, I do wonder how Doom (I and II) and Quake (sw rasterizer) managed to get decent speeds. I assume they rendered to an offscreen buffer then just blitted the whole thing to the screen (similar to what the program you linked me to does). I should be able to find somewhere the Doom MacOS source code (now that I think of it).

  4. #4

    Default

    You're thinking of GWorlds for off-screen rendering. Probably your fastest means is a 256-colour-mode and heavy use of CopyBits(), which is actually a very fast software blitter. Marathon used this approach, for example.
    I use my C128 because I am an ornery, stubborn, retro grouch. -- Bob Masse
    Machine room: http://www.floodgap.com/etc/machines.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •