_eventDispatcher = new (std::nothrow) EventDispatcher(); _eventAfterDraw = new (std::nothrow) EventCustom(EVENT_AFTER_DRAW); _eventAfterDraw->setUserData(this); _eventAfterVisit = new (std::nothrow) EventCustom(EVENT_AFTER_VISIT); _eventAfterVisit->setUserData(this); _eventAfterUpdate = new (std::nothrow) EventCustom(EVENT_AFTER_UPDATE); _eventAfterUpdate->setUserData(this); _eventProjectionChanged = new (std::nothrow) EventCustom(EVENT_PROJECTION_CHANGED); _eventProjectionChanged->setUserData(this);
initTextureCache(); void Director::initTextureCache() { #ifdef EMSCRIPTEN _textureCache = new (std::nothrow) TextureCacheEmscripten(); #else _textureCache = new (std::nothrow) TextureCache(); #endif // EMSCRIPTEN }
_modelViewMatrixStack.push(Mat4::IDENTITY);
_projectionMatrixStack.push(Mat4::IDENTITY);
_textureMatrixStack.push(Mat4::IDENTITY);
_renderer = new (std::nothrow) Renderer; Renderer::Renderer() :_lastMaterialID(0) ,_lastBatchedMeshCommand(nullptr) ,_filledVertex(0) ,_filledIndex(0) ,_numberQuads(0) ,_glViewAssigned(false) ,_isRendering(false) #if CC_ENABLE_CACHE_TEXTURE_DATA ,_cacheTextureListener(nullptr) #endif { _groupCommandManager = new (std::nothrow) GroupCommandManager(); _commandGroupStack.push(DEFAULT_RENDER_QUEUE); RenderQueue defaultRenderQueue; _renderGroups.push_back(defaultRenderQueue); _batchedCommands.reserve(BATCH_QUADCOMMAND_RESEVER_SIZE); }