1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     dev_Utility.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_DEV_UTILITY_H_
19 #define NW_DEV_UTILITY_H_
20 
21 #include <nw/types.h>
22 #include <GLES2/gl2.h>
23 #include <GLES2/gl2ext.h>
24 
25 
26 #if defined(NW_DEV_ENABLED)
27 
28 //! @brief        Debug/Development/Release のビルドターゲットに関係なく、コンソールへ文字列を出力します。
29 //!
30 //! @param[in]    fmt       フォーマット文字列です。
31 //! @param[in]    ...       フォーマットパラメータです。
32 //
33 void NW_DEV_LOG( const char* fmt, ... );
34 
35 namespace nw {
36 namespace dev {
37 
38 //! @brief 指定したカラーフォーマットとサイズで必要なメモリサイズを計算します。
39 int CalcMemorySize(GLint format, int width, int height);
40 
41 //! @brief カラーフォーマットからバイト数を計算します。
42 int FormatToByte(GLint format);
43 
44 } // namespace nw::dev
45 } // namespace nw
46 
47 #else
48 
49 #define NW_DEV_LOG(...) (void)0
50 
51 namespace nw {
52 namespace dev {
53 
CalcMemorySize(GLint,int,int)54 inline int CalcMemorySize(GLint, int, int) { return 0; }
55 
FormatToByte(GLint)56 inline int FormatToByte(GLint) { return 0; }
57 
58 } // namespace nw::dev
59 } // namespace nw
60 
61 #endif // NW_DEV_ENABLED
62 
63 #endif // NW_DEV_UTILITY_H_
64 
65