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 #ifndef GRADIENT_DRAWING
24 #include "osdwinpixel.h"
26 #include "surfacewin.h"
34 //This is stuff for rendering the OSD
36 OsdWinPixel::OsdWinPixel()
43 OsdWinPixel::~OsdWinPixel()
51 Surface * OsdWinPixel::createNewSurface(){
52 return (Surface*)new SurfaceWin();
55 int OsdWinPixel::init()
57 if (initted) return 0;
59 if (!createDirect3D9Objects()) return 0;
60 GdiplusStartup(&gdiptoken, &gdipstartup, NULL);
62 VideoWin* video = (VideoWin*)Video::getInstance();
63 //Now we will create the Screen
64 screen = new SurfaceWin(Surface::SCREEN);
65 screen->create(video->getScreenWidth(), video->getScreenHeight());
67 initted = true; // must set this here or create surface won't work
75 int OsdWinPixel::shutdown()
77 if (!initted) return 0;
80 shutdownDirect3D9Objects();
82 Gdiplus::GdiplusShutdown(gdiptoken);
87 bool OsdWinPixel::screenShot(const char* fileName)
89 return screen->screenShot(fileName);
92 LPDIRECT3DTEXTURE9 OsdWinPixel::getNextOsdTexture()
94 return ((SurfaceWin*)screen)->getD3dtexture();
97 void OsdWinPixel::lostDestroyObjects()
99 ((SurfaceWin*)screen)->ReleaseSurface();
102 void OsdWinPixel::lostRecreateObjects()
104 Video *video = Video::getInstance();
105 screen->create(video->getScreenWidth(), video->getScreenHeight());
109 void OsdWinPixel::getTextureCoordinates(FLOAT*x, FLOAT*y)
111 Video* video = Video::getInstance();
112 FLOAT texx = ((float)video->getScreenWidth()) / 1024.f;
113 FLOAT texy = ((float)video->getScreenHeight()) / 1024.f;