Update of /cvsroot/gcblue/gcb_wx/include/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3244/include/graphics
Added Files:
tcDisplayModes.h tcDisplaySettingsView.h
Log Message:
--- NEW FILE: tcDisplaySettingsView.h ---
/*
** @file tcDisplaySettingsView.h
**
** Copyright (C) 2004 Dewitt Colclough (de...@tw...)
** 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 _TCDISPLAYSETTINGSVIEW_H_
#define _TCDISPLAYSETTINGSVIEW_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "wx/wx.h"
#ifdef WIN32
#include "wx/msw/private.h" // for MS Windows specific definitions
#endif
#include "tcOptions.h"
#include "tcStandardWindow.h"
#include "tcSound.h"
/**
* Display settings GUI
*/
class tcDisplaySettingsView : public tcStandardWindow
{
public:
int Draw();
void OnLButtonDown(wxMouseEvent& event);
void OnMouseMove(wxMouseEvent& event);
tcDisplaySettingsView(wxWindow *parent, tcWindow *surfaceHost,
const wxPoint& pos, const wxSize& size,
const wxString& name = "DisplaySettingsView");
virtual ~tcDisplaySettingsView();
private:
struct modeDrawingInfo
{
float x, y, width, height; // dimensions of info box
wxString modeText;
};
Gdiplus::SolidBrush *mpBrush;
Gdiplus::Font *mpFont;
Gdiplus::Pen *mpPen;
std::map<unsigned int, modeDrawingInfo> modeList;
int selectedModeIdx; // -1 for none selected
int mouseOverIdx; // -1 for over none
float boxWidth;
bool modeListUpdated;
int GetBoxContainingPoint(const wxPoint& point);
bool Init();
void UpdateModeList(Gdiplus::Graphics *graphics);
};
#endif // _TCDISPLAYSETTINGSVIEW_H_
--- NEW FILE: tcDisplayModes.h ---
/** @file tcDisplayModes.h
**
** Copyright (C) 2004 Dewitt Colclough (de...@tw...)
** 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 _TCDISPLAYMODES_H_
#define _TCDISPLAYMODES_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <vector>
/**
* Singleton class to enumerate and set display modes
*/
class tcDisplayModes
{
public:
struct Info
{
unsigned int width;
unsigned int height;
unsigned int bits;
};
static tcDisplayModes* Get();
void ChangeMode(unsigned width, unsigned height, unsigned bits);
void ChangeOptionsMode(unsigned width, unsigned height, unsigned bits);
unsigned GetModeCount() const;
const tcDisplayModes::Info& GetCurrentModeInfo() const;
const tcDisplayModes::Info& GetModeInfo(unsigned n) const;
bool IsCurrentMode(unsigned n) const;
bool IsModeValid(unsigned width, unsigned height, unsigned bits);
void LoadModeFromOptions();
void LogModeInfo();
private:
std::vector<Info> modeInfo;
tcDisplayModes::Info currentMode;
tcDisplayModes::Info startMode;
void PopulateModeInfo();
tcDisplayModes();
~tcDisplayModes();
};
#endif
|