Thread: [Gcblue-commits] gcb_wx/include/graphics tc3DWindow.h,1.2,1.3 tcCreditView.h,1.1,1.2 tcStartView.h,1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-09-16 02:25:02
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11156/include/graphics Modified Files: tc3DWindow.h tcCreditView.h tcStartView.h Log Message: Index: tcStartView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStartView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStartView.h 5 Sep 2004 01:02:00 -0000 1.1 --- tcStartView.h 16 Sep 2004 02:24:49 -0000 1.2 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcStartView.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 26,42 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif ! #include "tcwindow.h" ! #include "aerror.h" #include "tcString.h" class tcOptions; ! class tcStartView : public tcWindow { public: ! // placement info for GUI buttons, text, etc. struct tsButtonInfo { --- 28,49 ---- #include "wx/wx.h" ! ! #include "tc3DWindow.h" ! #include "AError.h" #include "tcString.h" + namespace osg + { + class Texture2D; + } + class tcOptions; ! class tcStartView : public tc3DWindow { public: ! /** ! * placement info for GUI buttons, text, etc. ! */ struct tsButtonInfo { *************** *** 48,54 **** int mnButtonWidth; int mnButtonHeight; ! Gdiplus::Image *mpiButtonOn; ! Gdiplus::Image *mpiButtonOver; ! Gdiplus::Image *mpiButtonOff; int mnState; }; --- 55,61 ---- int mnButtonWidth; int mnButtonHeight; ! osg::ref_ptr<osg::Texture2D> mpiButtonOn; ! osg::ref_ptr<osg::Texture2D> mpiButtonOver; ! osg::ref_ptr<osg::Texture2D> mpiButtonOff; int mnState; }; *************** *** 59,74 **** void AttachOptions(tcOptions *apOptions) {mpOptions=apOptions;} ! bool Init(void); ! int Draw(void); ! void DrawButton(Gdiplus::Graphics *apGraphics, int anButton); ! void DrawButtonLine(Gdiplus::Graphics *apGraphics, int anButton); int GetActiveButton(void) {return mnActiveButton;} void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! void PlaceButtons(void); bool ButtonContainingPoint(wxPoint point, int& rnButton); tcStartView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "StartView"); virtual ~tcStartView(); --- 66,81 ---- void AttachOptions(tcOptions *apOptions) {mpOptions=apOptions;} ! bool Init(); ! int Draw(); ! void DrawButton(int anButton); ! void DrawButtonLine(int anButton); int GetActiveButton(void) {return mnActiveButton;} void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! void PlaceButtons(); bool ButtonContainingPoint(wxPoint point, int& rnButton); + tcStartView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, const wxString& name = "tc3DWindow"); virtual ~tcStartView(); *************** *** 76,85 **** enum {N_START_BUTTONS = 6}; tcOptions *mpOptions; - Gdiplus::SolidBrush *mpBrush; - Gdiplus::Font *mpFont; - Gdiplus::Pen *mpPen; tsButtonInfo maButton[N_START_BUTTONS]; ! int mnXStart,mnYStart; }; #endif \ No newline at end of file --- 83,91 ---- enum {N_START_BUTTONS = 6}; tcOptions *mpOptions; tsButtonInfo maButton[N_START_BUTTONS]; ! int mnXStart; ! int mnYStart; ! const int buttonSize; }; #endif \ No newline at end of file Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DWindow.h 14 Sep 2004 23:17:16 -0000 1.2 --- tc3DWindow.h 16 Sep 2004 02:24:49 -0000 1.3 *************** *** 34,37 **** --- 34,38 ---- #include <osg/ref_ptr> + #include <osgText/Text> #include "common/simmath.h" *************** *** 59,62 **** --- 60,66 ---- #define IMAGE_PATH "images\\" + using osgText::Text::LEFT_BASE_LINE; + using osgText::Text::CENTER_CENTER; + /** * Window class for drawing to a 3D OSG scenegraph. *************** *** 67,70 **** --- 71,75 ---- { public: + enum {CENTER = 0, ALIGN_BOTTOM_LEFT = 1}; bool mbActive; tcRect mrectDisplay; *************** *** 77,81 **** void DrawBorder(); ! void DrawImage(osg::Texture2D* texture, float x, float y, float width, float height); void DrawLine(float x1, float y1, float x2, float y2, const osg::Vec4& color); --- 82,87 ---- void DrawBorder(); ! void DrawImage(osg::Texture2D* texture, float x, float y, float width, float height, ! int alignMode = CENTER); void DrawLine(float x1, float y1, float x2, float y2, const osg::Vec4& color); *************** *** 104,107 **** --- 110,114 ---- void LoadBackgroundImage(char* fileName); osg::Image* LoadImage(const char* fileName); + osg::Texture2D* LoadTexture(const char* fileName); virtual void Maximize(); virtual void Minimize(); *************** *** 157,160 **** --- 164,168 ---- static tc3DViewer* viewer; + void HideUnusedObjects(); wxString PrependImagePath(const char* fileName); virtual void OnChar(wxKeyEvent& event); *************** *** 194,200 **** - osgText::Text::AlignmentType LEFT_BASE_LINE; - osgText::Text::AlignmentType CENTER_CENTER; - void CreateBackgroundQuad(); void UpdateBackgroundQuadVertices(); --- 202,205 ---- *************** *** 205,209 **** osgText::Text* GetTextObject(); - void HideUnusedObjects(); void InitGraphicsObjects(); --- 210,213 ---- Index: tcCreditView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcCreditView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcCreditView.h 5 Sep 2004 01:02:00 -0000 1.1 --- tcCreditView.h 16 Sep 2004 02:24:49 -0000 1.2 *************** *** 26,35 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" //for MS Windows specific definitions ! #endif ! #include "tcwindow.h" #include "tcSound.h" ! #include "aerror.h" #include "tcString.h" --- 26,33 ---- #include "wx/wx.h" ! ! #include "tc3DWindow.h" #include "tcSound.h" ! #include "AError.h" #include "tcString.h" *************** *** 37,41 **** * View window to display scrolling credits */ ! class tcCreditView : public tcWindow { struct tsCreditInfo --- 35,39 ---- * View window to display scrolling credits */ ! class tcCreditView : public tc3DWindow { struct tsCreditInfo *************** *** 51,68 **** void OnLButtonDown(wxMouseEvent& event); void Rewind(); ! tcCreditView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "CreditView", ! tcWindow *sharedSurface = NULL); ! virtual ~tcCreditView(void); private: enum {MAX_CREDITS = 96}; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Font *mpFontLarge; ! Gdiplus::Font *mpFontSmall; ! Gdiplus::Pen *mpPen; ! UINT32 mnStartTime; // 30 Hz counter to mark start of sequence ! int mnXStart,mnYStart; tcString crawlstring; tsCreditInfo maCredit[MAX_CREDITS]; --- 49,66 ---- void OnLButtonDown(wxMouseEvent& event); void Rewind(); ! ! tcCreditView(wxWindow* parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "CreditView"); ! virtual ~tcCreditView(); private: enum {MAX_CREDITS = 96}; ! //Gdiplus::SolidBrush *mpBrush; ! //Gdiplus::Font *mpFont; ! //Gdiplus::Font *mpFontLarge; ! //Gdiplus::Font *mpFontSmall; ! //Gdiplus::Pen *mpPen; ! unsigned int mnStartTime; // 30 Hz counter to mark start of sequence ! int mnXStart, mnYStart; tcString crawlstring; tsCreditInfo maCredit[MAX_CREDITS]; |