<commit_before>/*

Copyright (c) 2010, <NAME>

Please see the license.txt file included with this source
distribution for more information.

*/

#ifndef __PHOENIXRS__
#define __PHOENIXRS__

#include <string>
#include <boost/bind.hpp>
#include <boost/signals2/signal.hpp>
#include <boost/noncopyable.hpp>
#include "config.h"
#include "ResourceManager.h"
#include "Timer.h"
#include "Vector2d.h"
#include "Rectangle.h"
#include "Polygon.h"
#include "WindowManager.h"
#include "BatchRenderer.h"
#include "AbstractGeometryFactory.h"
#include "DebugConsole.h"
#include "2dGraphicsFactory.h"
#include "Font.h"

//! The phoenix namespace.
namespace phoenix
{

	//! Ways of handling a window resize
	enum E_RESIZE_BEHAVIOR {
		RZB_NOTHING, //!< Do nothing, allow user code to handle resize. (default)
		RZB_EXPAND, //!< Expand the default view to the new window size.
		RZB_SCALE, //!< Scale up the view to the new window size.
		RZB_REVERT, //!< Reset the window size to the default view's size, effectively preventing the window resize.
	};

    //! The render system.
    /*!
        This is the heart of the Core. It ties together a ResourceManager, a BatchRender, Timer, and Fonts
        to provide a simply interface to drawing 2d objects in OpenGL. It provides texture loading and management,
        geometry factories and management, font loading and management, and access to a global resource manager.
        It also provides one entry point to initialize all of phoenix's subsystems.
    */
    class RenderSystem
		: public boost::noncopyable
    {

    public:

        //! Constructor
        /*!
           Creates a render system creates a window and opengl context. Once the system is constructed
           you are ready to start drawing stuff. It also initializes the singleton WindowManager..
           \sa run()
           \param _sz The size of the screen (default 640,480).
           \param _fs Full screen (default false).
        */
		RenderSystem( const Vector2d& _sz = Vector2d(640,480), bool _fs = false, bool _resize = true )
			: renderer(), 
			factory( renderer ),
			console(),
			resize_behavior(RZB_NOTHING),
			fpstimer(), 
			framerate(1.0f), 
			font(0), 
			_quit(false), 
			event_connection(),
			resources()
		{
			initialize( _sz, _fs, _resize );
		}

		//! Initialize
		/*!
			(Re)-initialize a rendersystem. This is automatically called by the constructor
			but it may be desirable sometimes to re-initialize a render system.
			\param _fs Creates a fullscreen window.
			\param _resize Creates a resizeable window (default is resizeable).
			\param _wm Window Manager to use for render system. If none, GLFWWindowManager will be used.
			\param _reint True if reinitializing an existing system ( usually true ).
			\note Throws and std::exception if problems arrive.
			\note Re-initialization invalides all OpenGL textures, etc. You should release all handles to resources, the debug console, everything before calling this.
		*/
		void initialize( const Vector2d& _sz = Vector2d(640,480), bool _fs = false, bool _resize = true, bool _reint = true );

        //! Destruct.
		/*!
			Releases all resource. Also called WindowManager::close().
		*/
        ~RenderSystem();

        //! Set blend mode.
        /*!
            Sets the blend mode for opengl. The default blend mode is GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA.
            If this is called without arguments, it restores the default blendmode.
            \param src The source factor, can be GL_ZERO, GL_ONE,
            GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA,
            GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA,
            GL_ONE_MINUS_DST_ALPHA, and GL_SRC_ALPHA_SATURATE
            \param dst The destination factor, can be GL_ZERO, GL_ONE,
            GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA,
            GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, and
            GL_ONE_MINUS_DST_ALPHA
			\sa getBlendSource(), setBlendSource(), getBlendDestination(), setBlendDestination()
        */
        inline static void setBlendMode(const GLenum& src = GL_SRC_ALPHA, const GLenum& dst = GL_ONE_MINUS_SRC_ALPHA ) { src_blend = src; dst_blend = dst; glBlendFunc(src,dst); }

        //! Get the current blend mode's source.
        inline static int getBlendSource() { return src_blend; }<commit_msg>documentation updates.<commit_after>/*

Copyright (c) 2010, <NAME>

Please see the license.txt file included with this source
distribution for more information.

*/

#ifndef __PHOENIXRS__
#define __PHOENIXRS__

#include <string>
#include <boost/bind.hpp>
#include <boost/signals2/signal.hpp>
#include <boost/noncopyable.hpp>
#include "config.h"
#include "ResourceManager.h"
#include "Timer.h"
#include "Vector2d.h"
#include "Rectangle.h"
#include "Polygon.h"
#include "WindowManager.h"
#include "BatchRenderer.h"
#include "AbstractGeometryFactory.h"
#include "DebugConsole.h"
#include "2dGraphicsFactory.h"
#include "Font.h"

//! The phoenix namespace.
namespace phoenix
{

	//! Ways of handling a window resize
	enum E_RESIZE_BEHAVIOR {
		RZB_NOTHING, //!< Do nothing, allow user code to handle resize. (default)
		RZB_EXPAND, //!< Expand the default view to the new window size.
		RZB_SCALE, //!< Scale up the view to the new window size.
		RZB_REVERT, //!< Reset the window size to the default view's size, effectively preventing the window resize.
	};

    //! The render system.
    /*!
        This is the heart of the Core. It ties together a ResourceManager, a BatchRender, Timer, and Fonts
        to provide a simply interface to drawing 2d objects in OpenGL. It provides texture loading and management,
        geometry factories and management, font loading and management, and access to a global resource manager.
        It also provides one entry point to initialize all of phoenix's subsystems.
    */
    class RenderSystem
		: public boost::noncopyable
    {

    public:

        //! Constructor
        /*!
           Creates a render system creates a window and opengl context. Once the system is constructed
           you are ready to start drawing stuff. 
           \sa run()
           \param _sz The size of the screen (default 640,480).
           \param _fs Full screen (default false).
        */
		RenderSystem( const Vector2d& _sz = Vector2d(640,480), bool _fs = false, bool _resize = true )
			: renderer(), 
			factory( renderer ),
			console(),
			resize_behavior(RZB_NOTHING),
			fpstimer(), 
			framerate(1.0f), 
			font(0), 
			_quit(false), 
			event_connection(),
			resources()
		{
			initialize( _sz, _fs, _resize );
		}

		//! Initialize
		/*!
			(Re)-initialize a rendersystem. This is automatically called by the constructor
			but it may be desirable sometimes to re-initialize a render system. It will check for an existing instance of WindowManager,
			if there isn't one it'll attempt to instance the GLFWWindowManager (or whatever default wm). 
			\param _fs Creates a fullscreen window.
			\param _resize Creates a resizeable window (default is resizeable).
			\param _reint True if reinitializing an existing system ( usually true ).
			\note Throws and std::exception if problems arrive.
			\note Re-initialization invalides all OpenGL textures, etc. You should release all handles to resources, the debug console, everything before calling this.
		*/
		void initialize( const Vector2d& _sz = Vector2d(640,480), bool _fs = false, bool _resize = true, bool _reint = true );

        //! Destruct.
		/*!
			Releases all resource. Also called WindowManager::close().
		*/
        ~RenderSystem();

        //! Set blend mode.
        /*!
            Sets the blend mode for opengl. The default blend mode is GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA.
            If this is called without arguments, it restores the default blendmode.
            \param src The source factor, can be GL_ZERO, GL_ONE,
            GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA,
            GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA,
            GL_ONE_MINUS_DST_ALPHA, and GL_SRC_ALPHA_SATURATE
            \param dst The destination factor, can be GL_ZERO, GL_ONE,
            GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA,
            GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, and
            GL_ONE_MINUS_DST_ALPHA
			\sa getBlendSource(), setBlendSource(), getBlendDestination(), setBlendDestination()
        */
        inline static void setBlendMode(const GLenum& src = GL_SRC_ALPHA, const GLenum& dst = GL_ONE_MINUS_SRC_ALPHA ) { src_blend = src; dst_blend = dst; glBlendFunc(src,dst); }

        //! Get the current blend mode's source.
        inline static int getBlendSource() { return src_blend; }
{'fraction_non_alphanumeric': 0.08443058443058443, 'fraction_numerical': 0.007623007623007623, 'mean_word_length': 3.1174512601046125, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6848668', 'n_tokens_mistral': 2813, 'n_tokens_neox': 2587, 'n_words': 921}