Commit 09e767a9 authored by teella's avatar teella

anti alias added for OSX and GL_LINE_SMOOTH enabled if antiAlias true

How ever createDevice does not pass any AntiAlias option so default is always false


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1282 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 5bdb986e
...@@ -308,6 +308,10 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize, ...@@ -308,6 +308,10 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize,
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
glFrontFace( GL_CW ); glFrontFace( GL_CW );
// currently disabled, because often in software, and thus very slow // currently disabled, because often in software, and thus very slow
if (AntiAlias) {
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glEnable(GL_LINE_SMOOTH);
}
// glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST); // glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
// glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST); // glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST);
// glEnable(GL_POINT_SMOOTH); // glEnable(GL_POINT_SMOOTH);
......
...@@ -190,7 +190,7 @@ namespace irr ...@@ -190,7 +190,7 @@ namespace irr
core::rect<s32> ReferenceRect; core::rect<s32> ReferenceRect;
}; };
bool createWindow(const irr::core::dimension2d<irr::s32>& windowSize, irr::u32 bits, bool fullscreen, bool vsync, bool stencilBuffer); bool createWindow(const irr::core::dimension2d<irr::s32>& windowSize, irr::u32 bits, bool fullscreen, bool vsync, bool stencilBuffer, bool antiAlias);
void initKeycodes(); void initKeycodes();
void storeMouseLocation(); void storeMouseLocation();
void postMouseEvent(void *event,irr::SEvent &ievent); void postMouseEvent(void *event,irr::SEvent &ievent);
......
...@@ -104,7 +104,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(video::E_DRIVER_TYPE driverType, ...@@ -104,7 +104,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(video::E_DRIVER_TYPE driverType,
os::Printer::log(name.version,ELL_INFORMATION); os::Printer::log(name.version,ELL_INFORMATION);
initKeycodes(); initKeycodes();
if (driverType != video::EDT_NULL) createWindow(windowSize,bits,fullscreen,vsync,stencilbuffer); if (driverType != video::EDT_NULL) createWindow(windowSize,bits,fullscreen,vsync,stencilbuffer, antiAlias);
CursorControl = new CCursorControl(windowSize, this); CursorControl = new CCursorControl(windowSize, this);
createDriver(driverType,windowSize,bits,fullscreen,stencilbuffer,vsync,antiAlias); createDriver(driverType,windowSize,bits,fullscreen,stencilbuffer,vsync,antiAlias);
createGUIAndScene(); createGUIAndScene();
...@@ -147,7 +147,7 @@ void CIrrDeviceMacOSX::closeDevice() ...@@ -147,7 +147,7 @@ void CIrrDeviceMacOSX::closeDevice()
_cglcontext = NULL; _cglcontext = NULL;
} }
bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& windowSize, irr::u32 bits, bool fullscreen, bool vsync, bool stencilBuffer) bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& windowSize, irr::u32 bits, bool fullscreen, bool vsync, bool stencilBuffer, bool antiAlias)
{ {
int index; int index;
CGDisplayErr error; CGDisplayErr error;
...@@ -182,6 +182,13 @@ bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& wind ...@@ -182,6 +182,13 @@ bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& wind
windowattribs[index++] = NSOpenGLPFAColorSize; windowattribs[index++] = NSOpenGLPFAColorSize;
windowattribs[index++] = (NSOpenGLPixelFormatAttribute)bits; windowattribs[index++] = (NSOpenGLPixelFormatAttribute)bits;
if (antiAlias) {
windowattribs[index++] = NSOpenGLPFASampleBuffers;
windowattribs[index++] = (NSOpenGLPixelFormatAttribute)1;
windowattribs[index++] = NSOpenGLPFASamples;
windowattribs[index++] = (NSOpenGLPixelFormatAttribute)2;
}
if (stencilBuffer) if (stencilBuffer)
{ {
windowattribs[index++] = NSOpenGLPFAStencilSize; windowattribs[index++] = NSOpenGLPFAStencilSize;
...@@ -239,6 +246,13 @@ bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& wind ...@@ -239,6 +246,13 @@ bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& wind
fullattribs[index++] = kCGLPFAColorSize; fullattribs[index++] = kCGLPFAColorSize;
fullattribs[index++] = (CGLPixelFormatAttribute)bits; fullattribs[index++] = (CGLPixelFormatAttribute)bits;
if (antiAlias) {
fullattribs[index++] = kCGLPFASampleBuffers;
fullattribs[index++] = (CGLPixelFormatAttribute)1;
fullattribs[index++] = kCGLPFASamples;
fullattribs[index++] = (CGLPixelFormatAttribute)2;
}
if (stencilBuffer) if (stencilBuffer)
{ {
fullattribs[index++] = kCGLPFAStencilSize; fullattribs[index++] = kCGLPFAStencilSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment