TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.09k stars 222 forks source link

Error right out of the box InputManager::ClearKeys() #146

Open LedLoaf opened 2 years ago

LedLoaf commented 2 years ago

Hello,

I'm just trying to get this to run so I could check it out more and see if I really want to follow all these videos to get to this point. Besides missing some references it ran pretty quickly.

At line 36 Exception Thrown: write access violation of Input.cpp.

m_KeyState[i] = false; <Unable to read memory>

Checking the callstack before this error it has

void FocusCallback(Window* window, bool focused)in Win32Window.cpp Line 150 m_windows->m_InputManager->ClearMouseButtons();

Any help would be appreciated.

EDIT: Also in the constructor I see this commented out.

        // m_KeyState = spnew bool[MAX_KEYS];
        // m_LastKeyState = spnew bool[MAX_KEYS];
LedLoaf commented 2 years ago

Nobody is able to help me out?

C0D3D3V commented 2 years ago

Without looking at the latest master code, I would like to point out that the original Youtube series has ended in the development branch. Maybe you test that branch first. After ep. 26 the series has taken a new path if I remember correctly. https://github.com/TheCherno/Sparky/tree/development

LedLoaf commented 2 years ago

Thanks man, much appreciated I'll check that out.

cprn commented 1 year ago

You can compile master branch out of the box, just need to ignore SandboxCS and SparkyCLI projects (I think in VCS it's "unload") because they're broken but also unnecessary if you don't plan to code in C#. Compiling Sandbox alone should be enough to run the default test scene. You have different test scenes commented out in https://github.com/TheCherno/Sparky/blob/master/Sandbox/src/Sandbox.cpp#L31 - you can uncomment whichever and recompile.

pengyz commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。