Jump to content

Context::GetWidth & Context::GetHeight no longer return valid info


martyj
 Share

Recommended Posts

In the latest Leadwerks beta branch the Context::GetWidth and Context::GetHeight no longer return values that are expected.

 

I get 0 as the width for my context and something like 190k as the height.

 

The code:

HWND desktop = GetDesktopWindow();
RECT size;
GetWindowRect(desktop, &size);

this->windowWidth = WFConfig::GetConfig()->GetIntValue("screen_width", size.right * 0.95);
this->windowHeight = WFConfig::GetConfig()->GetIntValue("screen_height", size.bottom * 0.95); // TODO: Check default size
this->windowMode = Window::Titlebar;

this->window = Leadwerks::Window::Create("World Factions - Pre Alpha", 0, 0, this->windowWidth, this->windowHeight);
this->context = Context::Create(window);
int width = context->GetWidth();
int height = context->GetHeight();

 

I also noticed that when you call Context::GetWindow() after creating it, it returns NULL.

this->context = Context::Create(window);
Window* contextWindow = this->context->GetWindow();
if (this->window != contextWindow)
{
 System::Print("**** hit the fan");
}

  • Upvote 2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...