/*---------------------------------------------------------------------------* Project: NintendoWare File: gfx_GlImplement.cpp Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Revision: 23868 $ *---------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/ /* */ /* Copyright (c) 2009, Digital Media Professionals Inc. All rights reserved. */ /* */ /*------------------------------------------------------------------------------*/ #include //=============================================================== // // WARNING: このヘッダーに含まれるAPIや構造体を直接参照しないでください。 // //=============================================================== namespace nw { namespace gfx { namespace internal { //--------------------------------------------------------------------------- void nwgfxAddVramDmaCommand(void* srcaddr, void* dstaddr, GLsizei size) { nngxAddVramDmaCommand( srcaddr, dstaddr, size); } //--------------------------------------------------------------------------- void nwgfxClear( u32 colorAddr, u32 colorSize, u32 clearColor, u32 colorWidth, u32 depthAddr, u32 depthSize, u32 clearDepth, u32 depthWidth ) { nngxAddMemoryFillCommand( reinterpret_cast(colorAddr), colorSize, clearColor, colorWidth, reinterpret_cast(depthAddr), depthSize, clearDepth, depthWidth ); } //--------------------------------------------------------------------------- void GetFrameBufferState( GLuint fboID, u32* pColorAddr, u32* pDepthAddr ) { glBindFramebuffer( GL_FRAMEBUFFER, fboID ); if ( pColorAddr ) { s32 renderID; s32 addr; glGetFramebufferAttachmentParameteriv( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &renderID ); glBindRenderbuffer(GL_RENDERBUFFER, renderID); glGetRenderbufferParameteriv( GL_RENDERBUFFER, GL_RENDERBUFFER_DATA_ADDR_DMP, &addr ); *pColorAddr = static_cast(addr); } if ( pDepthAddr ) { s32 renderID; s32 addr; glGetFramebufferAttachmentParameteriv( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &renderID ); glBindRenderbuffer(GL_RENDERBUFFER, renderID); glGetRenderbufferParameteriv( GL_RENDERBUFFER, GL_RENDERBUFFER_DATA_ADDR_DMP, &addr ); *pDepthAddr = static_cast(addr); } } } // namespace internal } // namespace gfx } // namespace nw