Add project files.
This commit is contained in:
1 parent
b04a25689b
commit
3c1b7d28e8
425 files changed
+35333
No files matched your search
@@ -0,0 +1,31 @@
|
||||
#ifndef _COBJECT_HPP_
|
||||
#define _COBJECT_HPP_
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "Enums.hpp"
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
namespace GUIHelpers {
|
||||
class EXPORT_FROM_MYDLL cObject
|
||||
{
|
||||
public:
|
||||
cObject( const signed int id );
|
||||
virtual ~cObject();
|
||||
|
||||
bool operator == (const cObject& other);
|
||||
|
||||
///Functions
|
||||
|
||||
///Sets
|
||||
|
||||
///Gets
|
||||
const signed int getID() const;
|
||||
virtual const GUIHelpers::eType getType() const;
|
||||
|
||||
private:
|
||||
signed int m_id;// = 0
|
||||
};/// END CLASS DEFINITION cObject
|
||||
}/// END NAMESPACE DEFINITION GUIEngine
|
||||
#endif/// END IFNDEF _COBJECT_HPP_
|
||||
@@ -0,0 +1,223 @@
|
||||
<?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="UTest|Win32">
|
||||
<Configuration>UTest</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B6513FAA-8BDE-45AA-9F1E-326BCBE5D2E8}</ProjectGuid>
|
||||
<RootNamespace>TrooperEngineDLL</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='UTest|Win32'">
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(TINYXML);$(SDL2_gfx);dllExportFiles;$(SDL2_net)\include;$(SDL2_ttf)\include;$(SDL2_mixer)\include;$(SDL2_image)\include;$(SDL2)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>sdl.lib;sdlmain.lib;sdl_image.lib;sdl_ttf.lib;sdl_mixer.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>../Debug;$(SDL)\SDL_ttf-2.0.9\lib;$(SDL)\SDL_mixer-1.2.11\lib;$(SDL)\SDL_image-1.2.10\lib;$(SDL)\SDL-1.2.14\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>NotSet</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>
|
||||
</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Full</Optimization>
|
||||
<AdditionalIncludeDirectories>../LinkListDLLProject/dllExportFiles;dllExportFiles;$(SDL)\SDL_ttf-2.0.9\include;$(SDL)\SDL_mixer-1.2.8\include;$(SDL)\SDL_image-1.2.7\include;$(SDL)\SDL-1.2.13\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>sdl.lib;sdlmain.lib;sdl_image.lib;sdl_ttf.lib;sdl_mixer.lib;LinkList.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)TrooperEngine.dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>../Release;$(SDL)\SDL_ttf-2.0.9\lib;$(SDL)\SDL_mixer-1.2.8\lib;$(SDL)\SDL_image-1.2.7\lib;$(SDL)\SDL-1.2.13\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</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>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="dllExportFiles\CompileSettings.h" />
|
||||
<ClInclude Include="dllExportFiles\dllExport.h" />
|
||||
<ClInclude Include="dllExportFiles\TrooperEngine.hpp" />
|
||||
<ClInclude Include="TrooperEngine\AudioEngine\cAudio.hpp" />
|
||||
<ClInclude Include="TrooperEngine\AudioEngine\cMusic.hpp" />
|
||||
<ClInclude Include="TrooperEngine\AudioEngine\cSound.hpp" />
|
||||
<ClInclude Include="TrooperEngine\EventEngine\cEvent.hpp" />
|
||||
<ClInclude Include="TrooperEngine\FXEngine\cGFX.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cBoxSizer.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cButton.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cGUI.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cLayout.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cPanel.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cLabel.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cTextButton.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\cWindow.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cTexture.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cObject.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\Enums.hpp" />
|
||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\GUIUtility.hpp" />
|
||||
<ClInclude Include="TrooperEngine\InputEngine\cInput.hpp" />
|
||||
<ClInclude Include="TrooperEngine\InputEngine\cJoystick.hpp" />
|
||||
<ClInclude Include="TrooperEngine\InputEngine\cKey.hpp" />
|
||||
<ClInclude Include="TrooperEngine\InputEngine\cKeyboard.hpp" />
|
||||
<ClInclude Include="TrooperEngine\InputEngine\cMouse.hpp" />
|
||||
<ClInclude Include="TrooperEngine\InputEngine\cTextInput.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\cCollision.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector2.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector3.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector4.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\Vector\Vector2.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\Vector\Vector3.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\Vector\Vector4.hpp" />
|
||||
<ClInclude Include="TrooperEngine\TextTypeEngine\cFont.hpp" />
|
||||
<ClInclude Include="TrooperEngine\TextTypeEngine\cText.hpp" />
|
||||
<ClInclude Include="TrooperEngine\TextTypeEngine\cTextType.hpp" />
|
||||
<ClInclude Include="TrooperEngine\TextTypeEngine\TextTypeHelpers\cFontHolder.hpp" />
|
||||
<ClInclude Include="TrooperEngine\UtilityEngine\cString.hpp" />
|
||||
<ClInclude Include="TrooperEngine\UtilityEngine\cUtility.hpp" />
|
||||
<ClInclude Include="TrooperEngine\UtilityEngine\MSUNIX\msunix.hpp" />
|
||||
<ClInclude Include="TrooperEngine\VideoEngine\cAnimatedSprite.hpp" />
|
||||
<ClInclude Include="TrooperEngine\VideoEngine\cCamera.hpp" />
|
||||
<ClInclude Include="TrooperEngine\VideoEngine\cImage.hpp" />
|
||||
<ClInclude Include="TrooperEngine\VideoEngine\cRenderer.hpp" />
|
||||
<ClInclude Include="TrooperEngine\VideoEngine\cSprite.hpp" />
|
||||
<ClInclude Include="TrooperEngine\VideoEngine\cVideo.hpp" />
|
||||
<ClInclude Include="TrooperEngine\TimingEngine\cTiming.hpp" />
|
||||
<ClInclude Include="TrooperEngine\NetworkEngine\cNetwork.hpp" />
|
||||
<ClInclude Include="TrooperEngine\TrooperEngineCore\cTrooperEngineCore.hpp" />
|
||||
<ClInclude Include="TrooperEngine\MathEngine\cRandom.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="TrooperEngine\AudioEngine\cAudio.cpp" />
|
||||
<ClCompile Include="TrooperEngine\AudioEngine\cMusic.cpp" />
|
||||
<ClCompile Include="TrooperEngine\AudioEngine\cSound.cpp" />
|
||||
<ClCompile Include="TrooperEngine\EventEngine\cEvent.cpp" />
|
||||
<ClCompile Include="TrooperEngine\FXEngine\cGFX.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cBoxSizer.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cButton.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cGUI.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cLayout.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cLabel.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cPanel.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cTextButton.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\cWindow.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cObject.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cTexture.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.cpp" />
|
||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\GUIUtility.cpp" />
|
||||
<ClCompile Include="TrooperEngine\InputEngine\cInput.cpp" />
|
||||
<ClCompile Include="TrooperEngine\InputEngine\cJoystick.cpp" />
|
||||
<ClCompile Include="TrooperEngine\InputEngine\cKey.cpp" />
|
||||
<ClCompile Include="TrooperEngine\InputEngine\cKeyboard.cpp" />
|
||||
<ClCompile Include="TrooperEngine\InputEngine\cMouse.cpp" />
|
||||
<ClCompile Include="TrooperEngine\InputEngine\cTextInput.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\cCollision.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector2.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector3.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector4.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\Vector\Vector2.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\Vector\Vector3.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\Vector\Vector4.cpp" />
|
||||
<ClCompile Include="TrooperEngine\TextTypeEngine\cFont.cpp" />
|
||||
<ClCompile Include="TrooperEngine\TextTypeEngine\cText.cpp" />
|
||||
<ClCompile Include="TrooperEngine\TextTypeEngine\cTextType.cpp" />
|
||||
<ClCompile Include="TrooperEngine\TextTypeEngine\TextTypeHelpers\cFontHolder.cpp" />
|
||||
<ClCompile Include="TrooperEngine\UtilityEngine\cString.cpp" />
|
||||
<ClCompile Include="TrooperEngine\UtilityEngine\cUtility.cpp" />
|
||||
<ClCompile Include="TrooperEngine\UtilityEngine\MSUNIX\msunix.cpp" />
|
||||
<ClCompile Include="TrooperEngine\VideoEngine\cAnimatedSprite.cpp" />
|
||||
<ClCompile Include="TrooperEngine\VideoEngine\cCamera.cpp" />
|
||||
<ClCompile Include="TrooperEngine\VideoEngine\cImage.cpp" />
|
||||
<ClCompile Include="TrooperEngine\VideoEngine\cRenderer.cpp" />
|
||||
<ClCompile Include="TrooperEngine\VideoEngine\cSprite.cpp" />
|
||||
<ClCompile Include="TrooperEngine\VideoEngine\cVideo.cpp" />
|
||||
<ClCompile Include="TrooperEngine\TimingEngine\cTiming.cpp" />
|
||||
<ClCompile Include="TrooperEngine\NetworkEngine\cNetwork.cpp" />
|
||||
<ClCompile Include="TrooperEngine\TrooperEngineCore\cTrooperEngineCore.cpp" />
|
||||
<ClCompile Include="TrooperEngine\MathEngine\cRandom.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,88 @@
|
||||
/* Copyright (C) 2016 Richard W. Allen
|
||||
Program Name: SDL Pong C++
|
||||
Author: Richard W. Allen
|
||||
Version: V1.0
|
||||
Date Started: August 24, 2016
|
||||
Date End:
|
||||
Webpage: http://www.richardallenonline.com
|
||||
IDE: Visual Studio 2015
|
||||
Compiler: C\C++ 2014
|
||||
Langage: C++
|
||||
License: GNU GENERAL PUBLIC LICENSE Version 2
|
||||
see license.txt for details
|
||||
|
||||
*/
|
||||
|
||||
/*** TrooperEngine DLL Header Files ***/
|
||||
#include "TrooperEngine.hpp"
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include "SDL.h"
|
||||
|
||||
#include "UTest/UTest.hpp"
|
||||
|
||||
#include "UtilityEngineTest/StringTest.hpp"
|
||||
|
||||
using UtilityEngine::cString;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argc, argv;
|
||||
|
||||
printf(cString("TrooperEngine V") + TrooperEngineCore::cTrooperEngineCore::Version() + "\n");
|
||||
|
||||
|
||||
UTest u("cVideo");
|
||||
|
||||
printf("\nTesting cVideo\n");
|
||||
|
||||
//TrooperEngineCore::cTrooperEngineCore& core = TrooperEngineCore::cTrooperEngineCore::Inst();
|
||||
VideoEngine::cVideo& video = VideoEngine::cVideo::Inst();
|
||||
video.Initialize();
|
||||
//core.VideoInit();
|
||||
|
||||
if (!video.Setup()) {
|
||||
printf("database failed to open.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
u.test("Video Initialize open", !video.IsInit());
|
||||
|
||||
StringTest();
|
||||
|
||||
GUIEngine::cGUI::Inst().Initialize("GUI.xml", "xml/");
|
||||
GUIEngine::cGUI::Inst().Display();
|
||||
|
||||
SDL_Event event;
|
||||
bool run = true;
|
||||
while (run) {
|
||||
VideoEngine::cVideo::Inst().Display();
|
||||
while (SDL_PollEvent(&event)) {
|
||||
/* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */
|
||||
switch (event.type) {
|
||||
case SDL_KEYDOWN:
|
||||
switch (event.key.keysym.sym) {
|
||||
case SDLK_SPACE:
|
||||
run = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_KEYUP:
|
||||
printf("Key release detected\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//system("pause");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
#ifndef _CSOUND_HPP_
|
||||
#define _CSOUND_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
#include <SDL_mixer.h>
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "../UtilityEngine/cString.hpp"
|
||||
|
||||
using UtilityEngine::cString;
|
||||
|
||||
namespace AudioEngine {
|
||||
class EXPORT_FROM_MYDLL cSound
|
||||
{
|
||||
public:
|
||||
cSound( const cString& dir = "", const cString& filename = "", const unsigned char volume = 255,
|
||||
const unsigned char distance = 100, const short int angle = 0, const long int channel = -1,
|
||||
const long int loops = -1 );
|
||||
/* Copy constructor */
|
||||
cSound( const cSound& copy );
|
||||
~cSound();
|
||||
|
||||
///Functions
|
||||
/* Plays the sound if loaded */
|
||||
void PlaySound();
|
||||
/* Fades in the sound for time */
|
||||
void FadeIn( const unsigned int time = 1000 ) const;
|
||||
/* Fades out the sound for time */
|
||||
void FadeOut( const unsigned int time = 1000 ) const;
|
||||
|
||||
///Sets
|
||||
/* Sets the directory of the sound */
|
||||
void setDir( const cString& dir );
|
||||
/* Sets the file name of the sound */
|
||||
void setFileName( const cString& filename );
|
||||
/* Sets the file name and the directory of the sound */
|
||||
void setFileNameandDir( const cString& filename, const cString& dir = "" );
|
||||
/* Sets the Volume of the sound */
|
||||
void setVolume( const unsigned char volume = 255 );
|
||||
/* Sets the Distance of the sound */
|
||||
void setDistance( const unsigned char distance = 100 );
|
||||
/* Sets the Angle of the sound */
|
||||
void setAngle( const short int angle = 0 );
|
||||
/* Sets the Channel of the sound */
|
||||
void setChannel( const long int channel = -1);
|
||||
/* Sets how many times the sound loops */
|
||||
void setLoops( const long int loops = -1 );
|
||||
|
||||
|
||||
///Gets
|
||||
/* Gets the directory of the sound */
|
||||
const cString getDir() const;
|
||||
/* Gets the file name of the sound */
|
||||
const cString getFileName() const;
|
||||
/* Gets the Volume of the sound */
|
||||
const unsigned char getVolume() const;
|
||||
/* Gets the Distance of the sound */
|
||||
const unsigned char getDistance() const;
|
||||
/* Gets the Angle of the sound */
|
||||
const short int getAngle() const;
|
||||
/* Gets the Channel of the sound */
|
||||
const long int getChannel() const;
|
||||
/* Gets how many times the sound loops */
|
||||
const long int getLoops() const;
|
||||
|
||||
private:
|
||||
///Functions
|
||||
void LoadSound();
|
||||
void UnloadSound();
|
||||
|
||||
private:
|
||||
///Variables
|
||||
Mix_Chunk* mp_sound;// = nullptr
|
||||
|
||||
cString m_dir;// = ""
|
||||
cString m_fileName;// = ""
|
||||
|
||||
|
||||
unsigned char m_volume;// = 255
|
||||
unsigned char m_distance;// = 100
|
||||
|
||||
short int m_angle;// = 0
|
||||
long int m_channel;// = -1
|
||||
long int m_loops;// = 0
|
||||
};/// END CLASS DEFINITION cSound
|
||||
}/// END NAMESPACE DEFINITION AudioEngine
|
||||
#endif/// END IFNDEF _CSOUND_HPP_
|
||||
Reference in new issue
Block a user