Hello I have something weird with my code.
I just code something like this for test:
void test()
{
Urho3D::Engine *engine = new Urho3D::Engine(g_pEngineContext);
Urho3D::VariantMap engineParameters;
engineParameters["FrameLimiter"] = false;
engineParameters["WindowTitle"] = "Engine";
engineParameters["LogName"] = "Engine.log";
engineParameters["FullScreen"] = false;
engineParameters["ExternalWindow"] = 0;
if (!engine->Initialize(engineParameters)) return;
Urho3D::Texture2D *tex = new Urho3D::Texture2D(g_pEngineContext);
tex->SetSize(2, 2, Urho3D::Graphics::GetRGBAFormat());
};
int main(int argc, char* argv[])
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
g_pEngineContext = new Urho3D::Context();
test();
return 0;
};
My code crashing in line: “tex->SetSize(2, 2, Urho3D::Graphics::GetRGBAFormat());”
I just debug what exacly crashing, and here you go:
“Texture2D::Create() pointer is NULL. Why?”