~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to libddmsimple/ddmsimple.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
Import upstream version 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Aqsis
 
2
// Copyright � 1997 - 2001, Paul C. Gregory
 
3
//
 
4
// Contact: pgregory@aqsis.com
 
5
//
 
6
// This library is free software; you can redistribute it and/or
 
7
// modify it under the terms of the GNU General Public
 
8
// License as published by the Free Software Foundation; either
 
9
// version 2 of the License, or (at your option) any later version.
 
10
//
 
11
// This library is distributed in the hope that it will be useful,
 
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
// General Public License for more details.
 
15
//
 
16
// You should have received a copy of the GNU General Public
 
17
// License along with this library; if not, write to the Free Software
 
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 
 
20
 
 
21
/** \file
 
22
                \brief Simple example display device manager.
 
23
                \author Paul C. Gregory (pgregory@aqsis.com)
 
24
*/
 
25
 
 
26
//? Is .h included already?
 
27
#ifndef DDMSIMPLE_H_INCLUDED
 
28
#define DDMSIMPLE_H_INCLUDED 1
 
29
 
 
30
#include        <vector>
 
31
 
 
32
#include        "aqsis.h"
 
33
#include        "color.h"
 
34
#include        "ri.h"
 
35
#include        "iddmanager.h"
 
36
#include        "ishaderexecenv.h"
 
37
 
 
38
START_NAMESPACE( Aqsis )
 
39
 
 
40
 
 
41
//---------------------------------------------------------------------
 
42
/** \struct SqDDevice
 
43
 * Simple structure storing display device request.
 
44
 */
 
45
 
 
46
struct SqDDevice
 
47
{
 
48
    SqDDevice()
 
49
    {}
 
50
    SqDDevice( const TqChar* name, const TqChar* type, const TqChar* mode ) :
 
51
            m_strName( name ),
 
52
            m_strType( type ),
 
53
            m_strMode( mode ),
 
54
            m_pData( 0 )
 
55
    {}
 
56
 
 
57
    CqString    m_strName;
 
58
    CqString    m_strType;
 
59
    CqString    m_strMode;
 
60
    unsigned char*      m_pData;
 
61
    TqInt       m_XRes;
 
62
    TqInt       m_YRes;
 
63
    TqInt       m_SamplesPerElement;
 
64
};
 
65
 
 
66
 
 
67
//---------------------------------------------------------------------
 
68
/** \class CqDDManagerSimple
 
69
 * Class providing display device management to the renderer.
 
70
 */
 
71
 
 
72
class CqDDManagerSimple : public IqDDManager
 
73
{
 
74
public:
 
75
    CqDDManagerSimple()
 
76
    {}
 
77
    virtual ~CqDDManagerSimple()
 
78
    {}
 
79
 
 
80
    // Overridden from IqDDManager
 
81
 
 
82
 
 
83
 
 
84
    virtual     TqInt   Initialise();
 
85
    virtual     TqInt   Shutdown();
 
86
    virtual     TqInt   AddDisplay( const TqChar* name, const TqChar* type, const TqChar* mode, TqInt modeID, TqInt dataOffset, TqInt dataSize, std::map<std::string, void*> mapOfArguments );
 
87
    virtual     TqInt   ClearDisplays();
 
88
    virtual     TqInt   OpenDisplays();
 
89
    virtual     TqInt   CloseDisplays();
 
90
    virtual     TqInt   DisplayBucket( IqBucket* pBucket );
 
91
    virtual     TqBool  fDisplayNeeds( const TqChar* var );
 
92
    virtual     TqInt   Uses()
 
93
    {
 
94
        return( EnvVars_Ci | EnvVars_Oi );
 
95
    }
 
96
 
 
97
private:
 
98
    std::vector<SqDDevice>      m_aDisplayRequests;             ///< Array of requested display drivers.
 
99
}
 
100
;
 
101
 
 
102
 
 
103
END_NAMESPACE( Aqsis )
 
104
 
 
105
#endif  // DDSERVER_H_INCLUDED
 
106