Code Search for Developers
 
 
  

pixelbuffer.h from NeoEngineNG at Krugle


Show pixelbuffer.h syntax highlighted

/***************************************************************************
            pixelbuffer.h  -  OpenGL pixel buffer implementation
                             -------------------
    begin                : Thu Apr 17 2003
    copyright            : (C) 2003 by Cody Russell
    email                : cody [at] jhu.edu

  	last modify date	: Fri Jul 07 2006
	last modify			: 
	l.m. copyright   	: (C) 2006 by Arcadia Design s.r.l.
    email       		: Dario Deledda (penguindark@hotmail.com)

 ***************************************************************************

 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at 
 http://www.mozilla.org/MPL/

 Software distributed under the License is distributed on an "AS IS" basis,
 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 for the specific language governing rights and limitations under the
 License.

 The Original Code is the NeoEngine, NeoDevOpenGL, pixelbuffer.h

 The Initial Developer of the Original Code is Cody Russell.
 Portions created by Cody Russell are Copyright (C) 2003
 Cody Russell. All Rights Reserved.

 Contributors: Mattias Jansson (mattias@realityrift.com)

 ***************************************************************************/

#ifndef __NEOGLPIXELBUFFER_H
#define __NEOGLPIXELBUFFER_H


#include "extensions.h"
#include "texture.h"

#include <neoengine/activator.h>
#include <neoengine/pixelbuffer.h>



/**
  * \file pixelbuffer.h
  * Classes for OpenGL pixel buffers
  */


namespace NeoOGL
{


// External classes
class Device;


/**
  * \brief OpenGL pixel buffer implementation
  * \author Cody Russell (cody [at] jhu.edu)
  * \author Mattias Jansson (mattias@realityrift.com)
  */
class PixelBuffer : public NeoEngine::PixelBuffer, virtual public NeoEngine::Activator
{
	protected:

		/*! Device */
		Device                                       *m_pkDevice;

		/*! Flag indicating if buffer is currently bound */
		bool                                          m_bIsBound;

		/*! Texture */
		NeoEngine::TexturePtr                         m_pkTexture;

		/*! Multi Target Texture */
		std::vector< NeoEngine::TexturePtr >          m_vMtTexture;

		/*! Stored viewport */
		NeoEngine::Viewport                           m_kViewport;

		/*! Current cubemap face */
		Texture::TEXTURECUBEMAPFACE                   m_eCurCubemapFace;

		/*! Frame buffer object handle if available */
		GLuint										  m_iFrameBufObj;

		/*! Frame buffer zbuffer object's handle if available */
		GLuint										  m_iDepthBufObj;

		/*! Frame buffer cubemap object's handle if available */
		GLuint										  m_iCubeMapBufObj[6];

/*
#if defined(WIN32)

		void                                          ModeSwitch();

		HDC                                           m_hDC;
		HGLRC                                         m_hGLRC;
		HPBUFFERARB                                   m_hPbuffer;

#elif defined(POSIX)

		bool                                          m_bShareObjects;

		Display                                      *m_pDisplay;
		GLXPbuffer                                    m_glxPbuffer;
		GLXContext                                    m_glxContext;

#elif defined(__APPLE__)

		AGLContext                                    m_aglContext;
		WindowPtr                                     m_pWindow;

#endif
*/

		/**
		* Grab texture data
		*/
		void                                          GrabTexture();


	public:

		/**
		* \param pkDevice                             Render device
		*/
		                                              PixelBuffer( Device *pkDevice );

		/**
		*/
		virtual                                      ~PixelBuffer();

		/**
		* Open pixel buffer with specified dimensions and attributes
		* \param uiWidth                              Width
		* \param uiHeight                             Height
		* \param uiBPP                                Bits per pixel
		* \param eTextureType                         Target texture type (2D, cubemap, ... )
		* \param eTextureFormat						  Target texture format
		* \return                                     true if successful, false if error
		*/
//		bool                                          Open( unsigned int uiWidth, unsigned int uiHeight, unsigned int uiBPP, Texture::TEXTURETYPE eTextureType );
		bool                                          Open( unsigned int uiWidth, unsigned int uiHeight, unsigned int uiBPP, Texture::TEXTURETYPE eTextureType, Texture::TEXTUREFORMAT eTextureFormat );

		unsigned int								  AddTarget( NeoEngine::TexturePtr pTexture);
		bool										  RemoveTarget( NeoEngine::TexturePtr pTexture);

		/**
		* Close pixelbuffer and deallocate resources
		*/
		void                                          Close();

		/**
		* Activate this pixelbuffer
		*/
		virtual void                                  Activate();

		/**
		* Deactivate this pixelbuffer
		*/
		virtual void                                  Deactivate();

		/**
		* Bind buffer
		*/
		int                                           Bind();

		/**
		* Relese buffer
		*/
		int                                           Release();

		/**
		* Set active target cubemap face. Ignored for non-cubemap target texture types
		* \param eCubeMapFace                         Which cubemap face to render to
		*/
		virtual void                                  SetCubeMapFace( Texture::TEXTURECUBEMAPFACE eCubeMapFace );

		/**
		* Get texture object from this pixel buffer
		* \return                                     Texture
		*/
		virtual const NeoEngine::TexturePtr          &GetTexture() { return m_pkTexture; }

};


};


#endif






See more files for this project here

NeoEngineNG

NeoenEngine NG (Next Generation) is the evolution of neoengine one,it\'s a different development from NeoEngine2, it\'s a direct inherits from NeoEngine one.\n

Project homepage: http://sourceforge.net/projects/neoengineng
Programming language(s): C,C++
License: other

  glew/
    bin/
      glew32.dll
      glewinfo.exe
      visualinfo.exe
    doc/
      advanced.html
      basic.html
      credits.html
      glew.css
      glew.html
      glew.png
      glx.txt
      glxew.html
      gpl.txt
      index.html
      install.html
      log.html
      new.png
      ogl_sm.jpg
      sgi.txt
      wglew.html
    include/
      GL/
    lib/
      glew32.lib
      glew32s.lib
  Makefile.am
  SConscript
  base.h
  begin.cpp
  buffermanager.cpp
  buffermanager.h
  bufferregion.cpp
  bufferregion.h
  callback.cpp
  clear.cpp
  close.cpp
  config.cpp
  device.cpp
  device.h
  end.cpp
  execute.cpp
  extensions.cpp
  extensions.h
  flip.cpp
  framebuffertarget.cpp
  framebuffertarget.h
  glext.h
  glue.cpp
  glxext.h
  initialize.cpp
  input.cpp
  light.cpp
  link.h
  mouse.cpp
  neodevopengl-static.dev
  neodevopengl.cbp
  neodevopengl.depend
  neodevopengl.dev
  neodevopengl.dsp
  neodevopengl.layout
  neodevopengl.vcproj
  op.h
  open.cpp
  pixelbuffer.cpp
  pixelbuffer.h
  pixelbuffertarget.cpp
  pixelbuffertarget.h
  polygonbuffer.cpp
  polygonstripbuffer.cpp
  program-glsl.cpp
  program-glsl.h
  projection.cpp
  query.cpp
  render.cpp
  renderqueue.cpp
  renderqueue.h
  rendertarget.cpp
  rendertarget.h
  resize.cpp
  shader.cpp
  shader.h
  shadowmap.cpp
  shadowmap.h
  shutdown.cpp
  statistics.cpp
  statistics.h
  stencilbuffer.cpp
  texture.cpp
  texture.h
  textureunit.cpp
  textureunit.h
  vertexbuffer-glsl.cpp
  vertexbuffer-glsl.h
  vertexbuffer.cpp
  vertexbuffer.h
  vertexbuffermanager-glsl.cpp
  vertexbuffermanager-glsl.h
  vertexbuffermanager-nobs.cpp
  vertexbuffermanager-nobs.h
  vertexbuffermanager.cpp
  vertexbuffermanager.h
  viewport.cpp
  wglext.h
  zbufferstate.cpp
  zbufferstate.h