Jump to content

  • Log In with Google      Sign In   
  • Create Account

Kurask

Member Since 11 Oct 2012
Offline Last Active Aug 29 2013 05:13 PM

Posts I've Made

In Topic: In-Game Console

14 January 2013 - 09:53 PM

Thanks for the suggestions; I ended up getting everything working. I was looking for functions that handled it altogether in case one existed. As stated earlier, the code to make one was pretty simple (I imagined it being a little more difficult than it turned out to be).


In Topic: In-Game Console

12 January 2013 - 03:05 PM

That's what I was thinking. I'd have my output go to some text file and have something constantly echo whatever is in that file onto the screen. I don't know the best way to do that though. My project is in C++ using DirectX for the  graphics. I was thinking I'd just make a textbox using CreateWindowEx that displayed all the output and I'd have another textbox slightly below that to handle the input. I'd have to figure out how to do that, but it sounds reasonable.

 

 

Using CreateWindowEx isn't going to make a console that's really usable in-game, unless you are running windowed mode. IIRC DirectX has some font rendering classes if you are using earlier versions. Check the SDK samples.

 

As for logging: echoing from a file is not the greatest idea. Buffers can take time to flush. You may not want to lock a file constantly while a program is running (and conversely lock it while reading).

 

There are a bunch of good logging frameworks out there (check this thread on stackoverflow) that let you have multiple backend emitters. I use Boost.Log (not officially part of boost) in my projects and it works great for that sort of thing.

Yeah, I can render text to the screen, I just wasn't sure if it was efficient to do so.

 

I don't know how I'd get started on binding input to the source, or even getting input to appear on the screen instead of using it to control the camera, as nife87 said above. 


In Topic: In-Game Console

12 January 2013 - 01:16 PM

For the console in a couple of my games, I simply display lines of a log (rather than using std::cout) so it can display on an Android device easily.

For writing commands, I simply send the message to all of my ingame objects in the hope that one of them intercepts the message and can react / respond to it.

But depending on what API / engine you are using, it really isn't too hard to implement bespoke rather than dragging in some other project and rigging it up.

That's what I was thinking. I'd have my output go to some text file and have something constantly echo whatever is in that file onto the screen. I don't know the best way to do that though. My project is in C++ using DirectX for the  graphics. I was thinking I'd just make a textbox using CreateWindowEx that displayed all the output and I'd have another textbox slightly below that to handle the input. I'd have to figure out how to do that, but it sounds reasonable.


In Topic: In-Game Console

12 January 2013 - 11:55 AM

 command parser 

Well, that word helped loads. Searching "console" was not helpful at all with Google, but there are many more results for that. Thanks!

 

I think the way to do it would be to have 2 text boxes (CreateWindow), one read-only and one to type in. The read only would echo whatever goes into a log file and the write one would handle the commands.


In Topic: Using D3D11_QUERY_OCCLUSION

19 October 2012 - 03:48 PM

Fair enough, I figured it wasn't that great of a way.

I'll look for another method then. In the end, I only plan on having maybe 5 different models and have them rendered thousands of times each.

PARTNERS