1 /**************************************************************************
3 * Copyright 2013-2014 RAD Game Tools and Valve Software
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 **************************************************************************/
26 #ifndef VOGLEDITOR_SNAPSHOTITEM_H
27 #define VOGLEDITOR_SNAPSHOTITEM_H
31 // external classes (could be predeclared)
32 #include "vogl_common.h"
33 #include "vogleditor_gl_state_snapshot.h"
35 // base class for items that might have a snapshot
36 class vogleditor_snapshotItem
39 vogleditor_snapshotItem()
44 virtual ~vogleditor_snapshotItem()
46 if (m_pSnapshot != NULL)
48 vogl_delete(m_pSnapshot);
53 virtual bool needs_snapshot()
55 if (has_snapshot() && get_snapshot()->is_valid())
61 virtual void set_snapshot(vogleditor_gl_state_snapshot* pSnapshot)
63 if (m_pSnapshot != NULL)
65 vogl_delete(m_pSnapshot);
68 m_pSnapshot = pSnapshot;
71 virtual bool has_snapshot() const
73 return (m_pSnapshot != NULL);
76 virtual vogleditor_gl_state_snapshot* get_snapshot() const
82 vogleditor_gl_state_snapshot* m_pSnapshot;
85 #endif // VOGLEDITOR_SNAPSHOTITEM_H