MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / _createRenderWindow

Method _createRenderWindow

RenderSystems/GLES2/src/OgreGLES2RenderSystem.cpp:580–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578 }
579
580 RenderWindow* GLES2RenderSystem::_createRenderWindow(const String &name, unsigned int width, unsigned int height,
581 bool fullScreen, const NameValuePairList *miscParams)
582 {
583 if (mRenderTargets.find(name) != mRenderTargets.end())
584 {
585 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
586 "Window with name '" + name + "' already exists",
587 "GLES2RenderSystem::_createRenderWindow");
588 }
589
590 // Log a message
591 StringStream ss;
592 ss << "GLES2RenderSystem::_createRenderWindow \"" << name << "\", " <<
593 width << "x" << height << " ";
594 if (fullScreen)
595 ss << "fullscreen ";
596 else
597 ss << "windowed ";
598
599 if (miscParams)
600 {
601 ss << " miscParams: ";
602 NameValuePairList::const_iterator it;
603 for (it = miscParams->begin(); it != miscParams->end(); ++it)
604 {
605 ss << it->first << "=" << it->second << " ";
606 }
607
608 LogManager::getSingleton().logMessage(ss.str());
609 }
610
611 // Create the window
612 RenderWindow* win = mGLSupport->newWindow(name, width, height, fullScreen, miscParams);
613 attachRenderTarget((Ogre::RenderTarget&) *win);
614
615 if (!mGLInitialised)
616 {
617 initialiseContext(win);
618
619 mDriverVersion = mGLSupport->getGLVersion();
620
621 if( !mDriverVersion.hasMinVersion( 3, 0 ) )
622 {
623 OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR,
624 "OpenGL ES 3.0 or greater required. Try updating your drivers.",
625 "GLES2RenderSystem::_createRenderWindow" );
626 }
627
628 assert( !mVaoManager );
629 mVaoManager = OGRE_NEW GLES2VaoManager();
630
631 //Bind the Draw ID
632 OCGE( glGenVertexArrays( 1, &mGlobalVao ) );
633 OCGE( glBindVertexArray( mGlobalVao ) );
634 static_cast<GLES2VaoManager*>( mVaoManager )->bindDrawId();
635 OCGE( glBindVertexArray( 0 ) );
636
637 // Get the shader language version

Callers 1

createWindowMethod · 0.45

Calls 15

GLES2VaoManagerClass · 0.85
checkExtensionFunction · 0.85
GLES2DepthBufferClass · 0.85
getFSAAMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
logMessageMethod · 0.45
newWindowMethod · 0.45
bindDrawIdMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected