NEWS: Check out the new devlogs!

FNAF-FOR-FREE (Temp) Devlog 2

Okay, so these next few devlogs are going to be written in past tense, since I'm actually way farther in development then when I started writing the last one.

SO, to catch up a bit, after lots of reading into the awesome and amazing SDL 3 WIKI I figured out how SDL worked a bit, and got texture rendering working. Next I needed a camera system in order to get movement functionally working. I had the thought of using viewports as a way of doing that, since they seemed to solve the problem I was trying to figure out!!!

Then I tried it out and learned that they only render what's in the initial render context... so changing their position ends up not rendering things outside of it. Then I looked the the examples and realized I'm stupid and viewports are mainly meant for copying render contexts to other position on the screen thus only needing to render something complicated once..........

Anyway, I actually thought about the problem for 2 seconds instead of going to the api, and realized a simple camera in 2D space is actually just an offset for the objects being rendered. Plus, rendering outside of the render context doesn't actually render to the screen with SDL I think, so this might be better or something.

Okay, so once I had that in hand, I was able to move the screen around!

Yeah.

Welll.....

Then I had to face an even greater challange.... One I didn't think would be too hard...

INPUT

Okay, so long story short, you have to kinda do the polling for SDL yourself. I'm using callbacks, so a basic structure for this was already set up for me, but I still had to do the hard part which is taking the information provided by the OS through SDL's api, and turning it into something useful.

SDL gives you some basic state info so you can write your own input checks such as if the key was repeated, or if the key is currently down. Using this actually isn't too bad, but I'm bad at programming.

And with that done, I finally had something that I would consider decent for the moment. Then doing some quick and dirt mouse polling, I could get the mouse position as well, and I set up some collision detection for the sides of the screen the mouse could interact with, and presto, I had movement!!! :DDDDDD

qownnotes-media-gsILwt

So, that basically was it for that session. and I moved onto... the