1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_GlImplement.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 /*                                                                              */
19 /*  Copyright (c) 2009, Digital Media Professionals Inc. All rights reserved.   */
20 /*                                                                              */
21 /*------------------------------------------------------------------------------*/
22 #ifndef NW_GFX_GL_IMPLEMENT_H_
23 #define NW_GFX_GL_IMPLEMENT_H_
24 
25 #include <nw/types.h>
26 
27 #include <gles2/gl2.h>
28 #include <gles2/gl2ext.h>
29 #include <nn/gx.h>
30 #include <string.h>
31 #include <nn/gx/CTR/gx_CommandAccess.h>
32 
33 //===============================================================
34 //
35 // WARNING: このヘッダーに含まれるAPIや構造体を直接参照しないでください。
36 //
37 //===============================================================
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #define MAX_PER_PIXEL_LIGHTS            8
44 
45 typedef void* (*dmpgl_allocator_t)(GLenum, GLenum, GLuint, GLsizei);
46 typedef void (*dmpgl_deallocator_t)(GLenum, GLenum ,GLuint, void*);
47 
48 extern dmpgl_allocator_t __dmpgl_allocator;
49 extern dmpgl_deallocator_t  __dmpgl_deallocator;
50 
51 extern unsigned* __cb_current_command_buffer;
52 extern unsigned* __cb_current_max_command_buffer;
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 namespace nw {
59 namespace gfx {
60 namespace internal {
61 
62 void nwgfxAddVramDmaCommand(void* srcaddr, void* dstaddr, GLsizei size);
63 void nwgfxClear(
64     u32 colorAddr, u32 colorSize, u32 clearColor, u32 colorWidth,
65     u32 depthAddr, u32 depthSize, u32 clearDepth, u32 depthWidth
66 );
67 
68 void
69 GetFrameBufferState(
70     GLuint fboID,
71     u32* pColorAddr,
72     u32* pDepthAddr
73 );
74 
75 } // namespace internal
76 } // namespace gfx
77 } // namespace nw
78 
79 
80 
81 
82 #endif // NW_GFX_GL_IMPLEMENT_H_
83