Handmade Hero»Forums»Code
55 posts
Debug console
Have you ever implemented a debug console as in Quake, Unreal Tournament, Source games that is also compiled in the release version? Is this as simple as creating a buffer to store the input text and have a hash table that links strings to commands? How would you enable the user to copy the input text or paste something in?
Mārtiņš Možeiko
2562 posts / 2 projects
Debug console
Edited by Mārtiņš Možeiko on
Yeah, pretty much what you said. Just get the input from user, process it, and render result on screen. You have seen Casey do this many times (drawing hero, debug UI, etc..)

To implement copy & paste from clipboard there are two ways. One platform independent - just store copied text in separate array/memory block. Disadvantage is that you get copy&paste only inside your application, not to outside (OS or other apps). The other way would be to use platform specific API to access OS clipboard. On Windows that would be these functions: https://msdn.microsoft.com/en-us/...ary/windows/desktop/ms648709.aspx