1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
46 #include "OSGConfig.h"
48 #include "OSGWindowDrawThread.h"
49 #include "OSGThreadManager.h"
50 #include "OSGWindow.h"
54 /***************************************************************************\
56 \***************************************************************************/
58 MPThreadType
WindowDrawThread::_type(
59 "OSGWindowDrawThread",
60 "OSGHardwareContextThread",
61 static_cast<CreateThreadF
>(WindowDrawThread::create
),
64 /***************************************************************************\
66 \***************************************************************************/
68 /***************************************************************************\
70 \***************************************************************************/
72 /*-------------------------------------------------------------------------*\
74 \*-------------------------------------------------------------------------*/
76 WindowDrawThread
*WindowDrawThread::find(Char8
*szName
)
78 BaseThread
*pThread
= ThreadManager::the()->findThread(szName
);
80 return dynamic_cast<WindowDrawThread
*>(pThread
);
83 WindowDrawThread::ObjTransitPtr
WindowDrawThread::get(Char8
*szName
,
86 BaseThreadTransitPtr pThread
=
87 ThreadManager::the()->getThread(szName
,
89 "OSGWindowDrawThread");
91 return dynamic_pointer_cast
<WindowDrawThread
>(pThread
);
96 BaseThread
*WindowDrawThread::create(const Char8
*szName
,
100 return new WindowDrawThread(szName
, uiId
, bGlobal
);
103 WindowDrawThread::WindowDrawThread(const Char8
*szName
,
111 Inherited::_pEnv
= &_oEnv
;
114 WindowDrawThread::~WindowDrawThread(void)
116 Inherited::_pEnv
= NULL
;
119 void WindowDrawThread::setWindow (Window
*pWindow
)
121 Inherited::setContext(pWindow
);
123 _oEnv
.setWindow(pWindow
);