Llamaiyama

Member
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

133 Neutral

About Llamaiyama

  • Rank
    Newbie
  1. including namespace(s)

    In C++ you can also have namespace aliases if you aren't wanting to type really long namespaces.   namespace xyz = Some::Really::Long::Namespace; xyz::Foo();
  2. In-Game Console

        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.    This depends on how you're handling input. If you are directly testing for input in functions to move camera and such you'll need to check if the console is open or not when making those calculations.    Rendering text to the screen, like pretty much everything else in programming, can be efficient or not depending on how it's done. Earlier versions of D3D have ID3DXFont which may simplify this. Newer versions don't come with D3DX, so you'll either need to write your own font renderer, use someone else's, or use DirectWrite.
  3. Actually, the contiguous requirement was added in C++03.   Oops you're right. I guess I mixed up 11 and 03 in my head :)
  4.   A vector is not required to be contiguous pre C++11, although the standard implicitly ensures that it's contiguous in order meet performance requirements.   In C++11 it is explicitly required to be contiguous:   (From draft standard, but it's essentially the same in the finalized version, emphasis added)   In reality, I know of no implementation that doesn't store elements in a contiguous manner. Also, there isn't a guarantee that a vector will grow exponentially, but all implementations I know of do this to meet the requirement of amortized constant insertion. The amount of growth, however, is dependent on the particular implementation.
  5. In-Game Console

    [quote name='Kurask' timestamp='1358018205' post='5020803'] 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. [/quote]   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.