source: GTP/trunk/App/Games/Jungle_Rumble/src/SharedResourceTexture.cpp @ 1378

Revision 1378, 1009 bytes checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#include "dxstdafx.h"
2#include ".\sharedresourcetexture.h"
3
4SharedResourceTexture::SharedResourceTexture(void) : SharedResource()
5{
6        this->texture = NULL;
7        this->creator = false;
8}
9
10SharedResourceTexture::~SharedResourceTexture(void)
11{
12        SAFE_RELEASE(this->texture);
13}
14
15void SharedResourceTexture::createTexture(int _width, int _height, D3DFORMAT _format, DWORD _usage, D3DPOOL _pool)
16{
17        HRESULT hr;
18        this->width = _width;
19        this->height = _height;
20        this->format = _format;
21        this->usage = _usage;
22        this->pool = _pool;
23
24        V( DXUTGetD3DDevice()->CreateTexture(   this->width, this->height, 1, this->usage,
25                this->format, this->pool, &this->texture, NULL ) );
26        this->creator = true;
27}
28
29void SharedResourceTexture::setTexture(IDirect3DTexture9* _texture)
30{
31        this->texture = _texture;
32}
33
34IDirect3DTexture9* SharedResourceTexture::getTexture()
35{
36        return this->texture;
37}
38
39void SharedResourceTexture::OnLostDevice()
40{
41        if(this->creator) {
42                SAFE_RELEASE(this->texture);
43        }
44}
Note: See TracBrowser for help on using the repository browser.