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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
   Copyright (c) 2014 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy of this software
   and associated documentation files (the "Software"), to deal in the Software without restriction,
   including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

   */

#ifndef VECTOR_H_
#define VECTOR_H_

#include "config.h"

/// boost vectors have a completely different interface, so we can't actually use them
#if defined(VECTOR_IMP) && VECTOR_IMP == 2
#	undef  VECTOR_IMP
#	define VECTOR_IMP 0
#endif

#if defined(VECTOR_IMP) && VECTOR_IMP == 2
/// vector.hpp has some issues in 1.55 (fixed in 1.56)
/*
#include <boost/container/vector.hpp>

namespace vectorAlg = boost;

template<typename Type>
using vectorImpl = boost::container::vector<Type>;

namespace boost {
typedef size_t vecSize;

template<typename T>
inline void shrinkToFit(vectorImpl<T>& inputVector) {
inputVector.shrink_to_fit();
}

#	ifndef BOOST_PAIR_FUNCS
#	define BOOST_PAIR_FUNCS
template<typename K, typename V>
inline std::pair<K, V> makePair(const K& key, const V& val) {
return std::make_pair(key, val);
}

template<typename K, typename V>
inline std::pair<K, V> makePairCpy(const K& key, V val) {
return std::make_pair(key, val);
}
#	endif
};
*/
#elif defined(VECTOR_IMP) && VECTOR_IMP == 0

#include <EASTL/vector.h>

namespace vectorAlg = eastl;

template<typename Type>
using vectorImpl = vectorAlg::vector < Type > ;

namespace eastl {
    typedef eastl_size_t vecSize;

    template<typename T>
    inline void shrinkToFit(vectorImpl<T>& inputVector) {
        inputVector.set_capacity(inputVector.size()  * sizeof(T));
    }

    template<typename T, class... Args>
    inline typename vectorImpl<T>::iterator emplace_back(vectorImpl<T>& inputVector, Args&&... args) {
        new(inputVector.push_back_uninitialized())T(std::forward<Args>(args)...);
        return &inputVector.back();
    }

#	ifndef EASTL_PAIR_FUNCS
#	define EASTL_PAIR_FUNCS
    template<typename K, typename V>
    inline eastl::pair<K, V> makePair(const K& key, const V& val) {
        return eastl::make_pair_ref(key, val);
    }

    template<typename K, typename V>
    inline eastl::pair<K, V> makePairCpy(const K& key, V val) {
        return eastl::make_pair_ref(key, val);
    }
#	endif
};

#else //defined(VECTOR_IMP) && VECTOR_IMP == 1

#include <vector>

namespace vectorAlg = std;

template<typename Type>
using vectorImpl = vectorAlg::vector<Type>;

namespace std {
    typedef size_t vecSize;

    //template<typename T1, typename T2>
    //using pair = std::pair<T1, T2>;

    template<typename T>
    inline void shrinkToFit(vectorImpl<T>& inputVector) {
        inputVector.shrink_to_fit();
    }

    template<typename T, class... _Valty>
    inline typename vectorImpl<T>::iterator emplace_back(vectorImpl<T>& inputVector, _Valty&&... _Val) {
        inputVector.emplace_back(std::forward<Args>(args)...);
        return inputVector.back();
    }

#	ifndef STD_PAIR_FUNCS
#	define STD_PAIR_FUNCS
    template<typename K, typename V>
    inline std::pair<K, V> makePair(const K& key, const V& val) {
        return std::make_pair(key, val);
    }

    template<typename K, typename V>
    inline std::pair<K, V> makePairCpy(const K& key, V val) {
        return std::make_pair(key, val);
    }
#	endif
};
#endif //defined(VECTOR_IMP)

#define SET_VECTOR_EMPLACE_FRIEND template<typename T, typename... Args>  \
                                  friend typename vectorImpl<T>::iterator \
                                  vectorAlg::emplace_back(vectorImpl<T>& inputVector, \
                                                          Args&&... args);
#endif

Commits for Divide-Framework/trunk/Source Code/Utility/Headers/Vector.h

Diff revisions: vs.
Revision Author Commited Message
331 Diff Diff IonutCava picture IonutCava Sat 06 Dec, 2014 20:53:45 +0000

[Ionut]
- Limited line length to 132 characters to improve readability and diff-comparisons
- Refactored memory allocation/deallocation functions
- Fixed a few compatibility issues with HashMap.h
- Fixed a bug in GPU Skinning shaders (cast a float to int)

330 Diff Diff IonutCava picture IonutCava Fri 10 Oct, 2014 17:19:11 +0000

[Ionut]
- New rendering algorithm :
— Perform second pass for visible nodes gathering all render commands and uploading them to an indirect draw buffer
— Render geometry with indirect draw commands
— Removed per-node range binding of the node buffer. Instead, bind the entire buffer once and index data in shaders
— Use “baseInstance” parameter from IndirectDrawCommand as a node buffer index
— Prefer DSA extensions for updating buffer data where applicable
- Moved all rendering specific code from SceneGraphNode to a new RenderingComponent
- Optimized “toString” utility function

326 Diff Diff IonutCava picture IonutCava Tue 30 Sep, 2014 21:11:32 +0000

[Ionut]
- Fixed more memory leaks
- Simplified Task interface and timing System
- Improved compatibility between Boost, STL and EASTL with random combinations of vectors, strings and maps
- Simplified Light class by removing the “slot” member
- Random optimizations

323 Diff Diff IonutCava picture IonutCava Thu 11 Sep, 2014 20:58:50 +0000

[Ionut]
- Reworked GFXDevice API initialization system
- Added a separate map for boolean values in ParamHandler
- More cleanups in GFXDevice class
- Fixed an infinite loop issue in Task class

322 Diff Diff IonutCava picture IonutCava Sat 06 Sep, 2014 20:33:47 +0000

[Ionut]
- Refactored most of Boost related code to be C++11 based
— Boost is only used for ThreadPool, Mutex handling, XML parsing and networking (ASIO)
— Function binds, threads, regex, NonCopyable base, Hashing algorithms and more are now using C++11 libraries
- Replaced all FOR_EACH calls with standard, range, “for” calls

321 Diff Diff IonutCava picture IonutCava Wed 03 Sep, 2014 22:05:15 +0000

[Ionut]
- Added support (and enabled by default) for the EASTL library (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html / https://github.com/paulhodge/EASTL)
— Strings, vectors and hash_maps can be combined from EASTL, STL and Boost (not all combinations work. e.g. EASTL strings with STL/Boost containers due to the lack of a proper hash function)

221 Diff Diff k1ngp1n picture k1ngp1n Wed 08 Jan, 2014 18:50:02 +0000

[Ionut] [[BR]]
- Merged branch “Shadows And Animations” back into trunk [[BR]]
- Added DoxygenGUI project file [[BR]]

  • Buggy *
170 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Nov, 2013 17:24:57 +0000

-Moved hardware related code to a separate project [[BR]]
-More work on post-processing: [[BR]]
— HDR rendering is working, but final tonemapping needs more work [[BR]]
-Important changes in BloomPreRenderOperator.cpp, PostFX.cpp and glFrameBufferObject.cpp [[BR]]
-Trailing and leading whitespace cleanups [[BR]]

160 Diff Diff k1ngp1n picture k1ngp1n Wed 10 Jul, 2013 17:07:04 +0000

[Ionut] [[BR]]
- Changed licensing from LGPL to the MIT license [[BR]]
— Code can now be used in non-commercial or commercial closed or open source projects [[BR]]

152 k1ngp1n picture k1ngp1n Thu 20 Jun, 2013 14:23:31 +0000

[Ionut] [[BR]]
- New rendering pipeline (experimental and unstable): [[BR]]
— OpenGL 3.x clean context (glLight commands are still used for now, but UBO support is there, but not used yet) [[BR]]
— Custom matrix stacks and UBO based shader data (UBOs cause some link errors on some nVidia cards)[[BR]]
— Multi-threaded texture loading and shader compilation (mt shader compilation disabled for now. needs more tests) [[BR]]
— VAO rendering is self contained (no more enable/disable calls before a draw request) [[BR]]
— Render instance class used for rendering information [[BR]]
[[BR]]
- New unique ID generation base class: GUIDWrapper. Each class that derives from this, gets an application wide unique id on construction [[BR]]
- Added base code for an in-game editor using CEGUI [[BR]]
- Replaced some mutex locks with lockless data structures or atomic data [[BR]]
- CEGUI 0.8.2, FTGL-GL3 and GLIM 0.4 modified to support GLEW_MX if defined [[BR]]
- Dropped VS2008 support [[BR]]
- Networking library, server framework and ReCast files are now projects inside the Divide Framework solution [[BR]]
- New console command “setFov” that modifies the horizontal FoV value in realtime [[BR]]
- New console command “recompileShader” that reparses shader files, recompiles shaders and relinks shader programs who’s names match or contain the argument string [[BR]]
- New debug utility: axis angle drawn in corner of the screen if needed [[BR]]
- More ‘const’-s pasted around the code, more loop performance tweaks (allocations before a loop, tighter loops, etc), more utility member functions added to various classes [[BR]]