ruby-ogre 0.0.3-x86-linux → 0.0.4-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/Rakefile +7 -8
  2. data/bindings/ogre/interface/ogre_all.i +1 -0
  3. data/bindings/ogre/interface/ogre_wrap.cpp +591 -46
  4. data/bindings/ogre/interface/ogre_wrap.o +0 -0
  5. data/bindings/ogrebites/interface/ogrebites_wrap.o +0 -0
  6. data/bindings/procedural/interface/procedural_wrap.o +0 -0
  7. data/deps/include/OGRE/OgreAny.h +23 -1
  8. data/deps/include/OGRE/OgreBillboardChain.h +5 -1
  9. data/deps/include/OGRE/OgreBillboardParticleRenderer.h +2 -0
  10. data/deps/include/OGRE/OgreConfigDialog.h +0 -2
  11. data/deps/include/OGRE/OgreDynLib.h +1 -7
  12. data/deps/include/OGRE/OgreErrorDialog.h +0 -2
  13. data/deps/include/OGRE/OgreHeaderSuffix.h +3 -3
  14. data/deps/include/OGRE/OgreInstanceBatch.h +4 -0
  15. data/deps/include/OGRE/OgreInstanceManager.h +5 -0
  16. data/deps/include/OGRE/OgreIteratorRange.h +13 -2
  17. data/deps/include/OGRE/OgreParticleSystem.h +2 -0
  18. data/deps/include/OGRE/OgreParticleSystemRenderer.h +4 -0
  19. data/deps/include/OGRE/OgrePlatform.h +5 -28
  20. data/deps/include/OGRE/OgrePrerequisites.h +1 -1
  21. data/deps/include/OGRE/OgreProfiler.h +102 -59
  22. data/deps/include/OGRE/OgreProgressiveMesh.h +2 -2
  23. data/deps/include/OGRE/OgreRenderSystem.h +18 -1
  24. data/deps/include/OGRE/OgreRoot.h +1 -1
  25. data/deps/include/OGRE/OgreSearchOps.h +0 -5
  26. data/deps/include/OGRE/OgreSimpleRenderable.h +1 -1
  27. data/deps/include/OGRE/OgreStdHeaders.h +2 -2
  28. data/deps/include/OGRE/OgreStringConverter.h +5 -0
  29. data/deps/include/OGRE/OgreTimer.h +1 -1
  30. data/deps/include/OGRE/OgreUTFString.h +0 -2
  31. data/deps/include/OGRE/OgreWindowEventUtilities.h +3 -1
  32. data/deps/include/OGRE/OgreWorkQueue.h +2 -2
  33. data/deps/include/OGRE/RTShaderSystem/OgreShaderCGProgramProcessor.h +5 -5
  34. data/deps/include/OGRE/RTShaderSystem/OgreShaderCGProgramWriter.h +17 -15
  35. data/deps/include/OGRE/RTShaderSystem/OgreShaderExDualQuaternionSkinning.h +3 -3
  36. data/deps/include/OGRE/RTShaderSystem/OgreShaderExHardwareSkinning.h +5 -4
  37. data/deps/include/OGRE/RTShaderSystem/OgreShaderExHardwareSkinningTechnique.h +3 -3
  38. data/deps/include/OGRE/RTShaderSystem/OgreShaderExIntegratedPSSM3.h +50 -32
  39. data/deps/include/OGRE/RTShaderSystem/OgreShaderExLayeredBlending.h +13 -9
  40. data/deps/include/OGRE/RTShaderSystem/OgreShaderExLinearSkinning.h +7 -7
  41. data/deps/include/OGRE/RTShaderSystem/OgreShaderExNormalMapLighting.h +149 -95
  42. data/deps/include/OGRE/RTShaderSystem/OgreShaderExPerPixelLighting.h +91 -59
  43. data/deps/include/OGRE/RTShaderSystem/OgreShaderExTextureAtlasSampler.h +14 -9
  44. data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPColour.h +33 -24
  45. data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPFog.h +44 -30
  46. data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPLighting.h +70 -45
  47. data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPRenderStateBuilder.h +11 -10
  48. data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPTexturing.h +73 -64
  49. data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPTransform.h +8 -8
  50. data/deps/include/OGRE/RTShaderSystem/OgreShaderFunction.h +42 -35
  51. data/deps/include/OGRE/RTShaderSystem/OgreShaderFunctionAtom.h +38 -32
  52. data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLESProgramProcessor.h +9 -8
  53. data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLESProgramWriter.h +45 -36
  54. data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLProgramProcessor.h +9 -8
  55. data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLProgramWriter.h +26 -20
  56. data/deps/include/OGRE/RTShaderSystem/OgreShaderGenerator.h +211 -160
  57. data/deps/include/OGRE/RTShaderSystem/OgreShaderHLSLProgramProcessor.h +5 -5
  58. data/deps/include/OGRE/RTShaderSystem/OgreShaderHLSLProgramWriter.h +17 -15
  59. data/deps/include/OGRE/RTShaderSystem/OgreShaderMaterialSerializerListener.h +5 -3
  60. data/deps/include/OGRE/RTShaderSystem/OgreShaderParameter.h +86 -73
  61. data/deps/include/OGRE/RTShaderSystem/OgreShaderProgram.h +36 -30
  62. data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramManager.h +38 -31
  63. data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramProcessor.h +54 -43
  64. data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramSet.h +18 -14
  65. data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramWriter.h +10 -10
  66. data/deps/include/OGRE/RTShaderSystem/OgreShaderRenderState.h +28 -23
  67. data/deps/include/OGRE/RTShaderSystem/OgreShaderScriptTranslator.h +2 -1
  68. data/deps/include/OGRE/RTShaderSystem/OgreShaderSubRenderState.h +35 -32
  69. data/deps/include/OGRE/RenderSystems/GL/GL/wglew.h +2 -2
  70. data/deps/include/OGRE/RenderSystems/GL/GL/wglext.h +2 -2
  71. data/deps/include/OGRE/RenderSystems/GL/OgreGLRenderSystem.h +10 -1
  72. data/deps/include/OGRE/RenderSystems/GL/OgreGLTextureManager.h +2 -0
  73. data/deps/include/OGRE/Sample.h +5 -0
  74. data/deps/include/OGRE/SampleContext.h +13 -3
  75. data/deps/lib/OGRE/Plugin_BSPSceneManager.so +0 -0
  76. data/deps/lib/OGRE/Plugin_BSPSceneManager.so.1.8.1 +0 -0
  77. data/deps/lib/OGRE/Plugin_CgProgramManager.so +0 -0
  78. data/deps/lib/OGRE/Plugin_CgProgramManager.so.1.8.1 +0 -0
  79. data/deps/lib/OGRE/Plugin_OctreeSceneManager.so +0 -0
  80. data/deps/lib/OGRE/Plugin_OctreeSceneManager.so.1.8.1 +0 -0
  81. data/deps/lib/OGRE/Plugin_OctreeZone.so +0 -0
  82. data/deps/lib/OGRE/Plugin_OctreeZone.so.1.8.1 +0 -0
  83. data/deps/lib/OGRE/Plugin_PCZSceneManager.so +0 -0
  84. data/deps/lib/OGRE/Plugin_PCZSceneManager.so.1.8.1 +0 -0
  85. data/deps/lib/OGRE/Plugin_ParticleFX.so +0 -0
  86. data/deps/lib/OGRE/Plugin_ParticleFX.so.1.8.1 +0 -0
  87. data/deps/lib/OGRE/RenderSystem_GL.so +0 -0
  88. data/deps/lib/OGRE/RenderSystem_GL.so.1.8.1 +0 -0
  89. data/deps/lib/libOgreMain.so +0 -0
  90. data/deps/lib/libOgreMain.so.1.8.1 +0 -0
  91. data/deps/lib/libOgrePaging.so +0 -0
  92. data/deps/lib/libOgrePaging.so.1.8.1 +0 -0
  93. data/deps/lib/libOgreProcedural.so +0 -0
  94. data/deps/lib/libOgreRTShaderSystem.so +0 -0
  95. data/deps/lib/libOgreRTShaderSystem.so.1.8.1 +0 -0
  96. data/deps/lib/libOgreTerrain.so +0 -0
  97. data/deps/lib/libOgreTerrain.so.1.8.1 +0 -0
  98. data/deps/share/OGRE/media/materials/programs/DiffuseOneTexture.glsles +17 -0
  99. data/deps/share/OGRE/media/packs/profiler.zip +0 -0
  100. data/lib/ogre.so +0 -0
  101. data/lib/ogrebites.so +0 -0
  102. data/lib/procedural.so +0 -0
  103. data/lib/version.rb +1 -1
  104. data/sample/charactor/sinbad.rb +8 -4
  105. metadata +16 -4
Binary file
@@ -214,7 +214,29 @@ namespace Ogre
214
214
  }
215
215
  }
216
216
 
217
-
217
+ template <typename ValueType>
218
+ ValueType get(void) const
219
+ {
220
+ if (!mContent)
221
+ {
222
+ OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
223
+ "Bad cast from uninitialised Any",
224
+ "Any::operator()");
225
+ }
226
+ else if(getType() == typeid(ValueType))
227
+ {
228
+ return static_cast<Any::holder<ValueType> *>(mContent)->held;
229
+ }
230
+ else
231
+ {
232
+ StringUtil::StrStreamType str;
233
+ str << "Bad cast from type '" << getType().name() << "' "
234
+ << "to '" << typeid(ValueType).name() << "'";
235
+ OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
236
+ str.str(),
237
+ "Any::operator()");
238
+ }
239
+ }
218
240
 
219
241
  };
220
242
 
@@ -259,7 +259,6 @@ namespace Ogre {
259
259
 
260
260
 
261
261
  // Overridden members follow
262
- void _notifyCurrentCamera(Camera* cam);
263
262
  Real getSquaredViewDepth(const Camera* cam) const;
264
263
  Real getBoundingRadius(void) const;
265
264
  const AxisAlignedBox& getBoundingBox(void) const;
@@ -267,6 +266,7 @@ namespace Ogre {
267
266
  const String& getMovableType(void) const;
268
267
  void _updateRenderQueue(RenderQueue *);
269
268
  void getRenderOperation(RenderOperation &);
269
+ virtual bool preRender(SceneManager* sm, RenderSystem* rsys);
270
270
  void getWorldTransforms(Matrix4 *) const;
271
271
  const LightList& getLights(void) const;
272
272
  /// @copydoc MovableObject::visitRenderables
@@ -299,6 +299,8 @@ namespace Ogre {
299
299
  mutable bool mBoundsDirty;
300
300
  /// Is the index buffer dirty?
301
301
  bool mIndexContentDirty;
302
+ /// Is the vertex buffer dirty?
303
+ bool mVertexContentDirty;
302
304
  /// AABB
303
305
  mutable AxisAlignedBox mAABB;
304
306
  /// Bounding radius
@@ -310,6 +312,8 @@ namespace Ogre {
310
312
  TexCoordDirection mTexCoordDir;
311
313
  /// Other texture coord range
312
314
  Real mOtherTexCoordRange[2];
315
+ /// Camera last used to build the vertex buffer
316
+ Camera *mVertexCameraUsed;
313
317
  /// When true, the billboards always face the camera
314
318
  bool mFaceCamera;
315
319
  /// Used when mFaceCamera == false; determines the billboard's "normal". i.e.
@@ -221,6 +221,8 @@ namespace Ogre {
221
221
  void _notifyDefaultDimensions(Real width, Real height);
222
222
  /// @copydoc ParticleSystemRenderer::setRenderQueueGroup
223
223
  void setRenderQueueGroup(uint8 queueID);
224
+ /// @copydoc MovableObject::setRenderQueueGroupAndPriority
225
+ void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority);
224
226
  /// @copydoc ParticleSystemRenderer::setKeepParticlesInLocalSpace
225
227
  void setKeepParticlesInLocalSpace(bool keepLocal);
226
228
  /// @copydoc ParticleSystemRenderer::_getSortMode
@@ -48,8 +48,6 @@ THE SOFTWARE.
48
48
  # include "OSX/OgreConfigDialogImp.h"
49
49
  #elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
50
50
  # include "iOS/OgreConfigDialogImp.h"
51
- #elif OGRE_PLATFORM == OGRE_PLATFORM_SYMBIAN
52
- # include "Symbian/OgreConfigDialogImp.h"
53
51
  #elif OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
54
52
  # include "Android/OgreConfigDialogImp.h"
55
53
  #endif
@@ -39,7 +39,7 @@ THE SOFTWARE.
39
39
  struct HINSTANCE__;
40
40
  typedef struct HINSTANCE__* hInstance;
41
41
 
42
- #elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
42
+ #elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_ANDROID || OGRE_PLATFORM == OGRE_PLATFORM_NACL
43
43
  # define DYNLIB_HANDLE void*
44
44
  # define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
45
45
  # define DYNLIB_GETSYM( a, b ) dlsym( a, b )
@@ -51,12 +51,6 @@ typedef struct HINSTANCE__* hInstance;
51
51
  # define DYNLIB_GETSYM( a, b ) dlsym( a, b )
52
52
  # define DYNLIB_UNLOAD( a ) dlclose( a )
53
53
 
54
- #elif OGRE_PLATFORM == OGRE_PLATFORM_SYMBIAN || OGRE_PLATFORM == OGRE_PLATFORM_NACL
55
- # define DYNLIB_HANDLE void*
56
- # define DYNLIB_LOAD( a ) 0
57
- # define DYNLIB_GETSYM( a, b ) 0
58
- # define DYNLIB_UNLOAD( a ) 0
59
-
60
54
  #endif
61
55
 
62
56
  namespace Ogre {
@@ -48,8 +48,6 @@ THE SOFTWARE.
48
48
  # include "OSX/OgreErrorDialogImp.h"
49
49
  #elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
50
50
  # include "iOS/OgreErrorDialogImp.h"
51
- #elif OGRE_PLATFORM == OGRE_PLATFORM_SYMBIAN
52
- # include "Symbian/OgreErrorDialogImp.h"
53
51
  #elif OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
54
52
  # include "Android/OgreErrorDialogImp.h"
55
53
  #endif
@@ -23,8 +23,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
23
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
24
  THE SOFTWARE
25
25
  -------------------------------------------------------------------------*/
26
- #ifndef __OgreHeaderPrefix_H__
27
- #define __OgreHeaderPrefix_H__
26
+ #ifndef __OgreHeaderSuffix_H__
27
+ #define __OgreHeaderSuffix_H__
28
28
 
29
29
  #include "OgrePrerequisites.h"
30
30
 
@@ -39,6 +39,6 @@ THE SOFTWARE
39
39
 
40
40
  #endif
41
41
  // allow inclusion of prefix again now (this is scoped)
42
- #undef __OgreHeaderPrefix_H__
42
+ #undef __OgreHeaderSuffix_H__
43
43
 
44
44
 
@@ -338,6 +338,10 @@ namespace Ogre
338
338
 
339
339
  virtual void _updateRenderQueue(RenderQueue* queue);
340
340
  void visitRenderables( Renderable::Visitor* visitor, bool debugRenderables = false );
341
+
342
+ // resolve ambiguity of get/setUserAny due to inheriting from Renderable and MovableObject
343
+ using Renderable::getUserAny;
344
+ using Renderable::setUserAny;
341
345
  };
342
346
  }
343
347
 
@@ -144,6 +144,11 @@ namespace Ogre
144
144
  */
145
145
  void applySettingToBatches( BatchSettingId id, bool value, const InstanceBatchVec &container );
146
146
 
147
+ /** Called when we you use a mesh which has shared vertices, the function creates separate
148
+ vertex/index buffers and also recreates the bone assignments.
149
+ */
150
+ void unshareVertices(const Ogre::MeshPtr &mesh);
151
+
147
152
  public:
148
153
  InstanceManager( const String &customName, SceneManager *sceneManager,
149
154
  const String &meshName, const String &groupName,
@@ -29,9 +29,20 @@ THE SOFTWARE.
29
29
  #define __Ogre_Iterator_Range_H__
30
30
 
31
31
 
32
- //#define OGRE_USE_BOOST 1 - picked up by CMake
33
32
  #if OGRE_USE_BOOST
34
- #include <boost/range.hpp>
33
+ # if OGRE_COMPILER == OGRE_COMPILER_CLANG || OGRE_COMPILER == OGRE_COMPILER_GCC
34
+ # pragma GCC diagnostic push
35
+ # pragma GCC diagnostic ignored "-Wshadow"
36
+ # pragma GCC diagnostic ignored "-Wpadded"
37
+ # pragma GCC diagnostic ignored "-Wweak-vtables"
38
+ # pragma GCC diagnostic ignored "-Wall"
39
+ # endif
40
+
41
+ # include <boost/range.hpp>
42
+
43
+ # if OGRE_COMPILER == OGRE_COMPILER_CLANG || OGRE_COMPILER == OGRE_COMPILER_GCC
44
+ # pragma GCC diagnostic pop
45
+ # endif
35
46
  #endif
36
47
 
37
48
  namespace Ogre {
@@ -548,6 +548,8 @@ namespace Ogre {
548
548
 
549
549
  /** @copydoc MovableObject::setRenderQueueGroup */
550
550
  void setRenderQueueGroup(uint8 queueID);
551
+ /** @copydoc MovableObject::setRenderQueueGroupAndPriority */
552
+ void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority);
551
553
 
552
554
  /** Set whether or not particles are sorted according to the camera.
553
555
  @remarks
@@ -108,6 +108,10 @@ namespace Ogre {
108
108
  output.
109
109
  */
110
110
  virtual void setRenderQueueGroup(uint8 queueID) = 0;
111
+ /** Sets which render queue group and priority this renderer should target with it's
112
+ output.
113
+ */
114
+ virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority) = 0;
111
115
 
112
116
  /** Setting carried over from ParticleSystem.
113
117
  */
@@ -36,10 +36,9 @@ namespace Ogre {
36
36
  #define OGRE_PLATFORM_WIN32 1
37
37
  #define OGRE_PLATFORM_LINUX 2
38
38
  #define OGRE_PLATFORM_APPLE 3
39
- #define OGRE_PLATFORM_SYMBIAN 4
40
- #define OGRE_PLATFORM_APPLE_IOS 5
41
- #define OGRE_PLATFORM_ANDROID 6
42
- #define OGRE_PLATFORM_NACL 7
39
+ #define OGRE_PLATFORM_APPLE_IOS 4
40
+ #define OGRE_PLATFORM_ANDROID 5
41
+ #define OGRE_PLATFORM_NACL 6
43
42
 
44
43
  #define OGRE_COMPILER_MSVC 1
45
44
  #define OGRE_COMPILER_GNUC 2
@@ -100,9 +99,7 @@ namespace Ogre {
100
99
 
101
100
  /* Finds the current platform */
102
101
 
103
- #if defined( __SYMBIAN32__ )
104
- # define OGRE_PLATFORM OGRE_PLATFORM_SYMBIAN
105
- #elif defined( __WIN32__ ) || defined( _WIN32 )
102
+ #if defined( __WIN32__ ) || defined( _WIN32 )
106
103
  # define OGRE_PLATFORM OGRE_PLATFORM_WIN32
107
104
  #elif defined( __APPLE_CC__)
108
105
  // Device Simulator
@@ -201,26 +198,6 @@ namespace Ogre {
201
198
 
202
199
  #endif // OGRE_PLATFORM == OGRE_PLATFORM_WIN32
203
200
 
204
- //----------------------------------------------------------------------------
205
- // Symbian Settings
206
- #if OGRE_PLATFORM == OGRE_PLATFORM_SYMBIAN
207
- # define _OgreExport
208
- # define OGRE_UNICODE_SUPPORT 1
209
- # define OGRE_DEBUG_MODE 0
210
- # define _OgrePrivate
211
- # define CLOCKS_PER_SEC 1000
212
- // pragma def were found here: http://www.inf.pucrs.br/~eduardob/disciplinas/SistEmbarcados/Mobile/Nokia/Tools/Carbide_vs/WINSCW/Help/PDF/C_Compilers_Reference_3.2.pdf
213
- # pragma warn_unusedarg off
214
- # pragma warn_emptydecl off
215
- # pragma warn_possunwant off
216
- // A quick define to overcome different names for the same function
217
- # define stricmp strcasecmp
218
- # ifdef DEBUG
219
- # define OGRE_DEBUG_MODE 1
220
- # else
221
- # define OGRE_DEBUG_MODE 0
222
- # endif
223
- #endif
224
201
  //----------------------------------------------------------------------------
225
202
  // Android Settings
226
203
  /*
@@ -244,7 +221,7 @@ namespace Ogre {
244
221
  #endif
245
222
  */
246
223
  //----------------------------------------------------------------------------
247
- // Linux/Apple/iOs/Android/Symbian/NaCl Settings
224
+ // Linux/Apple/iOs/Android/NaCl Settings
248
225
  #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS || \
249
226
  OGRE_PLATFORM == OGRE_PLATFORM_ANDROID || OGRE_PLATFORM == OGRE_PLATFORM_NACL
250
227
 
@@ -55,7 +55,7 @@ namespace Ogre {
55
55
  // Define ogre version
56
56
  #define OGRE_VERSION_MAJOR 1
57
57
  #define OGRE_VERSION_MINOR 8
58
- #define OGRE_VERSION_PATCH 0
58
+ #define OGRE_VERSION_PATCH 1
59
59
  #define OGRE_VERSION_SUFFIX ""
60
60
  #define OGRE_VERSION_NAME "Byatis"
61
61
 
@@ -53,6 +53,9 @@ Ogre-dependent is in the visualization/logging routines and the use of the Timer
53
53
  # define OgreProfileGroup( a, g ) Ogre::Profile _OgreProfileInstance( (a), (g) )
54
54
  # define OgreProfileBeginGroup( a, g ) Ogre::Profiler::getSingleton().beginProfile( (a), (g) )
55
55
  # define OgreProfileEndGroup( a, g ) Ogre::Profiler::getSingleton().endProfile( (a), (g) )
56
+ # define OgreProfileBeginGPUEvent( g ) Ogre::Profiler::getSingleton().beginGPUEvent(g)
57
+ # define OgreProfileEndGPUEvent( g ) Ogre::Profiler::getSingleton().endGPUEvent(g)
58
+ # define OgreProfileMarkGPUEvent( e ) Ogre::Profiler::getSingleton().markGPUEvent(e)
56
59
  #else
57
60
  # define OgreProfile( a )
58
61
  # define OgreProfileBegin( a )
@@ -60,6 +63,9 @@ Ogre-dependent is in the visualization/logging routines and the use of the Timer
60
63
  # define OgreProfileGroup( a, g )
61
64
  # define OgreProfileBeginGroup( a, g )
62
65
  # define OgreProfileEndGroup( a, g )
66
+ # define OgreProfileBeginGPUEvent( e )
67
+ # define OgreProfileEndGPUEvent( e )
68
+ # define OgreProfileMarkGPUEvent( e )
63
69
  #endif
64
70
 
65
71
  namespace Ogre {
@@ -96,7 +102,9 @@ namespace Ogre {
96
102
  outside of a scope (i.e. the main game loop).
97
103
  @author Amit Mathew (amitmathew (at) yahoo (dot) com)
98
104
  */
99
- class _OgreExport Profile : public ProfilerAlloc {
105
+ class _OgreExport Profile :
106
+ public ProfilerAlloc
107
+ {
100
108
 
101
109
  public:
102
110
  Profile(const String& profileName, uint32 groupID = (uint32)OGREPROF_USER_DEFAULT);
@@ -123,8 +131,10 @@ namespace Ogre {
123
131
  @todo resolve artificial cap on number of profiles displayed
124
132
  @todo fix display ordering of profiles not called every frame
125
133
  */
126
- class _OgreExport Profiler : public Singleton<Profiler>, public ProfilerAlloc {
127
-
134
+ class _OgreExport Profiler :
135
+ public Singleton<Profiler>,
136
+ public ProfilerAlloc
137
+ {
128
138
  public:
129
139
  Profiler();
130
140
  ~Profiler();
@@ -166,6 +176,21 @@ namespace Ogre {
166
176
  */
167
177
  void endProfile(const String& profileName, uint32 groupID = (uint32)OGREPROF_USER_DEFAULT);
168
178
 
179
+ /** Mark the beginning of a GPU event group
180
+ @remarks Can be safely called in the middle of the profile.
181
+ */
182
+ void beginGPUEvent(const String& event);
183
+
184
+ /** Mark the end of a GPU event group
185
+ @remarks Can be safely called in the middle of the profile.
186
+ */
187
+ void endGPUEvent(const String& event);
188
+
189
+ /** Mark a specific, ungrouped, GPU event
190
+ @remarks Can be safely called in the middle of the profile.
191
+ */
192
+ void markGPUEvent(const String& event);
193
+
169
194
  /** Sets whether this profiler is enabled. Only takes effect after the
170
195
  the frame has ended.
171
196
  @remarks When this is called the first time with the parameter true,
@@ -177,14 +202,12 @@ namespace Ogre {
177
202
  bool getEnabled() const;
178
203
 
179
204
  /** Enables a previously disabled profile
180
- @remarks Only enables the profile if this function is not
181
- called during the profile it is trying to enable.
205
+ @remarks Can be safely called in the middle of the profile.
182
206
  */
183
207
  void enableProfile(const String& profileName);
184
208
 
185
209
  /** Disables a profile
186
- @remarks Only disables the profile if this function is not called during
187
- the profile it is trying to disable.
210
+ @remarks Can be safely called in the middle of the profile.
188
211
  */
189
212
  void disableProfile(const String& profileName);
190
213
 
@@ -291,16 +314,26 @@ namespace Ogre {
291
314
  */
292
315
  static Profiler* getSingletonPtr(void);
293
316
 
317
+
318
+
294
319
  protected:
295
320
 
296
321
  /** Initializes the profiler's GUI elements */
297
322
  void initialize();
298
323
 
299
- /** Prints the profiling results of each frame */
300
- void displayResults();
324
+ class ProfileInstance;
325
+ friend class ProfileInstance;
326
+ typedef list<OverlayElement*>::type ProfileBarList;
301
327
 
302
- /** Processes the profiler data after each frame */
303
- void processFrameStats();
328
+ void displayResults(void);
329
+ /** Prints the profiling results of each frame
330
+ @remarks Recursive, for all the little children. */
331
+ void displayResults(ProfileInstance* instance, ProfileBarList::iterator& bIter, Real& maxTimeMillisecs, Real& newGuiHeight, int& profileCount);
332
+
333
+ /** Processes frame stats for all of the mRoot's children */
334
+ void processFrameStats(void);
335
+ /** Processes specific ProfileInstance and it's children recursively.*/
336
+ void processFrameStats(ProfileInstance* instance, Real& maxFrameTime);
304
337
 
305
338
  /** Handles a change of the profiler's enabled state*/
306
339
  void changeEnableState();
@@ -316,32 +349,11 @@ namespace Ogre {
316
349
  OverlayElement* createPanel(const String& name, Real width, Real height, Real top, Real left,
317
350
  const String& materialName, bool show = true);
318
351
 
319
- /// Represents an individual profile call
320
- struct ProfileInstance {
321
-
322
- /// The name of the profile
323
- String name;
324
-
325
- /// The name of the parent, empty string if root
326
- String parent;
327
-
328
- /// The time this profile was started
329
- ulong currTime;
330
-
331
- /// Represents the total time of all child profiles to subtract
332
- /// from this profile
333
- ulong accum;
334
-
335
- /// The hierarchical level of this profile, 0 being the root profile
336
- uint hierarchicalLvl;
337
- };
338
352
 
339
353
  /// Represents the total timing information of a profile
340
354
  /// since profiles can be called more than once each frame
341
- struct ProfileFrame {
342
-
343
- /// The name of the profile
344
- String name;
355
+ struct ProfileFrame
356
+ {
345
357
 
346
358
  /// The total time this profile has taken this frame
347
359
  ulong frameTime;
@@ -355,11 +367,8 @@ namespace Ogre {
355
367
  };
356
368
 
357
369
  /// Represents a history of each profile during the duration of the app
358
- struct ProfileHistory {
359
-
360
- /// The name of the profile
361
- String name;
362
-
370
+ struct ProfileHistory
371
+ {
363
372
  /// The current percentage of frame time this profile has taken
364
373
  Real currentTimePercent;
365
374
  /// The current frame time this profile has taken in milliseconds
@@ -392,27 +401,65 @@ namespace Ogre {
392
401
 
393
402
  };
394
403
 
395
-
396
- typedef list<ProfileInstance>::type ProfileStack;
397
- typedef list<ProfileFrame>::type ProfileFrameList;
398
- typedef list<ProfileHistory>::type ProfileHistoryList;
399
- typedef map<String, ProfileHistoryList::iterator>::type ProfileHistoryMap;
400
- typedef map<String, bool>::type DisabledProfileMap;
404
+ /// Represents an individual profile call
405
+ class ProfileInstance :
406
+ public ProfilerAlloc
407
+ {
408
+ friend class Profiler;
409
+ public:
410
+ ProfileInstance(void);
411
+ virtual ~ProfileInstance(void);
401
412
 
402
- typedef list<OverlayElement*>::type ProfileBarList;
413
+ typedef Ogre::map<String,ProfileInstance*>::type ProfileChildren;
414
+
415
+ void logResults();
416
+ void reset();
417
+
418
+ inline bool watchForMax(void) { return history.currentTimePercent == history.maxTimePercent; }
419
+ inline bool watchForMin(void) { return history.currentTimePercent == history.minTimePercent; }
420
+ inline bool watchForLimit(Real limit, bool greaterThan = true)
421
+ {
422
+ if (greaterThan)
423
+ return history.currentTimePercent > limit;
424
+ else
425
+ return history.currentTimePercent < limit;
426
+ }
403
427
 
404
- /// A stack for each individual profile per frame
405
- ProfileStack mProfiles;
428
+ bool watchForMax(const String& profileName);
429
+ bool watchForMin(const String& profileName);
430
+ bool watchForLimit(const String& profileName, Real limit, bool greaterThan = true);
431
+
432
+ /// The name of the profile
433
+ String name;
406
434
 
407
- /// Accumulates the results of each profile per frame (since a profile can be called
408
- /// more than once a frame)
409
- ProfileFrameList mProfileFrame;
435
+ /// The name of the parent, null if root
436
+ ProfileInstance* parent;
410
437
 
411
- /// Keeps track of the statistics of each profile
412
- ProfileHistoryList mProfileHistory;
438
+ ProfileChildren children;
413
439
 
414
- /// We use this for quick look-ups of profiles in the history list
415
- ProfileHistoryMap mProfileHistoryMap;
440
+ ProfileFrame frame;
441
+ ulong frameNumber;
442
+
443
+ ProfileHistory history;
444
+
445
+ /// The time this profile was started
446
+ ulong currTime;
447
+
448
+ /// Represents the total time of all child profiles to subtract
449
+ /// from this profile
450
+ ulong accum;
451
+
452
+ /// The hierarchical level of this profile, 0 being the root profile
453
+ uint hierarchicalLvl;
454
+ };
455
+
456
+ // lol. Uses typedef; put's original container type in name.
457
+ typedef set<String>::type DisabledProfileMap;
458
+ typedef ProfileInstance::ProfileChildren ProfileChildren;
459
+
460
+ ProfileInstance* mCurrent;
461
+ ProfileInstance* mLast;
462
+ ProfileInstance mRoot;
416
463
 
417
464
  /// Holds the names of disabled profiles
418
465
  DisabledProfileMap mDisabledProfiles;
@@ -475,10 +522,6 @@ namespace Ogre {
475
522
  /// Whether this profiler is enabled
476
523
  bool mEnabled;
477
524
 
478
- /// Keeps track of whether this profiler has
479
- /// received a request to be enabled/disabled
480
- bool mEnableStateChangePending;
481
-
482
525
  /// Keeps track of the new enabled/disabled state that the user has requested
483
526
  /// which will be applied after the frame ends
484
527
  bool mNewEnableState;
@@ -60,7 +60,7 @@ namespace Ogre {
60
60
  BitArray(int bits_count) : bits_ptr(NULL) { resize(bits_count); }
61
61
  BitArray& operator=(const BitArray& ba) { bits = ba.bits; bits_ptr = bits.size() > 0 ? &bits.front() : NULL; return *this; }
62
62
 
63
- bool getBit(size_t i) const { return bits_ptr[i >> 3] & bit_mask[i & 7]; }
63
+ bool getBit(size_t i) const { return (bits_ptr[i >> 3] & bit_mask[i & 7]) != 0; }
64
64
  void setBit(size_t i) { bits_ptr[i >> 3] |= bit_mask[i & 7]; }
65
65
  void clearBit(size_t i) { bits_ptr[i >> 3] &= ~bit_mask[i & 7]; }
66
66
  void clearAllBits() { memset(bits_ptr, 0, bits.size()); }
@@ -224,7 +224,7 @@ namespace Ogre {
224
224
 
225
225
  size_t mRemovedVertexDuplicatesCount;
226
226
  size_t mCurrNumIndexes;
227
- float mInvSquaredBoundBoxDiagonal;
227
+ Real mInvSquaredBoundBoxDiagonal;
228
228
  int mVertexComponentFlags;
229
229
 
230
230
  // Internal classes
@@ -1453,10 +1453,27 @@ namespace Ogre
1453
1453
  @see Root::getDisplayMonitorCount
1454
1454
  */
1455
1455
  virtual unsigned int getDisplayMonitorCount() const = 0;
1456
+
1457
+ /**
1458
+ * This marks the beginning of an event for GPU profiling.
1459
+ */
1460
+ virtual void beginProfileEvent( const String &eventName ) = 0;
1461
+
1462
+ /**
1463
+ * Ends the currently active GPU profiling event.
1464
+ */
1465
+ virtual void endProfileEvent( void ) = 0;
1466
+
1467
+ /**
1468
+ * Marks an instantaneous event for graphics profilers.
1469
+ * This is equivalent to calling @see beginProfileEvent and @see endProfileEvent back to back.
1470
+ */
1471
+ virtual void markProfileEvent( const String &event ) = 0;
1472
+
1456
1473
  protected:
1457
1474
 
1458
1475
  /** DepthBuffers to be attached to render targets */
1459
- DepthBufferMap mDepthBufferPool;
1476
+ DepthBufferMap mDepthBufferPool;
1460
1477
 
1461
1478
  /** The render targets. */
1462
1479
  RenderTargetMap mRenderTargets;
@@ -36,7 +36,7 @@ THE SOFTWARE.
36
36
  #include "OgreSceneManagerEnumerator.h"
37
37
  #include "OgreResourceGroupManager.h"
38
38
  #include "OgreLodStrategyManager.h"
39
- #include "OgreWorkQueue.h"
39
+ #include "OgreWorkQueue.h"
40
40
 
41
41
  #include <exception>
42
42
 
@@ -44,9 +44,7 @@ THE SOFTWARE.
44
44
 
45
45
  #include <dirent.h>
46
46
  #include <unistd.h>
47
- #if OGRE_PLATFORM != OGRE_PLATFORM_SYMBIAN
48
47
  #include <fnmatch.h>
49
- #endif
50
48
 
51
49
  /* Our simplified data entry structure */
52
50
  struct _finddata_t
@@ -56,7 +54,6 @@ struct _finddata_t
56
54
  unsigned long size;
57
55
  };
58
56
 
59
- #if OGRE_PLATFORM != OGRE_PLATFORM_SYMBIAN
60
57
  #define _A_NORMAL 0x00 /* Normalfile-Noread/writerestrictions */
61
58
  #define _A_RDONLY 0x01 /* Read only file */
62
59
  #define _A_HIDDEN 0x02 /* Hidden file */
@@ -70,5 +67,3 @@ int _findnext(intptr_t id, struct _finddata_t *data);
70
67
  int _findclose(intptr_t id);
71
68
 
72
69
  #endif
73
-
74
- #endif
@@ -73,7 +73,7 @@ namespace Ogre {
73
73
  /// Named constructor
74
74
  SimpleRenderable(const String& name);
75
75
 
76
- void setMaterial( const String& matName );
76
+ virtual void setMaterial( const String& matName );
77
77
  virtual const MaterialPtr& getMaterial(void) const;
78
78
 
79
79
  virtual void setRenderOperation( const RenderOperation& rend );
@@ -5,7 +5,7 @@
5
5
  #define __STD_ALGORITHM
6
6
  #endif
7
7
 
8
- #if defined ( OGRE_GCC_VISIBILITY ) && (OGRE_PLATFORM != OGRE_PLATFORM_APPLE && OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS)
8
+ #if defined ( OGRE_GCC_VISIBILITY ) && ((OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !__LP64__) && OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS)
9
9
  /* Until libstdc++ for gcc 4.2 is released, we have to declare all
10
10
  * symbols in libstdc++.so externally visible, otherwise we end up
11
11
  * with them marked as hidden by -fvisible=hidden.
@@ -122,7 +122,7 @@ extern "C" {
122
122
  # include "Threading/OgreThreadHeaders.h"
123
123
  #endif
124
124
 
125
- #if defined ( OGRE_GCC_VISIBILITY ) && (OGRE_PLATFORM != OGRE_PLATFORM_APPLE && OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS)
125
+ #if defined ( OGRE_GCC_VISIBILITY ) && ((OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !__LP64__) && OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS)
126
126
  # pragma GCC visibility pop
127
127
  #endif
128
128
  #endif
@@ -200,6 +200,11 @@ namespace Ogre {
200
200
  0.0 if the value could not be parsed, otherwise the numeric version of the String.
201
201
  */
202
202
  static unsigned long parseUnsignedLong(const String& val, unsigned long defaultValue = 0);
203
+ /** Converts a String to size_t.
204
+ @return
205
+ defaultValue if the value could not be parsed, otherwise the numeric version of the String.
206
+ */
207
+ static size_t parseSizeT(const String& val, size_t defaultValue = 0);
203
208
  /** Converts a String to a boolean.
204
209
  @remarks
205
210
  Returns true if case-insensitive match of the start of the string