The last week.

Most of my time this week have been reading the SDL documentary about the functions that I can use as well as drawing a simple flowchart so I have some overview of the work to be done the (then) coming weeks.

I used up several hours trying to get SDL_AddTimer to work as intended, for some reason, using ”event.user.code = 1” didn’t work as intended, moving the mouse in the screen would trigger the timer (several times a second) for some unexplainable reason, I used the user code 100 instead, which haven’t caused any conflicts, yet.

I also tried to filter out mouse movement entirely with ”SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE)”, but it would trigger event.user.code = 1 regardless (why is this? I don’t know…).

I intended to use the timer first-hand to restrict the amount of rendering to match the framerate. It has been documented that the timer might be unreliable and slow the application down greatly. Currently, it is only to force a ”loading time”, I will see what i’ll do with it later.

Many of the functions and members in Engine have been moved to static functions/members in State.h/cpp instead, those of the variables and functions that is used solely in States, like UpdateDeltaTime() and UpdateEvents(), as well as Keyboard and Mouse.

Initializing is done in LoadingState now (referencing the managers to be initialized) and a QuitState to-be-made that work as Cleanup(). If LoadingState fail to load properly it will switch to QuitState and log the error message (at least that is what I intend).

Lämna en kommentar