fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / WindowSystem / EAGL / OSGEAGLWindow.mm
blob425117b1e2fb02bb7cf3265df2a47e25678f50bf
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *               Copyright (C) 2000-2006 by the OpenSG Forum                 *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
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.                               *
18  *                                                                           *
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.                          *
23  *                                                                           *
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.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
39 //---------------------------------------------------------------------------
40 //  Includes
41 //---------------------------------------------------------------------------
43 #include <cstdlib>
44 #include <cstdio>
46 #include "OSGConfig.h"
48 // Forget everything if we're not doing a Mac OS X compile
49 #ifdef __APPLE__
51 //#import <Cocoa/Cocoa.h>
52 //#import <AppKit/NSOpenGL.h>
54 #include "OSGEAGLWindow.h"
55 #include "OSGEAGLWindowWrapper.h"
57 OSG_BEGIN_NAMESPACE
59 // Documentation for this class is emitted in the
60 // OSGEAGLWindowBase.cpp file.
61 // To modify it, please change the .fcd file (OSGEAGLWindow.fcd) and
62 // regenerate the base file.
64 /***************************************************************************\
65  *                           Class variables                               *
66 \***************************************************************************/
68 /***************************************************************************\
69  *                           Class methods                                 *
70 \***************************************************************************/
72 void EAGLWindow::initMethod(InitPhase ePhase)
74     Inherited::initMethod(ePhase);
76     if(ePhase == TypeObject::SystemPost)
77     {
78     }
82 /***************************************************************************\
83  *                           Instance methods                              *
84 \***************************************************************************/
86 /*-------------------------------------------------------------------------*\
87  -  private                                                                 -
88 \*-------------------------------------------------------------------------*/
90 /*----------------------- constructors & destructors ----------------------*/
92 EAGLWindow::EAGLWindow(void) :
93     Inherited()
97 EAGLWindow::EAGLWindow(const EAGLWindow &source) :
98     Inherited(source)
102 EAGLWindow::~EAGLWindow(void)
106 /*----------------------------- class specific ----------------------------*/
108 void EAGLWindow::changed(ConstFieldMaskArg whichField, 
109                          UInt32            origin,
110                          BitVector         details)
112     Inherited::changed(whichField, origin, details);
115 void EAGLWindow::dump(      UInt32    ,
116                          const BitVector ) const
118     SLOG << "Dump EAGLWindow NI" << std::endl;
121 /*-------------------------- your_category---------------------------------*/
123 /*! Init the window: create the context and setup the OpenGL.
125 void EAGLWindow::init(GLInitFunctor oFunc)
127     Inherited::init(oFunc);
130 void EAGLWindow::terminate(void)
134 // activate the window: bind the OGL context
135 void EAGLWindow::doActivate(void)
137 //    [this->getContext() makeCurrentContext];
140 // activate the window: bind the OGL context
141 void EAGLWindow::doDeactivate(void)
143 //    [EAGLContext clearCurrentContext];
146 // swap front and back buffers
147 bool EAGLWindow::doSwap(void)
149 //    [this->getContext() flushBuffer];
151     return true;
154 bool EAGLWindow::hasContext(void)
156 //    return (this->getContext() != NULL);
158     return true;
161 OSG_END_NAMESPACE
163 #endif // __APPLE__