Files
eepp/src/graphics/cframebufferpbuffer.hpp
spartanj 66ead32bcc Added support for Frame Buffers, FBO and PBuffer (win and linux ftm), better known as render to texture.
Added loading from memory of texture groups.
Fixed minor things.
2010-08-24 05:20:02 -03:00

78 lines
2.3 KiB
C++

#ifndef EE_GRAPHICSCFRAMEBUFFERPBUFFER_HPP
#define EE_GRAPHICSCFRAMEBUFFERPBUFFER_HPP
/** Part of this code is based on the implementation of PBuffers from:
*
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
*
* NOTE by Martin Golini: This is not the original version, so differs from SFML implementation.
*/
#include "base.hpp"
#include "cframebuffer.hpp"
#if EE_PLATFORM == EE_PLATFORM_WIN32
#include "../helper/glew/wglew.h"
#elif EE_PLATFORM == EE_PLATFORM_LINUX
#include "../helper/glew/glxew.h"
#include <X11/Xlib.h>
#elif EE_PLATFORM == EE_PLATFORM_APPLE
#include <AGL/agl.h>
#warning No PBuffer implemented on MAC
#else
#warning No PBuffer implemented on this platform
#endif
namespace EE { namespace Graphics {
class cFrameBufferPBuffer : public cFrameBuffer {
public:
cFrameBufferPBuffer();
~cFrameBufferPBuffer();
cFrameBufferPBuffer( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false );
bool Create( const Uint32& Width, const Uint32& Height );
bool Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer );
void Bind();
void Unbind();
static bool IsSupported();
protected:
#if EE_PLATFORM == EE_PLATFORM_WIN32
HDC mDeviceContext;
HPBUFFERARB mPBuffer;
HGLRC mContext;
#elif EE_PLATFORM == EE_PLATFORM_LINUX
::Display* mDisplay;
GLXPbuffer mPBuffer;
GLXContext mContext;
#endif
};
}}
#endif