You are browsing as a guest. Sign up (or log in) to start making projects!

DesktopPet

  • 4 Devlogs
  • 8 Total hours

A Pet companion that stays on your screen and follows your cursor, made using SDL3 and C++

Open comments for this post

1h 34m 35s logged

So I don’t know if I’ll continue this project (Or HOW to continue it even).
I’ve done a lot of research and tried various “fixes” but I just can’t get Wayland to give me global screen coordinates. I COULD use Hyprctl, but that would only make the project work on Hyprland, and I don’t really want something that works for a teeny tiny minority of people. I DID try to use X11’s compatibility layer but still couldn’t get it to give me coordinates. I REALLY want to finish this project so I would REALLY appreciate it so much if someone maybe dropped an Idea or two in the comments.
If push comes to shove I guess I’ll have to make it hyprland only first, and maybe later add compatibility for various other Wayland WM’s…

0
0
3
Open comments for this post

1h 42m 22s logged

So I optimized the program a LOT, I basically just capped the frame to 60FPS so now it doesn’t lag anymore. But obviously I just can’t seem to get a break cause now that it doesn’t lag I can see that the path finding is clearly broken, and it still only works when the mouse is on top of the window, and printing the mouse position clearly shows that the Global positions aren’t being updated when outside of the window…
But let’s talk about more positive things: I at least fixed Wayland compatibility (kinda… in a very junky way), I basically just used an SDL function to see what the OS being used is, and if it’s Linux you just fall back to X11. Yes, I know, as I already said, very junky, but there really isn’t much i can do, as I said in the devlog before this one: Wayland just doesn’t give it’s programs access to global coordinates :(.
A solution I tought about was to add a transparent background and put the pet window on top but that would just be even jankier then the solution that I’ve implemented now, so I’ll just make sure that the instructions tell Wayland users to have an x11 compatibility layer installed.
Ok, that’s it for this devlog’s yapping: See yall in the next one, where hopefully I’ll talk about how I was able to finally fix the path finding (Fingers crossed!!!)

2
0
75
Open comments for this post

3h 10m 18s logged

Ok, so BIG news: After a lot of debugging I remembered that I’m actually GOATED, so my code couldn’t POSSIBLY be wrong, so I tried to look online for people experiencing problems with SDL3 using Wayland and I actually found out Wayland doesn’t give access to global screen coordinates to programs (And my pathfinsing uses Global coordinates), so I tried running it using an X11 compatibility layer, AND IT WORKED!!! Kind of…
So basically, it DOES work, but it’s extremely laggy, and I’m trying to figure out if it’s the compatibility layer or just my code (Probably both), so for the next devlog I’ll have to set an FPS cap so that the pathfinding lags less maybe?. And if that doesn’t fix it then I’ll have to reprogram everything to work natively with Wayland (or try to find a way to make the compatibility layer lag less). It’d be cool to find a way to give the program access to global screen coordinates though, since that would make my life a lot easier, and I wouldn’t have to use a compatibility layer.
That’s it for this Devlog, see ya in the next one!

2
0
31
Open comments for this post

1h 8m 25s logged

So I finally got the window to actually be shown, I basically just had to render something in the window, since Hyprland (and I think Wayland in general) doesn’t accept NULL windows. Next I’ll probably make the window follow the cursor and then I can add custom sprites/animations. For example: If you click on the pet you’ll get some hearts out or something along those lines. Well we’ll just have to wait and see what this project becomes!

0
0
27

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…