API Design

Sage
Posts: 1,066
Joined: 2004.07
Post: #1
Theoretically speaking of course, as I have no intention of trying this ever, how hard would it be to create an API for drawing? Nowadays we have Carbon, Cocoa, SDL, OpenGL, DirectX and all these other APIs for drawing stuff as well as APIs that just build on these. Is it possible to write a plain chunk of C/C++ code and change the pixels on the screen (to create a whole new API)? Just kinda wondering.
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #2
Yeah, pretty much. Problem is that on Mac OS X, you can't access the framebuffer by yourself, so you'd have to go through the OpenGL/Quartz API:s anyway, or write your own hardware drivers.
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #3
Fenris Wrote:Problem is that on Mac OS X, you can't access the framebuffer by yourself

Not even if you would write it in assembly? I know it's overkill, but I'm just wondering.

"When you dream, there are no rules..."
Quote this message in a reply
Moderator
Posts: 335
Joined: 2002.04
Post: #4
Taxxodium Wrote:Not even if you would write it in assembly? I know it's overkill, but I'm just wondering.

nope. you don't (and shouldn't) have any direct access anymore. If you did manage to find the current address of the frame buffer, it would be different on a different Mac or even on a different boot.

Remember also that the actual framebuffer is on the graphics card, not in main memory, so any access to it has to go via the card's drivers. As the drivers are written to work with OS X and OpenGL, the fastest way to access the card is via those methods, ie OpenGL under OS X.
Quote this message in a reply
Post Reply