X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=ABM2%2FEngine%2FVideoUpdate.cpp;h=e3f36c585e29616602c53f7f1f8fcd7b04afb29d;hb=75d4212e8548f64904bad6d7f8978c077e6687d0;hp=270a67b07a22f9da440f72075da83c601969f0f1;hpb=b17f47041c9259eb6b7487df06da0be5fc5d1609;p=matthijs%2FABM2.git diff --git a/ABM2/Engine/VideoUpdate.cpp b/ABM2/Engine/VideoUpdate.cpp index 270a67b..e3f36c5 100755 --- a/ABM2/Engine/VideoUpdate.cpp +++ b/ABM2/Engine/VideoUpdate.cpp @@ -7,16 +7,6 @@ #include "VideoUpdate.h" -// include the Direct3D Library file -#ifdef WIN32 -#pragma comment (lib, "d3d9.lib") -#pragma comment (lib, "d3dx9.lib") - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// -LPDIRECT3DDEVICE9 d3ddev; // the pointer to the device class -#endif //WIN32 CMMPointer > CVideoUpdate::screenWidth=0; CMMPointer > CVideoUpdate::screenHeight=0; CMMPointer > CVideoUpdate::screenBPP=0; @@ -24,8 +14,10 @@ int CVideoUpdate::scrWidth=640; int CVideoUpdate::scrHeight=480; int CVideoUpdate::scrBPP=16; -CVideoUpdate::CVideoUpdate() +CVideoUpdate::CVideoUpdate(CKernel* kernel) : ITask(kernel) { + assert(screenWidth && screenHeight && screenBPP); + this->g = new Graphics(scrWidth, scrHeight, 16, false); } CVideoUpdate::~CVideoUpdate() @@ -34,7 +26,6 @@ CVideoUpdate::~CVideoUpdate() bool CVideoUpdate::Start() { - assert(screenWidth && screenHeight && screenBPP); /* if(-1==SDL_InitSubSystem(SDL_INIT_VIDEO)) { @@ -59,24 +50,25 @@ bool CVideoUpdate::Start() //hide the mouse cursor SDL_ShowCursor(SDL_DISABLE); */ - this->g = new Graphics(scrWidth, scrHeight, 16, false); if (this->g->createDisplay()) return false; this->g->setCullingMode(AM_CULL_NONE); this->g->setBackground(COLOUR_RGBA(127, 127, 127, 255)); - - this->s = new Sprite("Data/POWBOMB.png", COLOUR_RGBA(0, 0, 255, 255), 64, 64, this->g); + + /* Start a first scene */ + this->g->beginScene(); return true; } void CVideoUpdate::Update() { - this->g->beginScene(); - this->s->blit(0, 0, 1.0, 1.0, 0, 0, COLOUR_RGBA(255, 255, 255, 255)); this->g->endScene(); + this->g->beginScene(); } void CVideoUpdate::Stop() { + /* End the last scene */ + this->g->endScene(); delete this->g; }