OSDN Git Service

キャプチャ部分のバグ修正。
[winaudioj/wasapi2.git] / wasapi2 / dpi.cpp
1 /*
2   ==============================================================================
3
4    This file is part of the async
5    Copyright 2005-10 by Satoshi Fujiwara.
6
7    async can be redistributed and/or modified under the terms of the
8    GNU General Public License, as published by the Free Software Foundation;
9    either version 2 of the License, or (at your option) any later version.
10
11    async 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.
15
16    You should have received a copy of the GNU General Public License
17    along with async; if not, visit www.gnu.org/licenses or write to the
18    Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
19    Boston, MA 02111-1307 USA
20
21   ==============================================================================
22 */
23
24 #include "StdAfx.h"
25 #if _DEBUG
26 #define _CRTDBG_MAP_ALLOC
27 #include <crtdbg.h>
28 #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
29 #endif
30 #include "sf_windows.h"
31 #include "dpi.h"
32
33 namespace sf {
34   void dpi::init()
35   {
36     if (!init_)
37     {
38       sf::get_dc hdc(0);
39       if (hdc.get())
40       {
41         dpi_x_ = GetDeviceCaps(hdc.get(), LOGPIXELSX);
42         dpi_y_ = GetDeviceCaps(hdc.get(), LOGPIXELSY);
43         ReleaseDC(NULL, hdc.get());
44       }
45       init_ = true;
46     }
47   }
48
49 }