[Gcblue-commits] gcb_wx/include/graphics tcGraphicsInfo.h, NONE, 1.1 tc3DTerrain.h, 1.15, 1.16 tc3D
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/include/graphics Modified Files: tc3DTerrain.h tc3DViewer.h tc3DWindow.h tcDisplayModes.h tcMapView.h Added Files: tcGraphicsInfo.h Removed Files: tcGraphicsEngine.h Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DTerrain.h 22 Mar 2006 01:23:28 -0000 1.15 --- tc3DTerrain.h 24 Sep 2006 19:50:19 -0000 1.16 *************** *** 28,31 **** --- 28,34 ---- + #include <Demeter/Terrain.h> + #include <Demeter/Loader.h> + #include <Demeter/DemeterDrawable.h> #include <osg/Geode> *************** *** 34,40 **** #include <osgUtil/Optimizer> - #include <Demeter/Terrain.h> - #include <Demeter/Loader.h> - #include <Demeter/DemeterDrawable.h> class tcMapData; --- 37,40 ---- Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcMapView.h 16 Sep 2006 14:01:23 -0000 1.31 --- tcMapView.h 24 Sep 2006 19:50:19 -0000 1.32 *************** *** 295,298 **** --- 295,299 ---- void DrawSelectionBox(); void DrawTerrainText(); + void DrawTime(); void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); void DrawMapCmdRange(); *************** *** 331,334 **** --- 332,337 ---- void SetDateTime(const std::string& s) {dateTime = s;} void SetHookID(long id); + bool GetShowFrameCounter() const; + void SetShowFrameCounter(bool state); void SetGroupHook(std::vector<long>& hookedUnits); void SetTextLeftMargin(float x); *************** *** 367,370 **** --- 370,375 ---- wxPoint buttonDownPoint; ///< start point for click-drag operations float leftMargin; ///< screen position to use for info text and symbols + bool showFrameCounter; ///< true to show FPS display + void Build2525(); *************** *** 391,394 **** --- 396,400 ---- osg::Geometry* DrawNTDSMissile(teAffiliation affil); osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); + osg::Geometry* DrawNTDSCarrier(teAffiliation affil); osg::Geometry* DrawNTDSTorpedo(teAffiliation affil); osg::Geometry* DrawNTDSUnknown(teAffiliation affil); *************** *** 415,419 **** void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); void Draw(); void DrawGrid(); --- 421,425 ---- void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsInfo* apGraphicsEngine); void Draw(); void DrawGrid(); Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DViewer.h 21 Apr 2006 23:28:31 -0000 1.15 --- tc3DViewer.h 24 Sep 2006 19:50:19 -0000 1.16 *************** *** 75,82 **** --- 75,84 ---- osg::ref_ptr<osgText::Text> viewerText; ///< text for debug/basic viewer info display + osg::ref_ptr<osg::Geometry> border; ///< border graphics osg::ref_ptr<osg::MatrixTransform> guiObjects; osg::ref_ptr<osg::MatrixTransform> hudObjects; ///< add HUD objects to this transform osg::ref_ptr<osg::Projection> orthoProjection; ///< ortho projection for HUD objects osg::ref_ptr<osg::Geode> textGeode; + osg::ref_ptr<osg::Geode> borderGeode; osg::ref_ptr<osg::Transform> skyTransform; osg::ref_ptr<osg::Group> foggedObjects; ///< fog applied to this group *************** *** 100,103 **** --- 102,106 ---- virtual void OnKeyDown(wxKeyEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); + virtual void OnLButtonDClick(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); *************** *** 143,146 **** --- 146,150 ---- void SetActive(bool b); + void SetBorderActive(bool state); void SetCameraMode(bool lookAt, bool moveWith); void SetClearMode(int modeCode); *************** *** 184,187 **** --- 188,192 ---- bool isFrozen; ///< set true if window has been frozen bool isActive; + bool isBorderActive; bool isTerrainActive; bool impostorModeActive; ///< true if 3D is in imposter mode *************** *** 247,250 **** --- 252,256 ---- void InitText(); void SetOrigin(double lon, double lat); ///< sets origin of 3D world coordinates + void UpdateBorder(); void UpdateCamera(); void UpdateCameraDatabaseView(); --- tcGraphicsEngine.h DELETED --- Index: tcDisplayModes.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDisplayModes.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDisplayModes.h 22 Mar 2006 01:23:28 -0000 1.3 --- tcDisplayModes.h 24 Sep 2006 19:50:19 -0000 1.4 *************** *** 41,44 **** --- 41,45 ---- unsigned int bits; unsigned int frequency; + std::string deviceDescription; }; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tc3DWindow.h 17 Aug 2006 01:27:10 -0000 1.27 --- tc3DWindow.h 24 Sep 2006 19:50:19 -0000 1.28 *************** *** 55,59 **** ! class tcGraphicsEngine; class tc3DViewer; --- 55,59 ---- ! class tcGraphicsInfo; class tc3DViewer; --- NEW FILE: tcGraphicsInfo.h --- /* ** tcGraphicsInfo.h: interface for the tcGraphicsInfo class. ** ** Copyright (C) 2003 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _tcGraphicsInfo_H_ #define _tcGraphicsInfo_H_ #if _MSC_VER > 1000 #pragma once #endif #ifndef WX_PRECOMP #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions #endif // WIN32 #endif // WX_PRECOMP #include <GL/gl.h> // Header file for the OpenGL32 library #include <GL/glu.h> // Header file for the GLu32 library // had to remove (change name) GLAux.lib from SDK directory to avoid __ftol error // GLAux.lib from VC98 directory works #include <GL/glaux.h> // Header file for the GLaux library #include <string> #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 /** * Singleton class for 2D graphics using OpenGL. This is a holdover * from old code and eventually should be replaced with OSG * functionality. */ class tcGraphicsInfo { public: static tcGraphicsInfo * Get(); ///< method to access singleton instance std::string GetDriverInfo(); bool Is3DCapable(); bool Is3DAlphaCapable(); void LogGLInfo(); void LogPixelFormats(); private: bool mbInitialized; int mnWindowWidth; int mnWindowHeight; char mzTexturePath[255]; void CheckGLError(const char* location = 0); tcGraphicsInfo(); tcGraphicsInfo(const tcGraphicsInfo& src); ~tcGraphicsInfo(); }; #endif |