Implicit Window::MakeReady on context set.

This commit is contained in:
Ben Vanik 2015-09-07 09:29:07 -07:00
parent ec7c74d04c
commit fa9c681c7c
3 changed files with 8 additions and 9 deletions

View File

@ -43,7 +43,6 @@ bool MainWindow::Initialize() {
} }
window_->Initialize(); window_->Initialize();
window_->set_context(xe::ui::gl::GLContext::Create(window_.get())); window_->set_context(xe::ui::gl::GLContext::Create(window_.get()));
window_->MakeReady();
#if XE_PLATFORM_WIN32 #if XE_PLATFORM_WIN32
el::io::FileManager::RegisterFileSystem( el::io::FileManager::RegisterFileSystem(

View File

@ -154,13 +154,9 @@ X_STATUS Emulator::Setup(ui::Window* display_window) {
// Finish initializing the display. // Finish initializing the display.
display_window_->loop()->PostSynchronous([this]() { display_window_->loop()->PostSynchronous([this]() {
{
xe::ui::GraphicsContextLock context_lock(display_window_->context()); xe::ui::GraphicsContextLock context_lock(display_window_->context());
auto profiler_display = auto profiler_display = display_window_->context()->CreateProfilerDisplay();
display_window_->context()->CreateProfilerDisplay();
Profiler::set_display(std::move(profiler_display)); Profiler::set_display(std::move(profiler_display));
}
display_window_->MakeReady();
}); });
return result; return result;

View File

@ -75,8 +75,10 @@ class Window {
virtual bool Initialize() { return true; } virtual bool Initialize() { return true; }
void set_context(std::unique_ptr<GraphicsContext> context) { void set_context(std::unique_ptr<GraphicsContext> context) {
context_ = std::move(context); context_ = std::move(context);
if (context_) {
MakeReady();
}
} }
virtual bool MakeReady();
bool LoadLanguage(std::string filename); bool LoadLanguage(std::string filename);
bool LoadSkin(std::string filename); bool LoadSkin(std::string filename);
@ -116,6 +118,8 @@ class Window {
protected: protected:
Window(Loop* loop, const std::wstring& title); Window(Loop* loop, const std::wstring& title);
virtual bool MakeReady();
virtual bool InitializeElemental(Loop* loop, virtual bool InitializeElemental(Loop* loop,
el::graphics::Renderer* renderer); el::graphics::Renderer* renderer);