Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
VideoFactory.cpp
Go to the documentation of this file.
1
/* Project nGenEx
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: nGenEx.lib
6
FILE: VideoFac.cpp
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Video and Polygon Renderer Factory class
13
*/
14
15
#include "
MemDebug.h
"
16
#include "
VideoFactory.h
"
17
18
#include "
VideoDX9.h
"
19
#include "
SoundD3D.h
"
20
21
// +--------------------------------------------------------------------+
22
23
VideoFactory::VideoFactory
(HWND h)
24
: hwnd(h), video(0), audio(0)
25
{ }
26
27
VideoFactory::~VideoFactory
()
28
{ }
29
30
// +--------------------------------------------------------------------+
31
32
Video
*
33
VideoFactory::CreateVideo
(
VideoSettings
* vs)
34
{
35
if
(!video) {
36
video = (
Video
*)
new
(__FILE__,__LINE__)
VideoDX9
(hwnd, vs);
37
38
if
(!video) {
39
delete
video;
40
video = 0;
41
}
42
}
43
44
return
video;
45
}
46
47
// +--------------------------------------------------------------------+
48
49
void
50
VideoFactory::DestroyVideo
(
Video
* v)
51
{
52
if
(v == video) {
53
delete
video;
54
video = 0;
55
}
56
}
57
58
// +--------------------------------------------------------------------+
59
60
SoundCard
*
61
VideoFactory::CreateSoundCard
()
62
{
63
if
(!audio) {
64
audio =
new
(__FILE__,__LINE__)
SoundCardD3D
(hwnd);
65
Sound::UseSoundCard
(audio);
66
}
67
68
return
audio;
69
}
70
71
nGenEx
VideoFactory.cpp
Generated on Tue Jun 5 2012 20:46:42 for Starshatter_Open by
1.8.1