Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "config.h"
#include "Core/Headers/Application.h"

#ifdef main
#undef main
#endif 

I32 main(I32 argc, char **argv){

	freopen(OUTPUT_LOG_FILE, "w", stdout);
	freopen(ERROR_LOG_FILE, "w", stderr);
	///Initialize our application based on XML configuration
	Application::getInstance().Initialize("main.xml");  
	///When the main loop returns, destroy the application
	Application::getInstance().run();
	///Stop our application
	Application::getInstance().Deinitialize();  
	///When the application is deleted, the last kernel used gets deleted as well
	Application::getInstance().DestroyInstance();  
	PRINT_FN("Application shutdown successfull!");
	return 0;
}

Commits for Divide-Framework/trunk/Source Code/main.cpp

Diff revisions: vs.
Revision Author Commited Message
117 Diff Diff k1ngp1n picture k1ngp1n Tue 05 Jun, 2012 17:30:40 +0000

[Ionut] [[BR]]
-Separated responsibilities between “Application” and “Kernel” [[BR]]
--“Application” handles data such as window dimensions, logs, “ParamHandler” etc [[BR]]
--“Kernel” handles the main loop, SFX, GFX, physics, sceneManager etc updates [[BR]]
---“Kernel” is now a “Core” component [[BR]]
-Reduced coupling between some classes by passing more info via parameters rather than relying on singleton access [[BR]]
--Ex: eyePos in “Terrain”,“Water” and “Trigger” classes is now passed as a "vec3<F32>" on render call rather than querying “CameraManager” [[BR]]
-Reworked “GLWrapper” shutdown routine [[BR]]
Singleton witch hunt [[BR]]
-“Kernel” is no longer a singleton and it’s initialized on application startup in the “Application” class[[BR]]
-“CameraManager” is no longer a singleton and it’s instantiated in the kernel [[BR]]

116 Diff Diff k1ngp1n picture k1ngp1n Mon 04 Jun, 2012 22:27:07 +0000

[Ionut] [[BR]]
-Removed now useless “BaseCache” class as a simple unordered_map in each manager-type class is all that’s needed [[BR]]
-Moved loading responsibility from each Resource implementation to each "ImplResourceLoader<T>" class (defaults via macro’s are available for convenience) [[BR]]
--Resources now have a “setInitialData” method for setting post-load values [[BR]]
--Also added a loader for Particle Emitters [[BR]]
-Added a new class, “HardwareResource” (for textures, shaders, etc) that needs special loading routines to facilitate future multi-threaded asset streaming [[BR]]
--HardwareResource’s have a “generateHWResource” that should be called after threaded loading routines join with main thread [[BR]]
-Renamed “Guardian” class to “Kernel” as that’s what it’s new responsibility will be in future revisions [[BR]]
-Added the “threadpool” library from here: http://threadpool.sourceforge.net/ (not used yet) [[BR]]
-Added some more macro’s and cleanups [[BR]]

100 Diff Diff k1ngp1n picture k1ngp1n Mon 05 Mar, 2012 17:45:11 +0000

[Ionut] [[BR]]
Features: [[BR]]
-Added a physics system interface instead of direct PhysX interaction to allow other physics engines (Bullet, ODE etc) to be easily implemented [[BR]]
--This will aid in Object-Object collisions and character control in future revisions [[BR]]
-Added an Ogre3D inspired FrameListener which now allows Before-frame/during-frame/after-frame event plugins of callbacks [[BR]]
-Added a renderInViewport system to draw elements in a user defined rectangle on screen [[BR]]
--Current uses: shadowmap preview (F10) [[BR]]
-Separated Shaders from ShaderPrograms[[BR]]
--ShaderPrograms can now use multiple Shaders [[BR]]
-Error output is now sent to errors.log[[BR]]
-All SceneNode based elements now have a postDraw calls as well [[BR]]
-A cubemap generating function has been added to the GFXDevice class[[BR]]
-Added debug only print options to the Console class [[BR]]
[[BR]]
Performance: [[BR]]
-All shadows are now filtered by a faster Gaussian 3x3 blur filter [[BR]]
-All renderables are now sorted and rendered by material/front-to-back/back-to-front, depending on case [[BR]]
-RenderQueue now sorts and queue’s translucent and opaque objects separately[[BR]]
-Shader uniforms/attributes are now cached to reduce number of address calls to the GPU[[BR]]
-Shaders are now cached, so that if multiple ShaderPrograms use an already compiled Shader, that Shader is returned from memory instead of creating a new copy[[BR]]
-Shaders are not unbound/rebound except when an objects demands so (vastly improves performance)[[BR]]
-Reduced calls to glEnable[[BR]]
[[BR]]
Bug fixes: [[BR]]
-Preprocessor configurations now work properly [[BR]]
-Video API is now unloaded before destruction [[BR]]
-Manager base class now properly frees memory [[BR]]
-Materials are saved to XML only if they are changed at any point [[BR]]

97 Diff Diff k1ngp1n picture k1ngp1n Tue 07 Feb, 2012 15:23:45 +0000

[ Ionut ] [[BR]]
-Restructured code base to a more logical layout [[BR]]
--Geometry folder contains shapes, materials, animations and the importer; Environment folder holds sky, terrain, water, vegetation; etc [[BR]]
--All header files are moved to a “Headers” sub-folder [[BR]]
--Renamed most of the Romanian code/comments/files/folders to English [[BR]]
--Added comments to parts of the code (ongoing from now on) [[BR]]
[[BR]]
-Rewrote the entire lighting system [[BR]]
--Added a LightManager class to handle all lights [[BR]]
---LightManager calls updates and render calls to all lights it manages [[BR]]
--Lights have all needed properties stored in 2 maps (one for vector values, one for float values) [[BR]]
--Added a LightImpostor class that takes the light’s properties and applies it to a dummy sphere [[BR]]
--If a light should draw it’s impostor, the impostor draws the dummy sphere [[BR]]
--Rewrote the Light <-> GFXDevice interaction [[BR]]
---Each light stores it’s type in a variable and passes all properties to the rendering API that then decides what to use based on that type [[BR]]
--Each light handles it’s own ShadowMapping [[BR]]
[[BR]]
-ShadowMapping: [[BR]]
-Each light stores it’s own depth maps and generates them based on it’s type [[BR]]
-LightManager binds all available depth maps and shaders pick them up automatically for use [[BR]]
-Each shadow map (of a total of 3 per light) corresponds to a detail level[[BR]]
-The final shadow map resolution is decided by the shadow detail level set in the config [[BR]]
--Camera and Frustum are set up for shadow rendering and applied to the render callback set for the current light (for example, Scene::render()) [[BR]]
--The light manager tells every light that has “_castShadows = true” to generate shadowmaps automatically after the Scene::PreRender stage [[BR]]
--ShadowMaps are blurred before applied to the fragment’s final color via shaders. [[BR]]
[[BR]]
-Added detail level configuration options [[BR]]
--ToDo: add shaders for each detail level [[BR]]
[[BR]]
-Moved all predefined geometry from immediate mode to VBO’s [[BR]]
--This allowed the rendering pipeline to be more streamlined (one render function for all geometry) [[BR]]
[[BR]]
-Fixed GuiElement visibility toggle [[BR]]
-Fixed GuiText color state problem [[BR]]
-Added FBO texture format options [[BR]]
-VBO rendering uses U16 as default instead of U32 (better for GPU) [[BR]]
-VBO’s now contain BiTangent data as well [[BR]]
-Added OpenGL 2.0 compatibility (not guaranteed!) [[BR]]
-Added static (on load) shader selection based on detail level [[BR]]
-Added SSAO PostFX option, but this won’t work until the implementation of “plugins” for PostFX system [[BR]]
-Optimized/Fixed code based on VisualLint + CppCheck analysis [[BR]]

81 Diff Diff k1ngp1n picture k1ngp1n Fri 15 Jul, 2011 11:27:57 +0000

[Ionut]
-Moved project to Trac
-Moved Visual Studio Data outside of the source code
Added the first step to parent<>children object structure and parent matrix transformation

79 Diff Diff k1ngp1n picture k1ngp1n Sun 10 Jul, 2011 17:35:44 +0000

[Ionut Cava]
Additions:
-Added a SFX and AudioRenderingApi class that plays API independent sound (SDL_mixer,Fmod,OpenAL). Only SDL support for music and simple sound is implemented as of now.
-Added an AudioDescriptor class that holds information about sounds and is used by the SFX device to play what it describes.
-Added an API-independent PixelBufferObject class that builds a texture pixel by pixel;
-Polished up the Material class and now every Object3D derived entity uses it (Box3D,Sphere3D,Quad3D,Text3D,SubMesh etc). It contains a texture vector, color information, shininess and other light parameters(i.e. specular)
-Added a deffered-rendering system (implemented in CubeScene as of this commit. Results are not visible yet / shader incomplete):
--Modified the VertexBufferObject to hold a G-buffer(3 texture’s, one 32bit, one 24bit and the las 16bit). The first contains color information, the second position information, and the last normal information. A shader that calculates the data and adds it to the VBO is also added. (DefferedShadingPass1).
--Light information is written to a PBO (in the form position-color / only point lights supported for now).
--G-buffer and Light PBO’s are bound to a full-screen quad and a shader (DefferedShadingPass2) uses them to render the final product.

Fixes:
Huge code cleanup. Fixed most memory leaks
-Every resource in the game is now loaded through the ResourceManager and removed through it as well. Added a _refCount map for each resource to keep track of how many entities are using it, and delete that resource only when the last owning entity gets deleted;
-Most used memory is cleaned up at shutdown, and all resources are freed and released.
-Fixed threading system, by interrupting running threads, joining them and use shared_ptr for auto-deletion
-Events and Lights are managed via tr1::shared_ptr’s for self-cleanup and destruction
-Cleaned up some headers for useles includes. Added forward declarations were possible. Resized some variables to smaller types for lessening memory usage.
-Fixed a lot of virtual destruction ordering in some classes.
-Fixed boundingBox calculations for terrain. Calculate terrain object’s(trees) boundingbox first, then add it to terrain. Also increase speed of calculation, by using 2 floats for min and max Y-values per step and update BB at the end. (instead of updating BB at every step).
-Object3D base class holds information about shaders, materials, and suplimental BoundingBox information
-The ResourceManager now properly loads Object3D derived classes;
-Fixed memory leak in glTexture destruction after a previous resize (if dimensions where not power of 2 based)
-Removed most unused libraries
-Removing elements from a manager, first calls the “unload” function that should be implemented in every Resource-based class, then deletes the resource, then set’s it’s pointer to NULL;
-Added proper destruction for Object3DFlyweight
-Fixed renderstate activation and attribute appliance.
-More stuff that I can’t remember now ...

77 Diff Diff k1ngp1n picture k1ngp1n Sun 12 Jun, 2011 11:45:40 +0000

[k1ngp1n]
-Removed all of the remaining ZPR code
-Implemented a proper cross-platform InputManager with support for Keyboard,Mouse and Joystick with proper Scene class callback of respective virtual members that can be implemented on a per scene basis.
-Removed most of the Flash implementation (bad code). Will be repaired sometime in the future.
-Added Flyweight support for Object3D class (hopefully will reduce RAM usage a lot)

52 Diff Diff k1ngp1n picture k1ngp1n Thu 04 Nov, 2010 12:51:07 +0000

[k1ngp1n]
-Moved source code to trunk folder

36 Diff Diff k1ngp1n picture k1ngp1n Wed 27 Oct, 2010 14:48:22 +0000

[k1ngp1n]
A lot of changes in the code:
--Scene manager that handles changing/rendering/loading/unloading of scenes (ToDo: handle scene specific assets, and scene<->scene transition with or without unloading of previous assets)
--Faster OBJ loading using std::Vector, requiring a faster first pass than before (ToDo: use VBO rendering and move it to Mesh class)
--Performance speedups in the ParamHandler class increasing framerate by a factor of 5
--Added a GFXDevice class and a RenderAPIWrapper to start migrating OGL and DX specific rendering techniques to different classes. (Shaders, VBO’s, FBO’s are moved also to specific API classes). Direct3D support is not implemented as of yet (empty method definitions for now)
--Threaded event system based on callbacks (can call a specific callback function X times or X times per N ms for W ms total)
--More optimizations and tweaks

35 k1ngp1n picture k1ngp1n Tue 07 Sep, 2010 17:49:06 +0000

-Massive class cleanups
-Added BOOST libraries for XML, Threads, GenericType(BOOST::ANY class) and so forth
-Added XML based config for terrains, vegetation,settings etc
-Added a TerrainManager that allows multiple terrain loading and rendering.
-Added a Resource class to help with the upcoming ResourceManager that will handle loading/unloading of models,textures,shaders and so on
-Added Water rendering and effects
-Added a day/night cycle
-Fixed camera-framerate independent moving speed
-Rewrote the ParamHandler and most managers to use unordered maps
-A lot of other changes