visual.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_VISUAL_H
00021 #define ARCHON_DISPLAY_VISUAL_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/screen.H>
00029 #include <archon/display/window.H>
00030 #include <archon/display/context.H>
00031 
00032 namespace Archon
00033 {
00034   namespace Display
00035   {
00036     using namespace std;
00037     using namespace Utilities;
00038 
00039     // Fallback declarations. A fallback declaration for class Foo is
00040     // needed when the header that defines Foo includes this
00041     // header. In this case this header will not include "foo.H" due
00042     // to include guards, and Foo would be unknown.
00043     struct Screen;
00044     struct Window;
00045     struct Context;
00046 
00047 
00054     struct NoWindowsException: virtual Exception
00055     {
00056       NoWindowsException(string l): Exception(l) {}
00057     };
00058 
00059 
00075     struct Visual: virtual RefObjectBase
00076     {
00083       virtual Ref<Screen> getScreen() = 0;
00084 
00112       virtual Ref<Window> newWindow(int left, int top,
00113                                     int width, int height,
00114                                     string title = "")
00115         throw(NoWindowsException) = 0;
00116 
00137       virtual Ref<Context> newContext(bool direct = true,
00138                                       Ref<Context> shareWith = 0)
00139         throw(invalid_argument) = 0;
00140 
00141 
00148       virtual int getRedBufferSize() = 0;
00149 
00156       virtual int getGreenBufferSize() = 0;
00157 
00164       virtual int getBlueBufferSize() = 0;
00165 
00172       virtual int getAlphaBufferSize() = 0;
00173 
00180       virtual int getDepthBufferSize() = 0;
00181 
00188       virtual int getStencilBufferSize() = 0;
00189 
00196       virtual int getAccumRedBufferSize() = 0;
00197 
00204       virtual int getAccumGreenBufferSize() = 0;
00205 
00212       virtual int getAccumBlueBufferSize() = 0;
00213 
00220       virtual int getAccumAlphaBufferSize() = 0;
00221     };
00222   }
00223 }
00224 
00225 #endif // ARCHON_DISPLAY_VISUAL_H

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