Go to the documentation of this file.00001 #pragma once
00002 #include "../main.h"
00003
00004 #include <vector>
00005
00006 #define WIREFRAME_ON 0
00007 #define WIREFRAME_OFF 1
00008 #define TEXTURE_LINEAR_ON 2
00009 #define TEXTURE_LINEAR_OFF 3
00010 #define MIPMAP_ON 4
00011 #define MIPMAP_OFF 5
00012 #define FRUSTUM_ON 6
00013 #define FRUSTUM_OFF 7
00014 #define TRANSPARENCY_ON 8
00015 #define TRANSPARENCY_OFF 9
00016
00018 class Gui
00019 {
00020 public:
00022 Gui(IRender& render, IPhysic& physic, pMouseDevice mouse, const MouseMap& mousemap);
00023 ~Gui(void);
00024
00026 pIControl createLabel(float x, float y, float width, float height, int textureIndex);
00027
00029 pIControl createButton(float x, float y, float width, float height, void callback(pIControl), int textureIndex);
00030
00032 void setGuiTexture(wchar* textureColor);
00033
00035 void addControl(pIControl);
00036
00039 void update();
00040
00042 void setUpStatusLabels();
00043
00045 void showStatusLabel(int index);
00046
00048 void hideAllStatusLabels();
00049
00051 void showFPS();
00052
00054 void hideFPS();
00055
00057 void setFPSValue(int fps);
00058
00060 void showWinnerLabel() { m_winnerLabel->setVisible(true); }
00061
00062 protected:
00064 bool loadTextureData(const wchar* colorFilename, const wchar* normalFilename, const wchar* heightFilename, TextureData& out);
00066 bool loadUnknown(const wchar* filename, int& width, int& height, Pixel** outData);
00068 bool loadBMP(const wchar* filename, int& width, int& height, Pixel** outData);
00070 bool loadTGA(const wchar* filename, int& width, int& height, Pixel** outData);
00071 uint ShiftRightByMask(uint Color, uint Mask, uint DistributeToBits = 8);
00072
00073
00074 pITexture m_guiTexture;
00075
00076 int m_numControls;
00077 std::vector<pIControl> m_controls;
00078 pMouseDevice m_mouse;
00079 MouseMap m_mouseMap;
00080
00081 IPhysic& m_physic;
00082 IRender& m_render;
00083
00084 pIControl m_statusLabels[10];
00085 pIControl m_fpsLabel[3];
00086 pIControl m_winnerLabel;
00087
00088 };