Re: writing a new GUI environment
Re: writing a new GUI environment
- Subject: Re: writing a new GUI environment
- From: Shawn Erickson <email@hidden>
- Date: Wed, 4 May 2005 14:28:23 -0700
On May 4, 2005, at 1:59 PM, Erich Ocean wrote:
On May 4, 2005, at 1:46 PM, Shawn Erickson wrote:
On May 4, 2005, at 1:36 PM, Erich Ocean wrote:
Mac OS X supports three (or perhaps four or five) distinct GUI
enviroments: Carbon, Cocoa, Java, and perhaps QuickTime and OpenGL.
OpenGL => NSGL, AGL, CGL or GLUT (<http://developer.apple.com/qa/
qa2001/qa1269.html>)
CGL looks like it *should* be low-level, but in fact, it's only
accessible via Carbon or Cocoa:
No you can use it without linking against Carbon or Cocoa, just link
against the OpenGL.framework.
#include <OpenGL/OpenGL.h>
int main (int argc, const char * argv[]) {
long value;
long renders;
CGLRendererInfoObj renderInfo;
CGLQueryRendererInfo(1, &renderInfo, &renders);
if (renders != 0)
{
printf("Render Info:\n\tnumberOfRenders = %ld\n", renders);
int i;
for (i = 0; i < renders; i++)
{
CGLDescribeRenderer(renderInfo, i, kCGLRPRendererID,
&value);
printf("\tRender 0xx [%d] :\n", value, i);
CGLDescribeRenderer(renderInfo, i, kCGLRPAccelerated,
&value);
printf("\t\tkCGLRPAccelerated = %d\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPFullScreen,
&value);
printf("\t\tkCGLRPFullScreen = %d\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPWindow, &value);
printf("\t\tkCGLRPWindow = %d\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPBufferModes,
&value);
printf("\t\tkCGLRPBufferModes = 0xx\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPColorModes,
&value);
printf("\t\tkCGLRPColorModes = 0xx\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPDepthModes,
&value);
printf("\t\tkCGLRPDepthModes = 0xx\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPAccumModes,
&value);
printf("\t\tkCGLRPAccumModes = 0xx\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPStencilModes,
&value);
printf("\t\tkCGLRPStencilModes = 0xx\n", value);
CGLDescribeRenderer(renderInfo, i,
kCGLRPMaxSampleBuffers, &value);
printf("\t\tkCGLRPMaxSampleBuffers = %d\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPMaxSamples,
&value);
printf("\t\tkCGLRPMaxSamples = %d\n", value);
CGLDescribeRenderer(renderInfo, i, kCGLRPVideoMemory,
&value);
printf("\t\tkCGLRPVideoMemory = %d [%.2f MB]\n", value,
value / (1024.0 * 1024.0));
CGLDescribeRenderer(renderInfo, i, kCGLRPTextureMemory,
&value);
printf("\t\tkCGLRPTextureMemory = %d [%.2f MB]\n",
value, value / (1024.0 * 1024.0));
}
CGLDestroyRendererInfo(renderInfo);
}
return 0;
}
[Session started at 2005-05-04 14:23:35 -0700.]
Render Info:
numberOfRenders = 3
Render 0x00022404 [0] :
kCGLRPAccelerated = 1
kCGLRPFullScreen = 1
kCGLRPWindow = 1
kCGLRPBufferModes = 0x0000000f
kCGLRPColorModes = 0x00008400
kCGLRPDepthModes = 0x00000c01
kCGLRPAccumModes = 0x00808000
kCGLRPStencilModes = 0x00000080
kCGLRPMaxSampleBuffers = 1
kCGLRPMaxSamples = 4
kCGLRPVideoMemory = 268435456 [256.00 MB]
kCGLRPTextureMemory = 242024448 [230.81 MB]
Render 0x00020200 [1] :
kCGLRPAccelerated = 0
kCGLRPFullScreen = 0
kCGLRPWindow = 1
kCGLRPBufferModes = 0x0000000d
kCGLRPColorModes = 0x0000ca00
kCGLRPDepthModes = 0x00001401
kCGLRPAccumModes = 0x00c0c000
kCGLRPStencilModes = 0x00000081
kCGLRPMaxSampleBuffers = 0
kCGLRPMaxSamples = 0
kCGLRPVideoMemory = 0 [0.00 MB]
kCGLRPTextureMemory = 0 [0.00 MB]
Render 0x00020400 [2] :
kCGLRPAccelerated = 0
kCGLRPFullScreen = 0
kCGLRPWindow = 1
kCGLRPBufferModes = 0x0000000d
kCGLRPColorModes = 0x0c0fc000
kCGLRPDepthModes = 0x00001000
kCGLRPAccumModes = 0x08808000
kCGLRPStencilModes = 0x00000081
kCGLRPMaxSampleBuffers = 1
kCGLRPMaxSamples = 16
kCGLRPVideoMemory = 0 [0.00 MB]
kCGLRPTextureMemory = 0 [0.00 MB]
CGLTest has exited with status 0.
If you want to take over the whole the screen then you could just
use OpenGL (CGL) and Quartz and do all your own drawing.
I'd like to use CGL *without* Carbon or Cocoa; I'm perfectly happy
doing my own window management, so the full-screen thing would
work. (It would be *nice* to be a full citizen in Mac OS X, but
since this is for educational purposes, I can live with that.)
You would use Quartz Services to understand, managed, and capture
displays.
<http://developer.apple.com/documentation/GraphicsImaging/Reference/
Quartz_Services_Ref>
What I'm concerned about is receiving keyboard and mouse events
without having Carbon or Cocoa linked in. I'm getting the
impression that that isn't possible.
Getting events would be interesting but you can likely do it without
using Carbon or Cocoa, etc. but it would take work. Not sure myself
how you would do it but interfacing with HID down closer to IOKit may
do it.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden