<commit_before>#include "GLFWWindowManager.h"

using namespace phoenix;

/*!
    Open function.
*/
bool GLFWWindowManager::open( const Vector2d& _sz, const bool _f )
{

    // Set our internal screen size variable.
    screensize = _sz;

	// No GLFW functions may be called before this
	if( !glfwInit() ) return false;

	// Important defines
	#define RED_BITS 8
	#define BLUE_BITS 8
	#define GREEN_BITS 8
	#define ALPHA_BITS 8
	#define STENCIL_BITS 0
	#ifdef DISABLE_DEPTHBUFFER
		#define DEPTH_BITS 0
	#else
		#define DEPTH_BITS 8
	#endif

	int mode = _f ? GLFW_FULLSCREEN : GLFW_WINDOW;

	if( !glfwOpenWindow(int(_sz.getX()), int(_sz.getY()), RED_BITS, BLUE_BITS, GREEN_BITS, ALPHA_BITS, DEPTH_BITS, STENCIL_BITS, mode) ) return false;


	// Disable vsync.
	glfwSwapInterval( 0 );

	// Set the window caption
	setWindowTitle( PHOENIXCORE_VERSION );

	// Set GLFW event callbacks
	glfwSetKeyCallback( &GLFWWindowManager::glfwKeyboardCallback );
	glfwSetCharCallback( &GLFWWindowManager::glfwCharacterCallback );
	glfwSetMouseButtonCallback( &GLFWWindowManager::glfwKeyboardCallback );
	glfwSetMousePosCallback( &GLFWWindowManager::glfwMousePosCallback );
	glfwSetWindowCloseCallback( &GLFWWindowManager::glfwWindowCloseCallback );
	glfwSetMouseWheelCallback( &GLFWWindowManager::glfwMouseWheelPosCallback );
    glfwSetWindowSizeCallback( &GLFWWindowManager::glfwWindowResizeCallback );
	glfwSetWindowMoveCallback( &GLFWWindowManager::glfwWindowMoveCallback );

	// Disable key repeat; event receiver manages that.
	glfwDisable(GLFW_KEY_REPEAT);

	return true;

}

/*
	Swap Buffers and Update Events.
*/
void GLFWWindowManager::update() 
{
	// send the update event. ( done first because glfwSwapBuffers sends new events ).<commit_msg>Forgot to check for the glfw move hack definition in the source.<commit_after>#include "GLFWWindowManager.h"

using namespace phoenix;

/*!
    Open function.
*/
bool GLFWWindowManager::open( const Vector2d& _sz, const bool _f )
{

    // Set our internal screen size variable.
    screensize = _sz;

	// No GLFW functions may be called before this
	if( !glfwInit() ) return false;

	// Important defines
	#define RED_BITS 8
	#define BLUE_BITS 8
	#define GREEN_BITS 8
	#define ALPHA_BITS 8
	#define STENCIL_BITS 0
	#ifdef DISABLE_DEPTHBUFFER
		#define DEPTH_BITS 0
	#else
		#define DEPTH_BITS 8
	#endif

	int mode = _f ? GLFW_FULLSCREEN : GLFW_WINDOW;

	if( !glfwOpenWindow(int(_sz.getX()), int(_sz.getY()), RED_BITS, BLUE_BITS, GREEN_BITS, ALPHA_BITS, DEPTH_BITS, STENCIL_BITS, mode) ) return false;


	// Disable vsync.
	glfwSwapInterval( 0 );

	// Set the window caption
	setWindowTitle( PHOENIXCORE_VERSION );

	// Set GLFW event callbacks
	glfwSetKeyCallback( &GLFWWindowManager::glfwKeyboardCallback );
	glfwSetCharCallback( &GLFWWindowManager::glfwCharacterCallback );
	glfwSetMouseButtonCallback( &GLFWWindowManager::glfwKeyboardCallback );
	glfwSetMousePosCallback( &GLFWWindowManager::glfwMousePosCallback );
	glfwSetWindowCloseCallback( &GLFWWindowManager::glfwWindowCloseCallback );
	glfwSetMouseWheelCallback( &GLFWWindowManager::glfwMouseWheelPosCallback );
    glfwSetWindowSizeCallback( &GLFWWindowManager::glfwWindowResizeCallback );
#ifdef _GLFW_WM_MOVE_HACK
	glfwSetWindowMoveCallback( &GLFWWindowManager::glfwWindowMoveCallback );
#endif

	// Disable key repeat; event receiver manages that.
	glfwDisable(GLFW_KEY_REPEAT);

	return true;

}

/*
	Swap Buffers and Update Events.
*/
void GLFWWindowManager::update() 
{
	// send the update event. ( done first because glfwSwapBuffers sends new events ).
{'fraction_non_alphanumeric': 0.09083239595050618, 'fraction_numerical': 0.005061867266591676, 'mean_word_length': 5.490875912408759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5368372', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1184, 'n_words': 288}