Add project files.
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="UTest|Win32">
|
||||
<Configuration>UTest</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="UTest|x64">
|
||||
<Configuration>UTest</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{9225E043-EE77-43AA-A140-C9C2F85B1013}</ProjectGuid>
|
||||
<RootNamespace>TrooperEngineTest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='UTest|Win32'">
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='UTest|x64'">
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SDL2_gfx);../TrooperEngineDLL/dllExportFiles;$(SDL2_net)\include;$(SDL2_ttf)\include;$(SDL2_mixer)\include;$(SDL2_image)\include;$(SDL2)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;sdl2.lib;sdl2main.lib;sdl2_image.lib;sdl2_ttf.lib;sdl2_mixer.lib;sdl2_net.lib;tinyxml2.lib;TrooperEngineDLL.lib;sdl2_gfx.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SDL2)\VisualC\Win32\Release;$(SDL2_gfx)\Win32\Release;../Debug;$(SDL2_ttf)\lib\x86;$(SDL2_mixer)\lib\x86;$(SDL2_image)\lib\x86;$(SDL2_net)\lib\x86;$(SDL2)\lib\x86;$(TINYXML)\tinyxml2\bin\Win32-Debug-Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='UTest|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(SDL2_gfx);dllExportFiles;$(SDL2_net)\include;$(SDL2_ttf)\include;$(SDL2_mixer)\include;$(SDL2_image)\include;$(SDL2)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;sdl2.lib;sdl2main.lib;sdl2_image.lib;sdl2_ttf.lib;sdl2_mixer.lib;sdl2_net.lib;tinyxml2.lib;TrooperEngineDLL.lib;sdl2_gfx.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SDL2_gfx)\Win32\Release;../Debug;$(SDL2_ttf)\lib\x86;$(SDL2_mixer)\lib\x86;$(SDL2_image)\lib\x86;$(SDL2_net)\lib\x86;$(SDL2)\lib\x86;$(TINYXML)\tinyxml2\bin\Win32-Debug-Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GUIEngineTest\GUIXMLTest.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="UTest\UTest.cpp" />
|
||||
<ClCompile Include="UtilityEngineTest\StringTest.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GUIEngineTest\GUIXMLTest.hpp" />
|
||||
<ClInclude Include="UTest\UTest.hpp" />
|
||||
<ClInclude Include="UtilityEngineTest\StringTest.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xml Include="xml\GUI.xml" />
|
||||
<Xml Include="xml\GUIXMLAlignTest.xml" />
|
||||
<Xml Include="xml\GUIXMLDefaultTest.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Xml>
|
||||
<Xml Include="xml\GUIXMLPositionTest.xml" />
|
||||
<Xml Include="xml\include.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,62 @@
|
||||
#ifndef _CTEXTBUTTON_HPP_
|
||||
#define _CTEXTBUTTON_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "cButton.hpp"
|
||||
#include "cLabel.hpp"
|
||||
|
||||
#include "GUIHelpers/Enums.hpp"
|
||||
#include "GUIHelpers/GUIUtility.hpp"
|
||||
#include "../VideoEngine/cSprite.hpp"
|
||||
#include "../VideoEngine/cImage.hpp"
|
||||
#include "../MathEngine/iVector/iVector2.hpp"
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "../UtilityEngine/cString.hpp"
|
||||
|
||||
using UtilityEngine::cString;
|
||||
|
||||
namespace GUIEngine {
|
||||
class EXPORT_FROM_MYDLL cTextButton : public cButton
|
||||
{
|
||||
public:
|
||||
static const cString sNAME; /*= "button";*/
|
||||
|
||||
cTextButton(cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER,
|
||||
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
|
||||
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
|
||||
virtual ~cTextButton();
|
||||
|
||||
///Functions
|
||||
void Create(cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER,
|
||||
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
|
||||
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
|
||||
|
||||
//Sets
|
||||
void setText( const cString& text );
|
||||
void setTextColour( const GUIHelpers::RGBA& colour );
|
||||
void setTextSize( const unsigned long int size );
|
||||
|
||||
///Gets
|
||||
const cString getText() const;
|
||||
const GUIHelpers::RGBA getTextColour();
|
||||
const unsigned long int getTextSize();
|
||||
|
||||
virtual const GUIHelpers::eType getType() const;
|
||||
|
||||
private:
|
||||
void CreateLabel();
|
||||
void GenerateImage();
|
||||
void GenerateTexture();
|
||||
|
||||
private:
|
||||
cLabel m_label;// = nullptr
|
||||
};/// END CLASS DEFINITION cButton
|
||||
}/// END NAMESPACE DEFINITION GUIEngine
|
||||
#endif/// END IFNDEF _CBUTTON_HPP_
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef _CGUI_HPP_
|
||||
#define _CGUI_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "../TextTypeEngine/cFont.hpp"
|
||||
#include "../MathEngine/iVector/iVector4.hpp"
|
||||
|
||||
#include "cWindow.hpp"
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "../UtilityEngine/cString.hpp"
|
||||
#include "../MathEngine/iVector/iVector2.hpp"
|
||||
|
||||
using UtilityEngine::cString;
|
||||
|
||||
namespace GUIEngine {
|
||||
/* Singleton */
|
||||
class EXPORT_FROM_MYDLL cGUI
|
||||
{
|
||||
private:
|
||||
cGUI();
|
||||
~cGUI();
|
||||
|
||||
public:
|
||||
enum EXPORT_FROM_MYDLL eGUIEventType: unsigned int
|
||||
{
|
||||
MouseButton1 = 0,
|
||||
MouseButton2,
|
||||
MouseButton3,
|
||||
Keyboard
|
||||
};
|
||||
///Functions
|
||||
static cGUI& Inst();
|
||||
static void Delete();
|
||||
|
||||
const bool Initialize( const cString& filename, const cString& dir = "", const unsigned long int size = 16 );
|
||||
|
||||
void Event(const MathEngine::iVector2& location, const eGUIEventType& type);
|
||||
const MathEngine::iVector2 DisplayArea() const;
|
||||
|
||||
void AddObject(cWindow* obj);
|
||||
|
||||
void Display();
|
||||
|
||||
///Sets
|
||||
void setFont( TextTypeEngine::cFont* font );
|
||||
void setFont( const cString& filename, const cString& dir = "", const unsigned long int size = 16 );
|
||||
|
||||
void setTextColour( const GUIHelpers::RBGA& colour );
|
||||
void setTextColour( const unsigned long int red = 0, const unsigned long int green = 0, const unsigned long int blue = 0 );
|
||||
|
||||
void setPadding( const GUIHelpers::Padding& padding );
|
||||
void setPadding( const unsigned int top = 5, const unsigned int right = 5, const unsigned int bottom = 5, const unsigned int left = 5 );
|
||||
|
||||
void setAlign( const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER );
|
||||
|
||||
///Gets
|
||||
TextTypeEngine::cFont* getFont();
|
||||
|
||||
const GUIHelpers::RBGA& getTextColour() const;
|
||||
void getTextColour( unsigned long int& red, unsigned long int& green, unsigned long int& blue ) const;
|
||||
|
||||
const GUIHelpers::Padding& getPadding() const;
|
||||
void getPadding( unsigned int& top, unsigned int& right, unsigned int& bottom, unsigned int& left ) const;
|
||||
|
||||
const GUIHelpers::eAlign& getAlign() const;
|
||||
|
||||
const bool IsInit() const;
|
||||
|
||||
private:
|
||||
static cGUI* sp_inst;// = nullptr
|
||||
|
||||
bool m_inited;// = false
|
||||
|
||||
/* default GUI font */
|
||||
TextTypeEngine::cFont* mp_font;// = nullptr
|
||||
|
||||
/* default GUI text colour black*/
|
||||
//GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 }
|
||||
|
||||
/* default GUI padding */
|
||||
//GUIHelpers::Padding m_padding;// = { 5, 5, 5, 5 }
|
||||
|
||||
/* default GUI align */
|
||||
//GUIHelpers::eAlign m_align;// = GUIHelpers::eAlign::CENTER
|
||||
|
||||
std::vector<cWindow*> m_guiObjects;
|
||||
};/// END CLASS DEFINITION cGUI
|
||||
}/// END NAMESPACE DEFINITION GUIEngine
|
||||
#endif/// END IFNDEF _CGUI_HPP_
|
||||
Reference in New Issue
Block a user