support multisamples properly

This commit is contained in:
David Rose 2009-03-11 23:26:47 +00:00
parent 4a70282208
commit 64a8ebfb02
3 changed files with 29 additions and 29 deletions

View File

@ -47,11 +47,6 @@ get_extension_func(const char *prefix, const char *name) {
symbol = NSLookupAndBindSymbol (fullname.c_str());
}
if (osxdisplay_cat.is_debug()) {
osxdisplay_cat.debug()
<< "Looking up symbol " << fullname << "\n" ;
}
return symbol ? NSAddressOfSymbol(symbol) : NULL;
}
@ -68,7 +63,7 @@ osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
_aglPixFmt(NULL),
_aglcontext(NULL)
{
SharedBuffer = 1011;
_shared_buffer = 1011;
get_gamma_table();
}
@ -215,8 +210,13 @@ build_gl(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
attrib.push_back(fb_props.get_depth_bits());
attrib.push_back(AGL_STENCIL_SIZE);
attrib.push_back(fb_props.get_stencil_bits());
if (fb_props.get_multisamples() != 0) {
attrib.push_back(AGL_MULTISAMPLE);
attrib.push_back(AGL_SAMPLE_BUFFERS_ARB);
attrib.push_back(1);
attrib.push_back(AGL_SAMPLES_ARB);
attrib.push_back(fb_props.get_multisamples());
}
if (fb_props.is_stereo()) {
attrib.push_back(AGL_STEREO);
@ -258,18 +258,18 @@ build_gl(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
if (_aglcontext == NULL) {
osxdisplay_cat.error()
<< "osxGraphicsStateGuardian::buildG Error Getting Gl Context \n" ;
<< "osxGraphicsStateGuardian::build_gl Error Getting GL Context \n" ;
if(err == noErr) {
err = -1;
}
} else {
aglSetInteger (_aglcontext, AGL_BUFFER_NAME, &SharedBuffer);
aglSetInteger(_aglcontext, AGL_BUFFER_NAME, &_shared_buffer);
err = report_agl_error("aglSetInteger AGL_BUFFER_NAME");
}
} else {
osxdisplay_cat.error()
<< "osxGraphicsStateGuardian::buildG Error Getting Pixel Format\n" ;
<< "osxGraphicsStateGuardian::build_gl Error Getting Pixel Format\n" ;
osxdisplay_cat.error()
<< fb_props << "\n";
if(err == noErr) {

View File

@ -51,7 +51,7 @@ protected:
public:
OSStatus build_gl(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props);
AGLContext get_context(void) { return _aglcontext; };
AGLContext get_context() { return _aglcontext; };
const AGLPixelFormat get_agl_pixel_format() const { return _aglPixFmt; };
@ -71,7 +71,7 @@ private:
CGDisplayErr _cgErr;
public:
GLint SharedBuffer;
GLint _shared_buffer;
public:
static TypeHandle get_class_type() {

View File

@ -724,7 +724,7 @@ build_gl(bool full_screen) {
err = -1;
}
} else {
aglSetInteger(_holder_aglcontext, AGL_BUFFER_NAME, &osxgsg->SharedBuffer);
aglSetInteger(_holder_aglcontext, AGL_BUFFER_NAME, &osxgsg->_shared_buffer);
err = report_agl_error ("aglSetInteger AGL_BUFFER_NAME");
}
} else {
@ -1227,7 +1227,7 @@ os_open_window(WindowProperties &req_properties) {
<< "build_gl complete, set properties\n";
//
// atach the holder context to the window..
// attach the holder context to the window..
//
if (!aglSetDrawable(_holder_aglcontext, GetWindowPort(_osx_window))) {