2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "osdwinpixel.h"
25 #include "surfacewin.h"
33 //This is stuff for rendering the OSD
35 OsdWinPixel::OsdWinPixel()
42 OsdWinPixel::~OsdWinPixel()
50 int OsdWinPixel::getFD()
52 if (!initted) return 0;
56 Surface * OsdWinPixel::createNewSurface(){
57 return (Surface*)new SurfaceWin();
60 int OsdWinPixel::init(void* device)
62 if (initted) return 0;
64 if (!createDirect3D9Objects()) return 0;
65 GdiplusStartup(&gdiptoken, &gdipstartup, NULL);
67 VideoWin* video = (VideoWin*)Video::getInstance();
68 //Now we will create the Screen
69 screen = new SurfaceWin(Surface::SCREEN);
70 screen->create(video->getScreenWidth(), video->getScreenHeight());
72 initted = 1; // must set this here or create surface won't work
80 int OsdWinPixel::shutdown()
82 if (!initted) return 0;
84 shutdownDirect3D9Objects();
86 Gdiplus::GdiplusShutdown(gdiptoken);
91 void OsdWinPixel::screenShot(const char* fileName)
93 screen->screenShot(fileName);
96 LPDIRECT3DTEXTURE9 OsdWinPixel::getNextOsdTexture()
98 return ((SurfaceWin*)screen)->getD3dtexture();
101 void OsdWinPixel::lostDestroyObjects()
103 ((SurfaceWin*)screen)->ReleaseSurface();
106 void OsdWinPixel::lostRecreateObjects()
108 Video *video = Video::getInstance();
109 screen->create(video->getScreenWidth(), video->getScreenHeight());