Befor NewSurface Fix

This commit is contained in:
2018-06-29 15:28:06 -04:00
parent 0a17c2cfe7
commit f85ff9fa96
10 changed files with 94 additions and 22 deletions
@@ -20,8 +20,6 @@
using UtilityEngine::cString;
namespace UtilityEngine {
/* Singleton */
class EXPORT_FROM_MYDLL cUtility
@@ -52,16 +50,13 @@ namespace UtilityEngine {
void PrintVersion( const eTypeSDL typeSDL = eTypeSDL::ALL ) const;
private:
///Functions
void VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const;
private:
///Variables
static cUtility* sp_inst;// = nullptr
};/// END CLASS DEFINITION cUtility
}/// END NAMESPACE DEFINITION UtilityEngine
#endif/// END IFNDEF _CUTILITY_HPP_
@@ -77,7 +77,8 @@ const bool cVideo::Setup()
void cVideo::CleanUp()
{
SDL_DestroyWindow(mp_window);
if (mp_window != nullptr)
SDL_DestroyWindow(mp_window);
mp_window = nullptr;
}
@@ -150,12 +150,16 @@
<ClCompile Include="main.cpp" />
<ClCompile Include="UTest\UTest.cpp" />
<ClCompile Include="UtilityEngineTest\StringTest.cpp" />
<ClCompile Include="VideoEngineTest\RendererTest.cpp" />
<ClCompile Include="VideoEngineTest\VideoTest.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="EventEngineTest\EventEngineTest.hpp" />
<ClInclude Include="GUIEngineTest\GUIXMLTest.hpp" />
<ClInclude Include="UTest\UTest.hpp" />
<ClInclude Include="UtilityEngineTest\StringTest.hpp" />
<ClInclude Include="VideoEngineTest\RendererTest.hpp" />
<ClInclude Include="VideoEngineTest\VideoTest.hpp" />
</ItemGroup>
<ItemGroup>
<Xml Include="xml\GUI.xml" />
@@ -33,6 +33,12 @@
<ClInclude Include="EventEngineTest\EventEngineTest.hpp">
<Filter>EventEngineTest</Filter>
</ClInclude>
<ClInclude Include="VideoEngineTest\RendererTest.hpp">
<Filter>VideoEngineTest</Filter>
</ClInclude>
<ClInclude Include="VideoEngineTest\VideoTest.hpp">
<Filter>VideoEngineTest</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="UTest\UTest.cpp">
@@ -48,6 +54,12 @@
<ClCompile Include="EventEngineTest\EventEngineTest.cpp">
<Filter>EventEngineTest</Filter>
</ClCompile>
<ClCompile Include="VideoEngineTest\RendererTest.cpp">
<Filter>VideoEngineTest</Filter>
</ClCompile>
<ClCompile Include="VideoEngineTest\VideoTest.cpp">
<Filter>VideoEngineTest</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Xml Include="xml\GUI.xml">
@@ -0,0 +1,21 @@
#include "RendererTest.hpp"
#include "../UTest/UTest.hpp"
/*** TrooperEngine DLL Header Files ***/
#include "TrooperEngine.hpp"
using VideoEngine::cRenderer;
void RendererTest()
{
// cRenderer
printf("\nTesting cRenderer -----\n\n");
UTest u("cRenderer");
SDL_Surface* sur = nullptr;
//cRenderer::Inst()->TextureToSurface();
u.report();
}
@@ -0,0 +1,6 @@
#ifndef __RENDERERTEST__
#define __RENDERERTEST__
void RendererTest();
#endif // __RENDERERTEST__
@@ -0,0 +1,33 @@
#include "VideoTest.hpp"
#include "../UTest/UTest.hpp"
/*** TrooperEngine DLL Header Files ***/
#include "TrooperEngine.hpp"
using VideoEngine::cVideo;
void VideoTest()
{
// cVideo
printf("\nTesting cVideo -----\n\n");
UTest u("cVideo");
TrooperEngineCore::cTrooperEngineCore::Inst();
VideoEngine::cVideo& video = VideoEngine::cVideo::Inst();
video.Initialize();
u.test("Video Initialize", video.IsInit());
u.test("Video Setup", video.Setup());
// CaptionTest
cString cap_set = "Hello World";
cVideo::Inst().setCaption(cap_set);
cString cap_get = cVideo::Inst().getCaption();
u.test("setCaption() and getCaption()", (cap_get == cap_set));
u.report();
}
@@ -0,0 +1,6 @@
#ifndef __VIDEOTEST__
#define __VIDEOTEST__
void VideoTest();
#endif // __VIDEOTEST__
+7 -13
View File
@@ -21,7 +21,13 @@ see license.txt for details
#include "UTest/UTest.hpp"
/*** Video Engine Test ***/
#include "VideoEngineTest/VideoTest.hpp"
/*** Utility Engine Test ***/
#include "UtilityEngineTest/StringTest.hpp"
/*** GUI Engine Test ***/
#include "GUIEngineTest/GUIXMLTest.hpp"
using UtilityEngine::cString;
@@ -38,21 +44,9 @@ int main(int argc, char *argv[])
printf(cString("TrooperEngine V") + TrooperEngineCore::cTrooperEngineCore::Version() + "\n");
UTest u("cVideo");
VideoTest();
printf("\nTesting cVideo\n");
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();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 900 KiB