Blender V2.61 - r43446

GlutDrawer.cpp

Go to the documentation of this file.
00001 
00028 #include "GlutDrawer.h"
00029 #include "MT_assert.h"
00030 
00031 MEM_SmartPtr<GlutDrawManager> GlutDrawManager::m_s_instance = MEM_SmartPtr<GlutDrawManager>();
00032 
00033     GlutDrawManager *
00034 GlutDrawManager::
00035 Instance(
00036 ){
00037     if (m_s_instance == NULL) {
00038         m_s_instance = new GlutDrawManager();
00039     }
00040 
00041     return m_s_instance;
00042 }
00043 
00044 
00045 // this is the function you should pass to glut
00046 
00047     void
00048 GlutDrawManager::
00049 Draw(
00050 ){
00051     GlutDrawManager *manager = GlutDrawManager::Instance();
00052 
00053     if (manager->m_drawer != NULL) {
00054         manager->m_drawer->Draw();
00055     }
00056 }
00057 
00058     void
00059 GlutDrawManager::
00060 InstallDrawer(
00061     GlutDrawer * drawer
00062 ){
00063 
00064     MT_assert(m_drawer == NULL);
00065     m_drawer = drawer;
00066 }
00067 
00068     void
00069 GlutDrawManager::
00070 ReleaseDrawer(
00071 ){
00072     m_drawer = NULL;
00073 }
00074 
00075 
00076 GlutDrawManager::
00077 ~GlutDrawManager(
00078 ){
00079 
00080     delete(m_drawer);
00081 }
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090