Jump to content

[Beta Branch][C++] Crashing when doing GetTextWidth


Crazycarpet
 Share

Recommended Posts

In my C++ project the following crashing on the 'GetTextWidth' line, during the following code in my App.lua after updating my project:

 

//Create a context.
context = Context::Create(window);
System::Print("TESTING"); //Makes it here, then crashes.
//context->SetFont(Font::Load("Fonts/Arial.ttf", 36)); //When uncommented, makes it here, then crashes.
System::Print("Size: " + to_string(context->GetFont()->GetTextWidth("gfdgdgfdgfd")));
System::Print("Made it here!");
System::SetProperty(PROPERTY_MOUSESENSITIVITY, mousesensitivity);

 

I'm wondering if anyone else is having issues with GetTextWidth (In C++ only, works in Lua for me...) or if this is just a me thing. I added that test code because BEFORE I added it GetTextWidth was crashing elsewhere in my project.

I find it very weird that this only crashes the app when called in C++.

  • Upvote 1
Link to comment
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.

Guest
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.

 Share

×
×
  • Create New...