Get rid of reinterpret_cast<>

pull/456/head
Xenkhan 7 years ago committed by GitHub
parent 24ddb66af9
commit 5a4817c147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -379,16 +379,30 @@ void OMW::Engine::createWindow(Settings::Manager& settings)
} }
setWindowIcon(); setWindowIcon();
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
int redSize;
int greenSize;
int blueSize;
int depthSize;
int stencilSize;
int doubleBuffer;
SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &redSize);
SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &greenSize);
SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &blueSize);
SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &depthSize);
SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, &stencilSize);
SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &doubleBuffer);
SDL_GetWindowPosition(mWindow, &traits->x, &traits->y); SDL_GetWindowPosition(mWindow, &traits->x, &traits->y);
SDL_GetWindowSize(mWindow, &traits->width, &traits->height); SDL_GetWindowSize(mWindow, &traits->width, &traits->height);
SDL_GL_GetAttribute(SDL_GL_RED_SIZE, reinterpret_cast<int*>(&traits->red)); traits->red = redSize;
SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, reinterpret_cast<int*>(&traits->green)); traits->green = greenSize;
SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, reinterpret_cast<int*>(&traits->blue)); traits->blue = blueSize;
SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, reinterpret_cast<int*>(&traits->depth)); traits->depth = depthSize;
SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, reinterpret_cast<int*>(&traits->stencil)); traits->stencil = stencilSize;
SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, reinterpret_cast<int*>(&traits->doubleBuffer)); traits->doubleBuffer = doubleBuffer;
traits->windowName = SDL_GetWindowTitle(mWindow); traits->windowName = SDL_GetWindowTitle(mWindow);
traits->windowDecoration = !(SDL_GetWindowFlags(mWindow)&SDL_WINDOW_BORDERLESS); traits->windowDecoration = !(SDL_GetWindowFlags(mWindow)&SDL_WINDOW_BORDERLESS);
traits->screenNum = SDL_GetWindowDisplayIndex(mWindow); traits->screenNum = SDL_GetWindowDisplayIndex(mWindow);

Loading…
Cancel
Save