Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

getwidth and getheight ?

Recommended Posts

hi everyone , i have problems with width and height , how i do to get width and height and apply to window ?


Are you asking about the lines that you have commented out?

int width = Context::GetWidth()
int height = Context::GetHeight()


or are you asking about the System:GetProperty()?


If the former, I assume that will not work (if uncommented) due to the fact that the context is not created yet so there is nothing to get. If the latter, then look at the System:GetProperty() in the documentation. That is driven by adding properties to the application command line.

  • Upvote 1
Link to post
Share on other sites

Did you specify a command line property when you ran the application? If not, then it will not return anything. That is why 'System::GetProperty()' allows for you to set a default value in case the specified property is not found.

static std::string GetProperty(const std::string& key, const std::string defaultvalue="")



string w = System::GetProperty("screenwidth", "768");


And FYI, if you are just posting code, it would be easier if you just posted it in the forum using code tags.

  • Upvote 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...