Torque3D Documentation / _generateds / gfxDebugEvent.h

gfxDebugEvent.h

Engine/source/gfx/gfxDebugEvent.h

More...

Public Defines

define
define
define

See TorqueConfig.h to enable this.

Detailed Description

Public Defines

GFXDEBUGEVENT_END() 
GFXDEBUGEVENT_MARKER(n, c) 
GFXDEBUGEVENT_SCOPE(n, c) 
GFXDEBUGEVENT_SCOPE_EX(n, c, d) 
GFXDEBUGEVENT_START(n, c) 

See TorqueConfig.h to enable this.

These are disabled in shipping builds or maybe you forgot to include "platform/platform.h" first?

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _GFXDEBUGEVENT_H_
25#define _GFXDEBUGEVENT_H_
26
27#ifndef _GFXDEVICE_H_
28#include "gfx/gfxDevice.h"
29#endif
30
31/// See TorqueConfig.h to enable this.
32#ifdef TORQUE_ENABLE_GFXDEBUGEVENTS
33
34
35/// You shouldn't use this class directly... use the 
36/// following macros:
37///
38/// GFXDEBUGEVENT_START / GFXDEBUGEVENT_END
39/// GFXDEBUGEVENT_SCOPE
40///
41class GFXDebugEventScope
42{
43public:
44   GFXDebugEventScope( const char* name, const ColorI &color ) 
45   {
46      GFX->enterDebugEvent( color, name );
47   }
48
49   ~GFXDebugEventScope() 
50   {
51      GFX->leaveDebugEvent();
52   }
53};
54
55#define GFXDEBUGEVENT_START( name, color ) GFX->enterDebugEvent( color, #name )
56
57#define GFXDEBUGEVENT_END() GFX->leaveDebugEvent()
58
59#define GFXDEBUGEVENT_MARKER( name, color ) GFX->setDebugMarker( color, #name )
60
61
62///
63/// Will add start/end GFX debug events around the 
64/// current scope.
65///
66/// @param name   The unquoted name for the event.
67/// @param color  A ColorI to associate with the event.
68///
69#define GFXDEBUGEVENT_SCOPE( name, color ) GFXDebugEventScope GFXDebugEventScope##name##Obj( #name, color )
70#define GFXDEBUGEVENT_SCOPE_EX( name, color, desc ) GFXDebugEventScope GFXDebugEventScope##name##Obj( desc, color )
71
72#else // !TORQUE_ENABLE_GFXDEBUGEVENTS
73
74   /// These are disabled in shipping builds or maybe you
75   /// forgot to include "platform/platform.h" first?
76   #define GFXDEBUGEVENT_START(n,c)
77   #define GFXDEBUGEVENT_END()
78   #define GFXDEBUGEVENT_MARKER(n,c)
79   #define GFXDEBUGEVENT_SCOPE(n,c)
80   #define GFXDEBUGEVENT_SCOPE_EX(n,c,d)
81
82#endif
83
84#endif // _GFXDEBUGEVENT_H_
85