void TSRD3D11GraphicsSubSystem::ShutDownGraphics() { SAFE_DELETE( GraphicsFactory() ); SAFE_RELEASE( m_pCpuBackBufferCopy ); SAFE_RELEASE( m_pColorBufferView ); SAFE_RELEASE( m_pDepthStencil ); SAFE_RELEASE( m_pDepthStencilView ); SAFE_RELEASE( m_pQueryIdleGPU ); #ifdef D3D11_RENDERER SAFE_RELEASE( m_pD3DDeviceContext ); #endif SAFE_RELEASE( m_pD3DDevice ); }
TSRD3D11GraphicsSubSystem::TSRD3D11GraphicsSubSystem() { m_pD3DDevice = 0; m_pColorBufferView = 0; m_pDepthStencil = 0; m_pDepthStencilView = 0; m_pActiveColorBufferViews[ 0 ] = 0; m_pActiveColorBufferViews[ 1 ] = 0; m_pActiveColorBufferViews[ 2 ] = 0; m_pActiveColorBufferViews[ 3 ] = 0; m_pActiveDepthStencilView = 0; GraphicsFactory() = new TSRD3D11Factory(); }
Graphics * GraphicsFactory::extractGraphicsFromOneLine(std::string & contents, int & level) { std::size_t pos = contents.find_first_not_of(space); level = pos/2; Graphics * gr =0; std::size_t found = contents.find("Comp ", pos); if (found==pos) gr = new CompositeGraphics; found = contents.find("C(", pos); if (found==pos) { std::string s(contents.substr(pos+2)); std::stringstream ifs(s); GraphicsFactory(); int cx, cy, r; char c; // cx , cy , r ) ifs >> cx >> c >> cy >> c >> r >> c; gr = new SimpleGraphics(new Circle(cx,cy,r)); }
// this will Initialize OpenGL ES 2 void TSRGLES2GraphicsSubSystem::InitGraphics( TSRScreenMode& _screenMode ) { m_iDefaultFramebuffer = -1; GraphicsFactory() = new TSRGLES2GraphicsFactory(); TSRPrintln( "GLES2 SubSystem successfully Initialized" ); glEnable( GL_CULL_FACE ); printGLString( "Version", GL_VERSION ); printGLString( "Vendor", GL_VENDOR ); // printGLString( "Renderer", GL_RENDERER ); // printGLString( "Extensions", GL_EXTENSIONS ); Resize( _screenMode.m_uiWidth, _screenMode.m_uiHeight ); int uiSupportedCompressedTextureFormatsCount = 0; glGetIntegerv( GL_NUM_COMPRESSED_TEXTURE_FORMATS, &uiSupportedCompressedTextureFormatsCount ); //TSRPrintln( "Number of compressed formats supported: %d ", uiSupportedCompressedTextureFormatsCount ); int supprtedFormats[ 1024 ]; glGetIntegerv( GL_COMPRESSED_TEXTURE_FORMATS, supprtedFormats ); for ( int i = 0; i < uiSupportedCompressedTextureFormatsCount; i++ ) { m_SupportedCompressedTextureFormats.push_back( supprtedFormats[ i ] ); //TSRPrintln( "Compressed format: %x ", supprtedFormats[ i ] ); } GLint iDefaultFramebuffer = 0; /// get the default frame buffer glGetIntegerv( GL_FRAMEBUFFER_BINDING, &iDefaultFramebuffer ); iDefaultFramebuffer++; }
void TSRGLES2GraphicsSubSystem::ShutDownGraphics() { SAFE_DELETE( GraphicsFactory() ); TSRPrintln( "GLES2 SubSystem successfully ShutDown" ); }