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"
27 #include "surfacewin.h"
35 //This is stuff for rendering the OSD
37 OsdWinPixel::OsdWinPixel()
44 OsdWinPixel::~OsdWinPixel()
52 int OsdWinPixel::getFD()
54 if (!initted) return 0;
58 Surface * OsdWinPixel::createNewSurface(){
59 return (Surface*)new SurfaceWin();
62 int OsdWinPixel::init(void* device)
64 if (initted) return 0;
66 if (!createDirect3D9Objects()) return 0;
67 GdiplusStartup(&gdiptoken, &gdipstartup, NULL);
69 VideoWin* video = (VideoWin*)Video::getInstance();
70 //Now we will create the Screen
71 screen = new SurfaceWin(Surface::SCREEN);
72 screen->create(video->getScreenWidth(), video->getScreenHeight());
74 initted = 1; // must set this here or create surface won't work
82 int OsdWinPixel::shutdown()
84 if (!initted) return 0;
87 shutdownDirect3D9Objects();
89 Gdiplus::GdiplusShutdown(gdiptoken);
94 void OsdWinPixel::screenShot(const char* fileName)
96 screen->screenShot(fileName);
99 LPDIRECT3DTEXTURE9 OsdWinPixel::getNextOsdTexture()
101 return ((SurfaceWin*)screen)->getD3dtexture();
104 void OsdWinPixel::lostDestroyObjects()
106 ((SurfaceWin*)screen)->ReleaseSurface();
109 void OsdWinPixel::lostRecreateObjects()
111 Video *video = Video::getInstance();
112 screen->create(video->getScreenWidth(), video->getScreenHeight());
116 void OsdWinPixel::getTextureCoordinates(FLOAT*x, FLOAT*y)
118 Video* video = Video::getInstance();
119 FLOAT texx = ((float)video->getScreenWidth()) / 1024.f;
120 FLOAT texy = ((float)video->getScreenHeight()) / 1024.f;