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.
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.
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..."
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.