Lots of changes for texture-based models and lighting, also format.h for making localized strings.
Cube model now has parameters for different sizes and for the textures for it's different sides
ShaderProgram now uses text replacement to specify number of lights to be used in the shader
- This methodology will probably change a little. I'm not certain what is best to be specified as the authoritative source on number of lights in a shader. Currently hard-coded to 100.
Textured vertices now have a diffuse and specular component to them used for lighting.
PlayerView now accepts a window, rather than being created by a window. Makes a lot more sense.
All of the debug code that was in window.cpp for drawing was removed and put into PlayerView where it makes a bit more sense, and where the final code of this nature will actually go.
Window object now calls DestroyWindow in destructor so windows can destroy the window before application end.
graphicsEnginecreated within the windows message handler during WM_CREATE. Might move it to the constructor instead. Not certain which is the better location, or if there even is one.
ColorShaders aren't working at the moment, due to changes in lighting.
TextureShaders have vastly improved functionality.
- Directional lighting implemented.
- Point lighting started.
- Spot lighting is still completely MIA
- No shadows anywhere yet.
Minor optimization for ResourceCache, just calls processResource and uses the result of the call to determine if it was successful.
PlayerView's mouseClick has been split into mouseDown and mouseUp.
PlayerView is nolonger virtual. It provides the default player UI and simply changes it's state as needed to handle a menu, game rendering, etc...
A little more information added to global.h, to indicate what those variables are for and that they MUST be declared and initialized before the rest of NaturalFury can be used.
GraphicsEngine::MakeShaderFromFile has been useless for a while, removed it.
Moved glClearColor and glClearDepth calls to the GraphicsEngine constructor and out of clearScreen. This only needs to be done once during initialization, the remaining calls were redundant.
All of the code for getting light block offsets.
setPOV removed, doesn't do anything anymore. See setWorldToCamera
prepProgram removed.
drawCylinder now throws exception, since it's broken.
freeTextureFromArray nolonger requires graphics engine to be claimed and can thus be called from other threads.
BindTextureArray now usable multiple times, each time will re-upload new texture data.
loadRawToTextureArray now takes a pointer to textureData and will copy that data to the textureArray.
loadPNGToTextureArray will load a PNG from the resourceCache, convert it to raw texture data, and send it to loadRawToTextureArray.
textToScreen now throws an exception, as it needs to be reimplemented.
PlayerView's KeyDown events re-written since it is now the proper source for tracking all of the camera information rather than the gameWindow.
GameEngine is now functionally a 'startable' thread. After construction, simply call start() and it'll create a thread and run the game at 60 ticks/second (not that it does anything atm).
Most of the game logic has been moved out of the main function. It makes a window (so that it owns it), than it creates an InterfaceThread. That thread handles creation of all of the other elements.
The only other thing that the main thread at that point does is run the message loop, which is can now do with GetMessage instead of PeekMessage, meaning the main thread is actually able to sit idle when there aren't messages to be processed.
GameEngine constructor rearranged a bit.
UserInterface specifies details for any class that is to receive input from a window and present data to a use.
InterfaceThread serves as the base for most of the application.
- Runs in it's own thread.
- It currently creates a gameEngine, starts it(which creates another thread), and then creates a PlayerView and runs that view in it's thread.
Lots of commenting where I'd gotten a bit behind on this.
The following classes are nolonger copy constructable/assignable:
- Scene
- GraphicsEngineTexture
- CubeModel
Format.h
- Provides function for text formatting. I was originally going to use this to parameterize shaders, but ultimately opted against it due to needs to the cumbersome syntax it would add to shaders.
- All of the logging that was being done with inflexible use of stringstreams have been converted over to use these functions.
Log format changed a little bit. Timestamp, sourcefil, etc... are all on the first line and the message itself is now placed on a separate line.