Learning Quartz API? Am I on the right track here?



Hello everyone,
I'm in the process of trying to create a tie in for Mac of a library
I've written for Windows and Linux.

The purpose of the API is pretty simple, it just wraps up the platform
specific details of instancing a window, creating an OpenGL context
and processing input.

It works like this, I have a platform generic "Window" object that
inherits from a platform specific "PlatWindow". In the constructor of
the PlatWindow are all the minutae of instancing a new window,
creating a place for OpenGL to draw, and tying in an input handler etc
and so forth.

Ideally, you should be able to create a new Window with a single line
of code
Window* GLWin = new Window(title,x,y,height,width,fullscreen,
bitdepth);
Once that has been created then you just use normal OpenGL programming
techniques to handle rendering.

Anyways in Linux it was a breeze via GLX, originally in Mac it was
pretty simple using X11-GLX, it windows it was a little more difficult
to get it going but eventually I did using wgl.

Now here's my conundrum, Yes it does "work" on a Mac using GLX, but
I'ld like to wrap agl instead of glx and at the same time wrap the
native platform widgets, this way the end user does not have to go
through all the trouble of installing glx and friends.

However, as soon as I moved over the code from glx to agl, I started
running into "warning this function is deprecated. (100s of lines of
code evidently)" Specifically I used code from the OpenGL Super
Bible, chapter 14 to show me what all needed to be where, to pull this
off. I'll admit the book is old, and reading further it looks like
the code I'm hitting up against is the platform windowing code and
associated widget stuff, i.e. things like SetRect

Looking around I found that SetRect and it's ilk are all part of an
older API called QuickDraw. And to pour salt in my wounds, the
replacement API called Quartz, is evidently so different that none of
the concepts remain the same.

So I'm asking here, #1 is it worth my time to worry about Quartz,
judging from the number of code samples I'm able to find (roughly 5
none of which deal with OpenGL), it doesn't seem like Quartz is all
that big a deal. On the other hand, it's a big enough deal that Apple
is willing to state "As of 10.4 this API is deprecated in favor of
Quartz, and QuickDraw will be removed in future releases".

When API docs fail me, I normally turn to books, I went to borders and
couldn't find a single book on Quartz, however I do have a
safari.oreilly.com subscription and was able to find this book,
http://safari.oreilly.com/0321336631
Has anyone read it? Is it any good? My major problems with books
occur when they give false and/or inaccurate information, I seem to
bump my head on that a lot, which makes learning a new API very
difficult. The other problem which is semi-related is that if the
printed code is broken, many times the code on the CD compiles and
runs just fine, but since this is safari I of course would not have a
CD to look at.

Anyways, are there any really good, really accurate books for Quartz,
and is this one of them?

Ok well I've taken plenty of your time, thanks for taking the time to
read this, if anyone could give me direction on where to start on this
path I'ld greatly appreciate it.

As a side note, I always appreciate it when library developers take
the time to use the native platform widgets, and now it's my turn to
be a library developer, I'ld like to extend the same courtesy to the
users of my library.

.



Relevant Pages

  • Re: File browser
    ... However, since the API isn't doing what I want, it was my interpretation of the other posts that it was _possible_ that the failure of the API to do what I wanted was due to the improper initialization. ... messages for a specific window handle are delivered only to the message pump running in the same thread that created the window handle. ... And Windows strictly enforces the rule about calling the window procedure; granted, the code that implements the procedure could always call it directly, but if you go through the normal PostMessage/SendMessage API that you're supposed to use, Windows will always cause the execution of the window procedure needed for handling those calls to happen on the same thread that created the window handle. ...
    (comp.lang.java.programmer)
  • Re: Error on Exit Sub
    ... this problem just came to our attention a few days ago; ... out any errors from the API call, he wasn't ready for me to start learning ... > determined you need to lock the window, you can achieve the same effect ... The control/form won't disappear, but its internal ...
    (microsoft.public.vb.general.discussion)
  • Re: Drag-and-drop from Windows Explorer?
    ... >that is not a function of delphi but of the win32 api. ... >to register the form as a window that will accept the ... >free the memory via the handle that was given you. ...
    (comp.lang.pascal.delphi.misc)
  • Re: MPEG2 Video Capture to a BMP
    ... >> We have an application that has a propriotary mpeg2 player. ... The API of the ... >video capture from web cam devices, etc. and I think I am on the right path ... >create a capture window and this happens, ...
    (microsoft.public.dotnet.framework)
  • Re: Learning Quartz API? Am I on the right track here?
    ... inherits from a platform specific "PlatWindow". ... you should be able to create a new Window with a single line ... Once that has been created then you just use normal OpenGL programming ... Quartz, and QuickDraw will be removed in future releases". ...
    (comp.sys.mac.programmer.help)

Loading