[Gcblue-commits] gcb_wx/include/graphics tc3DWindow.h,1.12,1.13 tcGraphicsEngine.h,1.14,1.15 tcMapVi
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-02-20 21:55:13
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18469/include/graphics Modified Files: tc3DWindow.h tcGraphicsEngine.h tcMapView.h tcTerrainView.h Removed Files: tc2DGraphicsSurface.h tcWindow.h Log Message: Final GDI+ removal --- tcWindow.h DELETED --- --- tc2DGraphicsSurface.h DELETED --- Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tc3DWindow.h 21 Dec 2004 02:26:17 -0000 1.12 --- tc3DWindow.h 20 Feb 2005 21:54:31 -0000 1.13 *************** *** 99,102 **** --- 99,109 ---- void DrawImageR(osg::Texture2D* texture, float x, float y, float width, float height, int alignMode = CENTER); + + void DrawZoomedImage(osg::Texture2D* texture, float x, float y, float width, float height, + const tcRect& r, int alignMode = CENTER); + + /// workaround method for inverted coordinates + void DrawZoomedImageR(osg::Texture2D* texture, float x, float y, float width, float height, + const tcRect& r, int alignMode = CENTER); void DrawLine(float x1, float y1, float x2, float y2, const osg::Vec4& color); *************** *** 175,180 **** wxRealPoint RelativeToScreen(float x, float y); ! bool GetBlend(); ! void SetBlend(bool blendingOn); int GetBaseRenderBin() const; virtual void SetBaseRenderBin(int n); --- 182,187 ---- wxRealPoint RelativeToScreen(float x, float y); ! bool GetBlend() const; ! void SetBlend(bool blend); int GetBaseRenderBin() const; virtual void SetBaseRenderBin(int n); *************** *** 219,223 **** /// @see tc3DWindow::OnSize view OnSize method code to see how this is used bool resizeable2DSurface; ! float fontSize; ///< default normal font size float fontSizeLarge; ///< default large font size --- 226,230 ---- /// @see tc3DWindow::OnSize view OnSize method code to see how this is used bool resizeable2DSurface; ! bool blendingOn; ///< true to enable alpha blending for window float fontSize; ///< default normal font size float fontSizeLarge; ///< default large font size Index: tcTerrainView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcTerrainView.h 2 Oct 2004 22:41:32 -0000 1.1 --- tcTerrainView.h 20 Feb 2005 21:54:32 -0000 1.2 *************** *** 33,78 **** #endif #include "simmath.h" - #include "tcwindow.h" #include "tcMapData.h" class tcOptions; - class tcGraphicsEngine; namespace MapView { ! struct tsTerrainViewParameters ! { ! int mnSurfaceWidth; ! int mnSurfaceHeight; ! tcGeoRect mrectGeo; ! Gdiplus::RectF mrectDisplay; ! }; ! class tcTerrainView : public tcWindow ! { ! public: ! tcGeoRect mrectCurrentView; ! bool mbHighRes; ! void GetViewParameters(tsTerrainViewParameters& vp); ! void AttachMapData(tcMapData *apMapData) {mpMapData = apMapData;} ! void AttachOptions(tcOptions *pOptions) {mpOptions = pOptions;} ! int LoadHighResSurface(); ! int LoadLowResSurface(); ! void Minimize(); ! int RefreshSurfaces(); ///< reloads terrain data to map view ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! void SetActive(bool abActive); ! void SetView(tcGeoRect r); ! tcTerrainView(wxWindow *parent, const wxPoint& pos, const wxSize& size, bool isHighRes, const wxString& name = "TerrainView"); ! virtual ~tcTerrainView(); ! private: ! tcMapData *mpMapData; ! tcOptions *mpOptions; ! tcGeoRect mrectMap; // current borders of loaded map ! }; } --- 33,94 ---- #endif #include "simmath.h" #include "tcMapData.h" + #include "tc3DWindow.h" + #include <osg/ref_ptr> + + namespace osg + { + class Texture2D; + } + class tcOptions; namespace MapView { ! struct tsTerrainViewParameters ! { ! int mnSurfaceWidth; ! int mnSurfaceHeight; ! tcGeoRect mrectGeo; ! tcRect mrectDisplay; ! }; ! /** ! * Modified to use OSG. This constructs a textured image using map data and ! * uses it to draw a textured quad showing a color elevation map for the view ! * area. ! */ ! class tcTerrainView : public tc3DWindow ! { ! public: ! tcGeoRect mrectCurrentView; ! void Draw(); ! void GetViewParameters(tsTerrainViewParameters& vp); ! void AttachMapData(tcMapData *apMapData) {mpMapData = apMapData;} ! int LoadHighResSurface(); ! int LoadLowResSurface(); ! void Minimize(); ! int RefreshSurfaces(); ///< reloads terrain data to map view ! int CreateSurfaces(); ! void SetActive(bool abActive); ! void SetDisplayRegion(tcRect& r); ! void SetView(tcGeoRect r); ! ! tcTerrainView(wxWindow *parent, const wxPoint& pos, const wxSize& size, bool isHighRes, const wxString& name = "TerrainView"); ! ~tcTerrainView(); ! private: ! const bool highRes; ! tcMapData* mpMapData; ! tcOptions* mpOptions; ! tcGeoRect mrectMap; ///< current borders of loaded map ! tcRect displayRegion; ///< normalized coords [0, 1] to display on textured quad ! osg::ref_ptr<osg::Texture2D> mapImage; ! bool redraw; ///< true to redraw ! }; } Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMapView.h 10 Jan 2005 00:30:20 -0000 1.11 --- tcMapView.h 20 Feb 2005 21:54:32 -0000 1.12 *************** *** 185,189 **** { mpOptions=apOptions; - terrainView->AttachOptions(apOptions); } void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} --- 185,188 ---- *************** *** 207,210 **** --- 206,210 ---- tcPoint ScreenToGeo(float x, float y); virtual void SetActive(bool abActive); ///< overrides base class + void SetBaseRenderBin(int n); void SetSize(const wxRect& rect); void SetView(tcPoint center, float afLonSpan); Index: tcGraphicsEngine.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcGraphicsEngine.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcGraphicsEngine.h 1 Nov 2004 03:17:16 -0000 1.14 --- tcGraphicsEngine.h 20 Feb 2005 21:54:32 -0000 1.15 *************** *** 40,60 **** #include <GL/glaux.h> // Header file for the GLaux library #include <string> - #include "tc2DGraphicsSurface.h" - // X3 3D code removed and replaced with OSG - #ifndef C_PIOVER180 - #define C_PIOVER180 0.017453293f - #endif - #define MAX_2D_SURFACES 32 - #define MAX_3D_SURFACES 8 - #define MAX_TEXTURES 10 - - namespace osg - { - class MatrixTransform; - } - - typedef tc2DGraphicsSurface* tp2DSurface; #if _MSC_VER > 1000 --- 40,45 ---- *************** *** 62,95 **** #endif // _MSC_VER > 1000 - struct tsLight - { - GLfloat maAmbient[4]; - GLfloat maDiffuse[4]; - GLfloat maSpecular[4]; - GLfloat maPosition[4]; - void SetAmbient(float R, float G, float B, float A) { - maAmbient[0]=R;maAmbient[1]=G;maAmbient[2]=B;maAmbient[3]=A;} - void SetDiffuse(float R, float G, float B, float A) { - maDiffuse[0]=R;maDiffuse[1]=G;maDiffuse[2]=B;maDiffuse[3]=A;} - void SetSpecular(float R, float G, float B, float A) { - maSpecular[0]=R;maSpecular[1]=G;maSpecular[2]=B;maSpecular[3]=A;} - void SetPosition(float x1, float x2, float x3, float x4) { - maPosition[0]=x1;maPosition[1]=x2;maPosition[2]=x3;maPosition[3]=x4;} - }; - - struct tsBmp32 - { - int mnWidth; - int mnHeight; - UINT32 *mpPixels; - }; - - - struct tsGraphicsEngineInfo - { - bool mbTexture; // use texture mapping - bool mbWireFrame; - }; /** --- 47,51 ---- *************** *** 101,110 **** { public: - - bool Create2DSurface(tc2DGraphicsSurface*& rp2DSurface); - bool CreatePixelMaps(); - bool Delete2DSurface(tc2DGraphicsSurface* ap2DSurface); - void DeleteAllSurfaces(); static tcGraphicsEngine * Get(); ///< method to access singleton instance std::string GetDriverInfo(); bool Is3DCapable(); --- 57,62 ---- { public: static tcGraphicsEngine * Get(); ///< method to access singleton instance + std::string GetDriverInfo(); bool Is3DCapable(); *************** *** 112,164 **** void LogGLInfo(); void LogPixelFormats(); - bool MoveSurfaceToTop(tc2DGraphicsSurface* ap2DSurface); - bool RenderAll(); - void ToggleBlending() {mbBlend = !mbBlend;} - void ToggleTexture2D() {mbTexture2D = !mbTexture2D;} - void TogglePerspective2D() {mbPerspective2D = !mbPerspective2D;} - void ToggleWireFrame() {mbWireFrame = !mbWireFrame;} - - void GetInfo(tsGraphicsEngineInfo& asGI); - private: bool mbInitialized; - tp2DSurface ma2D[MAX_2D_SURFACES]; - unsigned mn2D; int mnWindowWidth; int mnWindowHeight; char mzTexturePath[255]; - bool mbLight; // lighting for 3D surfaces - bool mbBlend; // alpha blending for 3D surfaces - bool mbBorder; - bool mbTexture; // use texture mapping - bool mbTexture2D; // use texture mapped quads to render 2D surface - bool mbPerspective2D; // use perspective view for Texture2D - bool mbWireFrame; - bool mbMipMapTextures; - bool mbBlendTransitions; - - enum _graphicsmode - { - MODE_NONE, - MODE_2D, - MODE_TEXTURE2D - } meGraphicsMode; void CheckGLError(const char* location = 0); ! void ConfigureFor2D(); ! void ConfigureForTexture2D(); ! ! AUX_RGBImageRec* LoadBmp(char *szFileName); ! void Render2D(unsigned anSurface); // glDrawPixels rendering of 2D surface ! void RenderTexture2D(unsigned anSurface); // texture mapped rendering of 2D surface ! void ExtractTile(UINT32 *apTile, tsBmp32 asBmp, unsigned anTileSize, int anStartRow, int anStartCol); ! void Load2DSurfaceTextures(int anSurface); ! tcGraphicsEngine(); tcGraphicsEngine(const tcGraphicsEngine& src); ! virtual ~tcGraphicsEngine(); ! }; --- 64,80 ---- void LogGLInfo(); void LogPixelFormats(); private: bool mbInitialized; int mnWindowWidth; int mnWindowHeight; char mzTexturePath[255]; void CheckGLError(const char* location = 0); ! tcGraphicsEngine(); tcGraphicsEngine(const tcGraphicsEngine& src); ! ~tcGraphicsEngine(); }; |