#include "../main.h"\r
#include "VideoUpdate.h"\r
\r
+\r
// include the Direct3D Library file\r
#ifdef WIN32\r
#pragma comment (lib, "d3d9.lib")\r
\r
CVideoUpdate::CVideoUpdate()\r
{\r
-#ifdef WIN32\r
- d3d = Direct3DCreate9(D3D_SDK_VERSION);\r
-\r
- D3DPRESENT_PARAMETERS d3dpp;\r
- D3DDISPLAYMODE d3ddm;\r
- d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);\r
-\r
- ZeroMemory(&d3dpp, sizeof(d3dpp));\r
- d3dpp.Windowed = true;\r
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;\r
- d3dpp.hDeviceWindow = hWnd;\r
- //d3dpp.BackBufferFormat = d3ddm.Format;\r
- d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8;\r
- d3dpp.BackBufferWidth = scrWidth;\r
- d3dpp.BackBufferHeight = scrHeight;\r
-\r
-\r
- // create a device class using this information and the info from the d3dpp stuct\r
- d3d->CreateDevice(D3DADAPTER_DEFAULT,\r
- D3DDEVTYPE_HAL,\r
- hWnd,\r
- D3DCREATE_SOFTWARE_VERTEXPROCESSING,\r
- &d3dpp,\r
- &d3ddev);\r
-\r
- // Turn on alpha-blending\r
- d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);\r
- // Set the render state up for source alpha blending.\r
- d3ddev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);\r
- d3ddev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);\r
- // Get the alpha information solely from the texture.\r
- d3ddev->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);\r
- d3ddev->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);\r
-#endif // WIN32\r
}\r
\r
CVideoUpdate::~CVideoUpdate()\r
{\r
-#ifdef WIN32\r
- if (d3ddev != NULL) d3ddev->Release();\r
- if (d3d != NULL) d3d->Release();\r
-#endif // WIN32\r
}\r
\r
bool CVideoUpdate::Start()\r
//hide the mouse cursor\r
SDL_ShowCursor(SDL_DISABLE);\r
*/\r
-#ifdef WIN32\r
- d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_COLORVALUE(0.0f, 0.4f, 1.0f, 1.0f), 1.0f, 0);\r
-\r
- d3ddev->BeginScene(); // begins the 3D scene\r
-#endif // WIN32\r
+ this->g = new Graphics(scrWidth, scrHeight, 16, false);\r
+ if (this->g->createDisplay())\r
+ return false;\r
+ this->g->setCullingMode(AM_CULL_NONE);\r
+ this->g->setBackground(COLOUR_RGBA(127, 127, 127, 255));\r
\r
- return true;\r
+ this->s = new Sprite("Data/POWBOMB.png", COLOUR_RGBA(0, 0, 255, 255), 64, 64, this->g);\r
+ return true;\r
}\r
\r
void CVideoUpdate::Update()\r
{\r
-#ifdef WIN32\r
- // end frame\r
- d3ddev->EndScene();\r
- d3ddev->Present(NULL, NULL, NULL, NULL);\r
-\r
- // start new frame\r
- d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_COLORVALUE(0.0f, 0.4f, 1.0f, 1.0f), 1.0f, 0);\r
- d3ddev->BeginScene();\r
-#endif // WIN32\r
+ this->g->beginScene();\r
+ this->s->blit(0, 0, 1.0, 1.0, 0, 0, COLOUR_RGBA(255, 255, 255, 255));\r
+ this->g->endScene();\r
}\r
\r
void CVideoUpdate::Stop()\r
{\r
-// SDL_QuitSubSystem(SDL_INIT_VIDEO);\r
+ delete this->g;\r
}\r