00001 //--- < SDSGESDL.H > ------------| ViewGraph - A Flexible Graph view Framework | 00002 // 00003 // And SGE+SDL wrapper for ViewGraph 00004 // 00005 // Note: SDL supports monochrome cursors 00006 // only. 00007 // 00008 // $Author: botik32 $ 00009 // $Revision: 1.4 $ 00010 // $Date: 2004/05/03 21:02:01 $ 00011 //-----------------------------------------------------------------------------/ 00012 #ifndef SDSGESDL_H 00013 #define SDSGESDL_H 00014 00015 #include <cZUI/drivers/sdsdl.h> 00016 #include <SDL/sge.h> 00017 00018 class SDLSGESurfaceDriver : public SDLSurfaceDriver{ 00019 protected: 00020 #ifndef _SGE_NOTTF 00021 sge_TTFont *font; 00022 int fontsz; 00023 #endif 00024 public: 00025 void penstyle( const char * ); 00026 void line( double x1, double y1, double x2, double y2 ); 00027 void rectangle( double x1, double y1, double x2, double y2 ); 00028 void dot( double x1, double y1 ); 00029 void circle( double x1, double y1, int radius ); 00030 void arc( double x1, double y1, int radius, 00031 double an1, double an2 ); 00032 void bezier( double x1, double y1, double x2, double y2, 00033 double x3, double y3 ); 00034 void fill_h_triangle( double x1, double y1, 00035 double x2, double y2, double x3 ); 00036 void fill_v_triangle( double x1, double y1, 00037 double x2, double y2, double y3 ); 00038 void fillrect( double x1, double y1, double x2, double y2, 00039 unsigned char fr, unsigned char fg, unsigned char fb ); 00040 00041 void clear( unsigned char, unsigned char, unsigned char ); 00042 void clear_rect( int, int, int, int, 00043 unsigned char, unsigned char, unsigned char ); 00044 00045 virtual void textout( double x1, double y1, const char *text ); 00046 virtual void textrect( double x1, double y1, 00047 double x2, double y2, const char *text ); 00048 virtual void setfont( const char *font ); 00049 virtual void setfontsize( int ); 00050 virtual void setjustification( textjustify ); 00051 00052 bool rectfits( double, double, double, double ); 00053 00054 void set_background( Uint8, Uint8, Uint8 ); 00055 00056 // Views may take only part of the surface and will 00057 // request clipping 00058 void set_cliprect( int, int, int w, int h ); 00059 void clear_cliprect( void ); 00060 00061 SDLSGESurfaceDriver( int, int ); 00062 SDLSGESurfaceDriver( SDL_Surface * ); 00063 // Override surface width 00064 SDLSGESurfaceDriver( SDL_Surface *, int, int ); 00065 00066 ~SDLSGESurfaceDriver(); 00067 }; 00068 00069 #endif 00070 00071 // $Log: sdsgesdl.h,v $ 00072 // Revision 1.4 2004/05/03 21:02:01 botik32 00073 // Significant changes and many bugfixes. 00074 // ScrollableView now has a background color used to 00075 // tell SurfaceDriver to clear with. 00076 // SurfaceDriver's clear() requires a color now 00077 // Added SceneEvents for all node additions/removals 00078 // in GroupNode and Camera. 00079 // Added paint_selected and paint_selected_invalid 00080 // to ActiveLeaf 00081 // Modified ActiveLeaf's mouse_down and mouse_up 00082 // handler signatures to accept an Event* instead of 00083 // Camera* 00084 // - Many more bugfixes 00085 // 00086 // Revision 1.3 2004/04/15 10:31:29 botik32 00087 // Interface change: added arc() function to surfacedriver. 00088 // 00089 // Revision 1.2 2004/04/14 14:58:17 botik32 00090 // Changes to SGE driver's font handling to improve speed 00091 // and usability. 00092 // Changes in scrollableview,zoomablesurfaceview regarding 00093 // debugging (added then removed) so this is a non-change. 00094 // 00095 // Revision 1.1.1.1 2004/03/26 10:50:26 botik32 00096 // Initial release 00097 // 00098 // Revision 1.1.1.1 2004/03/26 08:53:33 botik 00099 // initial import 00100 // 00101 // 00102 // Revision 1.7 2004/03/17 09:56:38 botik 00103 // Demo now shows camera in the small window 00104 // ScrollableView: added clear_surface() and update_surface() 00105 // functions 00106 // GraphWindow: calls clear_surface() and update_surface() on update. 00107 // 00108 // Revision 1.6 2004/03/15 18:06:25 botik 00109 // Activeleaf.cpp: removed bug causing problems with memory 00110 // Context.cpp: added include of assert.h 00111 // Graphwindow.h, graphwindow.cpp: added update policy class, 00112 // now a window has its own update policy, which can be 00113 // always/ fixed rate. 00114 // Timedeventmanager.cpp: fixed a bug causing memory corruption 00115 // 00116 // Revision 1.5 2004/03/10 08:51:34 botik 00117 // Streamlined the makefiles 00118 // Addeda new target to the main makefile: libczui.a 00119 // Changed location of images in the imagehud for sge 00120 // 00121 // Revision 1.4 2004/03/09 18:22:13 botik 00122 // Added rectangle boundary increment for sdsdl's clear_rect 00123 // function 00124 // sdsgesdl now compiles 00125 //