screen.H

00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2006 by Kristian Spangsege and Brian Kristiansen.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and
00008  * its documentation under the terms of the GNU General Public License is
00009  * hereby granted. No representations are made about the suitability of
00010  * this software for any purpose. It is provided "as is" without express
00011  * or implied warranty. See the GNU General Public License
00012  * (http://www.gnu.org/copyleft/gpl.html) for more details.
00013  *
00014  * The characters in this file are ISO8859-1 encoded.
00015  *
00016  * The documentation in this file is in "Doxygen" style
00017  * (http://www.doxygen.org).
00018  */
00019 
00020 #ifndef ARCHON_DISPLAY_SCREEN_H
00021 #define ARCHON_DISPLAY_SCREEN_H
00022 
00023 #include <stdexcept>
00024 #include <string>
00025 
00026 #include <archon/util/exception.H>
00027 #include <archon/util/ref.H>
00028 #include <archon/display/connection.H>
00029 #include <archon/display/visual.H>
00030 
00031 namespace Archon
00032 {
00033   namespace Display
00034   {
00035     using namespace std;
00036     using namespace Utilities;
00037 
00038     // Fallback declarations. A fallback declaration for class Foo is
00039     // needed when the header that defines Foo includes this
00040     // header. In this case this header will not include "foo.H" due
00041     // to include guards, and Foo would be unknown.
00042     struct Connection;
00043     struct Visual;
00044 
00052     struct NoSuchVisualException: virtual Exception
00053     {
00054       NoSuchVisualException(string l): Exception(l) {}
00055     };
00056 
00057 
00071     struct Screen: virtual RefObjectBase
00072     {
00079       virtual Ref<Connection> getConnection() = 0;
00080 
00088       virtual Ref<Visual> getDefaultVisual() = 0;
00089 
00143       virtual Ref<Visual> chooseVisual(bool doubleBuffer = true,
00144                                        bool stereo = false,
00145                                        int red = 8, int green = 8,
00146                                        int blue = 8, int alpha = 8,
00147                                        int depth = 16, int stencil = 0,
00148                                        int accumRed = 0, int accumGreen = 0,
00149                                        int accumBlue = 0, int accumAlpha = 0)
00150         throw(NoSuchVisualException) = 0;
00151 
00159       virtual int getNumberOfVisuals() = 0;
00160 
00170       virtual Ref<Visual> getVisual(int index) throw(out_of_range) = 0;
00171 
00177       virtual int getWidth() = 0;
00178 
00184       virtual int getHeight() = 0;
00185 
00191       virtual double getHorizontalDotPitch() = 0;
00192 
00198       virtual double getVerticalDotPitch() = 0;
00199     };
00200   }
00201 }
00202 
00203 #endif // ARCHON_DISPLAY_SCREEN_H

Generated on Sun Jul 30 22:55:42 2006 for Archon by  doxygen 1.4.4