Files
SDLPongCPP/.svn/pristine/69/69829b534e57c0532af2cce24401073f37c00a00.svn-base
T
2018-06-25 21:48:45 -04:00

88 lines
1.7 KiB
Plaintext

/* 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;
}