context.H

00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2002 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_RENDER_CONTEXT_H
00021 #define ARCHON_RENDER_CONTEXT_H
00022 
00023 #include <archon/display/context.H>
00024 
00025 #include <archon/render/view.H>
00026 
00027 namespace Archon
00028 {
00029   namespace Render
00030   {
00031     struct Conductor;
00032 
00033 
00038     struct Channel
00039     {
00040     private:
00041       friend struct Pipe;
00042 
00043       Channel(Ref<View> view, Ref<Display::Window> window,
00044               Ref<Viewport> viewport, Ref<Screen> screen, Ref<Eye> eye,
00045               Ref<Clip> clip):
00046         view(view), window(window), viewport(viewport),
00047         screen(screen), eye(eye), clip(clip) {}
00048 
00049       void render(const Ref<Pipe> &);
00050 
00051       Ref<View> view;
00052       Ref<Display::Window> window;
00053       Ref<Viewport> viewport;
00054       Ref<Screen> screen;
00055       Ref<Eye> eye;
00056       Ref<Clip> clip;
00057     };
00058 
00059 
00070     struct Pipe: RefObjectBase
00071     {
00079       void addChannel(Ref<Conductor>, Ref<View>,
00080                       Ref<Display::Window>,
00081                       Ref<Viewport>, Ref<Screen>,
00082                       Ref<Eye>, Ref<Clip>);
00083 
00084     private:
00085       friend struct Conductor;
00086 
00087       Pipe(Ref<Display::Visual> visual, bool direct, Ref<Pipe> master):
00088         context(master ? visual->newContext(direct, master->context) : visual->newContext(direct)), initialized(false) {}
00089 
00090       void render();
00091 
00092       Ref<Display::Context> context;
00093 
00094       Mutex channelMutex;
00095       vector<Channel> channels;
00096 
00097       friend struct Channel;
00098 
00102       bool initialized;
00103     };
00104   }
00105 }
00106 
00107 #endif // ARCHON_RENDER_CONTEXT_H

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