Update of /cvsroot/gcblue/gcb_wx/include/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11430/include/graphics
Added Files:
tcDatabaseInfoWindow.h tcShaderControl.h
Log Message:
--- NEW FILE: tcShaderControl.h ---
/*
** @file tcShaderControl.h
*/
/* Copyright (C) 2006 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 _SHADERCONTROL_H_
#define _SHADERCONTROL_H_
#ifdef WIN32
#pragma once
#endif
#include <osg/ref_ptr>
#include <osg/Program>
#include <osg/Shader>
#include <osg/Uniform>
#include <osg/Texture2D>
/**
* Singleton class to add and manage shaders
* May want to distribute shader control, using this class for static helper methods only?
*
* Started with OSG shader example by Mike Weiblen
*/
class tcShaderControl
{
public:
void AddTerrainElevationShader(osg::StateSet* ss);
void AddTestShader(osg::StateSet* ss);
void AddWaterShader(osg::StateSet* ss);
static tcShaderControl* Get(); ///< singleton accessor
static void LoadShaderSource(osg::Shader* shader, const std::string& fileName);
private:
std::vector< osg::ref_ptr<osg::Program> > programList;
osg::ref_ptr<osg::Texture2D> water1;
osg::ref_ptr<osg::Texture2D> water2;
osg::ref_ptr<osg::Texture2D> seaTexture;
osg::ref_ptr<osg::Texture2D> coastTexture;
osg::ref_ptr<osg::Texture2D> sandTexture;
osg::ref_ptr<osg::Texture2D> grassTexture;
osg::ref_ptr<osg::Texture2D> mountainTexture;
void LoadTextures();
tcShaderControl();
~tcShaderControl();
};
#endif
--- NEW FILE: tcDatabaseInfoWindow.h ---
/**
** @file tcDatabaseInfoWindow.h
*/
/* Copyright (C) 2006 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 _TCDATABASEINFOWINDOW_H_
#define _TCDATABASEINFOWINDOW_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "tcXmlWindow.h"
namespace database
{
class tcDatabaseObject;
}
/**
* Window class to display info for database object
*/
class tcDatabaseInfoWindow : public tcXmlWindow
{
public:
virtual void DestroyWindow();
virtual void Draw();
//virtual void OnChar(wxKeyEvent& event);
virtual void OnCloseCommand(wxCommandEvent& event);
//virtual void OnEnterWindow(wxMouseEvent& event);
virtual void OnLButtonDown(wxMouseEvent& event);
virtual void OnLButtonUp(wxMouseEvent& event);
virtual void OnLeaveWindow(wxMouseEvent& event);
virtual void OnMouseMove(wxMouseEvent& event);
//virtual void OnRButtonDown(wxMouseEvent& event);
void SetDatabaseObject(long id);
static void SetParent(tc3DWindow* win);
tcDatabaseInfoWindow(const wxPoint& pos,
const wxString& configFile = "xml/database_info.xml",
const wxString& name = "DatabaseInfo");
virtual ~tcDatabaseInfoWindow();
protected:
unsigned int drawCount;
// params for window drag (move this function to base class?)
bool isLButtonDown;
bool windowDragOn;
wxPoint windowDragPoint;
void DrawDatabaseInfo();
bool FinishDestroy();
void UpdateWindowDrag(const wxPoint& pos);
private:
bool destroy; ///< workaround to delay destruction of window to safe time
long objId; ///< id of obj or track to display info for
std::string databaseClassName; ///< class name of database object, empty if not looked up yet
static tc3DWindow* parent;
database::tcDatabaseObject* GetDatabaseObject();
DECLARE_EVENT_TABLE()
};
#endif
|