ko4life-net / ko

Open source development of the game Knight Online. This is a reversed engineered old version of the game aiming to replicate the nostalgic experience we all once had <3
https://github.com/ko4life-net/ko
MIT License
55 stars 22 forks source link

Implement ImGui window rendering for debugging. #168

Closed stevewgr closed 2 years ago

stevewgr commented 2 years ago

Description

Resolves https://github.com/ko4life-net/ko/issues/112

This PR integrates and implements ImGui for better debugging experience.

I also implemented couple of nice features to the custom window, such as graph for FPS, as well as controling the view distance. Note that this also gets ride of the annoying debug white text on the left top corner.

Special thanks to @ko4life-psko for suggesting to use it and for answering all my questions :D🕺

Note that the ko-vendor PR needs to be merged first before triggering test build: https://github.com/ko4life-net/ko-vendor/pull/10

Some pictures: image

image

image

stevewgr commented 2 years ago

@ko4life-psko, I'm getting a weird crash when docking one window into another in split view. Steps to reproduce:

  1. Drag window into another docking to the top side, so that you get split view.
  2. Drag outside one of the windows and you'll get a crash.

If you could help me trouble shoot this, that would be great. Thank you!

I thought it's a bug with ImGui docking branch, but I tried the official examples and I can't reproduce it there.

stevewgr commented 2 years ago

Hi @stevewgr, I was able to reproduce the mentioned issue, however I didn't have much time to check what was causing it. While doing it I also noticed a few more things in case you want to apply the feedback.

It could be a bug with this specific ImGui revision, I'm not sure however. I suggest checking older versions of ImGui just in case. If that doesn't help, try making a small project where you are able to reproduce the same issue, that way it will help you either find the issue or have a nice PoC to report in ImGui's official repository.

Thank you, @ko4life-psko! I think I fixed it thanks to one of your comments. Please check this: https://github.com/ko4life-net/ko/pull/168#discussion_r1014912020

ko4life-psko commented 2 years ago

@stevewgr, I just pulled your new changes and tried to reproduce. Looks like you fixed the issue 🎉 This PR LGTM 🚀

stevewgr commented 2 years ago

@stevewgr, I just pulled your new changes and tried to reproduce. Looks like you fixed the issue 🎉 This PR LGTM 🚀

Well, it was thanks to you xD I was breaking my head on this one. Success at its finest :D image

stevewgr commented 2 years ago

Build passing: https://github.com/ko4life-net/ko/actions/runs/3406489311/jobs/5665210180

Merging.