root/cafu/trunk/Ca3DE/AppCafu.hpp

Revision 457, 3.7 KB (checked in by Carsten, 4 months ago)

Using UltraEdit's multi-line search-and-replace-in-files feature, replaced


^#ifndef _(CAFU|CF|CFS|CA)_(.*)_$
^#define _\1_\2_$

with

#ifndef CAFU_\2_INCLUDED
#define CAFU_\2_INCLUDED

and


^#ifndef _(.*)_HPP_$
^#define _\1_HPP_$

with

#ifndef CAFU_\1_HPP_INCLUDED
#define CAFU_\1_HPP_INCLUDED

Closes #91.

Line 
1/*
2=================================================================================
3This file is part of Cafu, the open-source game engine and graphics engine
4for multiplayer, cross-platform, real-time 3D action.
5Copyright (C) 2002-2012 Carsten Fuchs Software.
6
7Cafu is free software: you can redistribute it and/or modify it under the terms
8of the GNU General Public License as published by the Free Software Foundation,
9either version 3 of the License, or (at your option) any later version.
10
11Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Cafu. If not, see <http://www.gnu.org/licenses/>.
17
18For support and more information about Cafu, visit us at <http://www.cafu.de>.
19=================================================================================
20*/
21
22/**************************************/
23/***                                ***/
24/***          Cafu Engine           ***/
25/***                                ***/
26/*** Dass ich erkenne, was die Welt ***/
27/*** im Innersten zusammenhält.     ***/
28/*** (Faust)                        ***/
29/***                                ***/
30/**************************************/
31
32#ifndef CAFU_APP_CAFU_HPP_INCLUDED
33#define CAFU_APP_CAFU_HPP_INCLUDED
34
35#include "wx/app.h"
36#include "wx/display.h"
37
38
39namespace cf { class CompositeConsoleT; }
40namespace cf { class ConsoleFileT; }
41namespace cf { class ConsoleStringBufferT; }
42class MainFrameT;
43
44
45/// This class represents the Cafu Engine application.
46class AppCafuT : public wxApp
47{
48    public:
49
50    AppCafuT();
51    ~AppCafuT();
52
53    /// Returns the composite console that is also available via the global Console pointer.
54    cf::CompositeConsoleT& GetConComposite() const;
55
56    /// Returns the console that buffers all output.
57    cf::ConsoleStringBufferT& GetConBuffer() const { return *m_ConBuffer; }
58
59    // /// Returns the console that logs all output into a file (can be NULL if not used).
60    // cf::ConsoleFileT& GetConFile() const { return *m_ConFile; }
61
62    /// Returns whether we successfully set a custom video mode (screen resolution) during initialization.
63    bool IsCustomVideoMode() const { return m_IsCustomVideoMode; }
64
65    /// This method returns the current video mode, which may be identical to the desktops video mode
66    /// (in which case the mode as not switched at all at app init), or any custom mode.
67    const wxVideoMode& GetCurrentMode() const { return m_CurrentMode; }
68
69    /// Returns the main frame of the Cafu application.
70    MainFrameT* GetMainFrame() const { return m_MainFrame; }
71
72    bool OnInit();
73    int  OnExit();
74
75
76    private:
77
78    void OnInitCmdLine(wxCmdLineParser& Parser);
79    bool OnCmdLineParsed(wxCmdLineParser& Parser);
80
81    wxLocale*                 m_Locale;
82    cf::ConsoleStringBufferT* m_ConBuffer;          ///< The console that buffers all output.
83    cf::ConsoleFileT*         m_ConFile;            ///< The console that logs all output into a file (can be NULL if not used).
84    bool                      m_IsCustomVideoMode;  ///< Whether we successfully set a custom video mode (screen resolution) during initialization.
85    wxVideoMode               m_CurrentMode;        ///< The video mode that we're currently using.
86    MainFrameT*               m_MainFrame;          ///< The Cafu application main frame.
87};
88
89
90/// This macro provides the wxGetApp() function which returns a reference to our AppCafuT instance.
91DECLARE_APP(AppCafuT)
92
93#endif
Note: See TracBrowser for help on using the browser.