00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "OSDLBaseGUIView.h"
00028
00029
00030
00031 using namespace OSDL::Rendering ;
00032
00033
00034
00035 #ifdef OSDL_USES_CONFIG_H
00036 #include <OSDLConfig.h>
00037 #endif // OSDL_USES_CONFIG_H
00038
00039
00040 #if OSDL_USES_AGAR
00041
00042 #include <agar/config/have_opengl.h>
00043
00044 #include <agar/core.h>
00045 #include <agar/gui.h>
00046 #include <agar/gui/opengl.h>
00047
00048 #endif // OSDL_USES_AGAR
00049
00050
00051 #include "Ceylan.h"
00052
00053 using namespace Ceylan::Log ;
00054
00055 using std::string ;
00056
00057
00058
00059 BaseGUIView::BaseGUIView()
00060 {
00061
00062
00063
00064
00065
00066
00067
00068 }
00069
00070
00071
00072 BaseGUIView::~BaseGUIView() throw()
00073 {
00074
00075 }
00076
00077
00078
00079 void BaseGUIView::render()
00080 {
00081
00082 #if OSDL_USES_AGAR
00083
00084
00085
00086 AG_Driver * agarDriver = AGDRIVER( agDriverSw ) ;
00087
00088 AG_BeginRendering( agarDriver ) ;
00089
00090 AG_LockVFS( agarDriver ) ;
00091
00092 AG_Window * win ;
00093
00094 AG_FOREACH_WINDOW( win, agarDriver )
00095 {
00096
00097 AG_ObjectLock( win ) ;
00098 AG_WindowDraw( win ) ;
00099 AG_ObjectUnlock( win ) ;
00100
00101 }
00102
00103 AG_UnlockVFS( agarDriver ) ;
00104
00105 AG_EndRendering( agarDriver ) ;
00106
00107
00108
00109 #else // OSDL_USES_AGAR
00110
00111 throw GUIException(
00112 "BaseGUIView::render failed: no GUI support available." ) ;
00113
00114 #endif // OSDL_USES_AGAR
00115
00116 }
00117
00118
00119
00120 const std::string BaseGUIView::toString( Ceylan::VerbosityLevels level ) const
00121 {
00122
00123 return "Base GUI View." ;
00124
00125 }