<commit_before>/************************************************************************************\
This source file is part of the Awesome Portable Rendering Interface Library         *
For latest info, see http://libapril.sourceforge.net/                                *
**************************************************************************************
Copyright (c) 2010 <NAME> (<EMAIL>),                                 *
                   <NAME> (<EMAIL>)                                     *
*                                                                                    *
* This program is free software; you can redistribute it and/or modify it under      *
* the terms of the BSD license: http://www.opensource.org/licenses/bsd-license.php   *
\************************************************************************************/
#ifdef _OPENGL

#include "RenderSystem_GL.h"
#include "Keys.h"
#include "ImageSource.h"
#ifdef IPHONE_PLATFORM
#include <OpenGLES/ES1/gl.h>
#else
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdlib.h>

#ifndef __APPLE__
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#else // __APPLE__
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#include <OpenGLES/ES1/gl.h>
#else
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#endif
#endif // __APPLE__

#include <gtypes/Vector2.h>

#include "Window.h"
#include "Timer.h"

April::Timer globalTimer;

namespace April
{
	extern void (*g_logFunction)(chstr);

	float cursor_x=0,cursor_y=0;

	unsigned int platformLoadGLTexture(const char* name,int* w,int* h)
	{
		GLuint texid;
		ImageSource* img=loadImage(name);
		if (!img) return 0;
		*w=img->w; *h=img->h;
		glGenTextures(1, &texid);
		glBindTexture(GL_TEXTURE_2D, texid);
		
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

		// TODO check why the third argument was img->bpp
		glTexImage2D(GL_TEXTURE_2D, 0, img->format, img->w,img->h, 0, img->format, GL_UNSIGNED_BYTE,img->data);
		delete img;
<commit_msg>Fixed call to glTexImage2D<commit_after>/************************************************************************************\
This source file is part of the Awesome Portable Rendering Interface Library         *
For latest info, see http://libapril.sourceforge.net/                                *
**************************************************************************************
Copyright (c) 2010 <NAME> (<EMAIL>),                                 *
                   <NAME> (<EMAIL>)                                     *
*                                                                                    *
* This program is free software; you can redistribute it and/or modify it under      *
* the terms of the BSD license: http://www.opensource.org/licenses/bsd-license.php   *
\************************************************************************************/
#ifdef _OPENGL

#include "RenderSystem_GL.h"
#include "Keys.h"
#include "ImageSource.h"
#ifdef IPHONE_PLATFORM
#include <OpenGLES/ES1/gl.h>
#else
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdlib.h>

#ifndef __APPLE__
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#else // __APPLE__
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#include <OpenGLES/ES1/gl.h>
#else
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#endif
#endif // __APPLE__

#include <gtypes/Vector2.h>

#include "Window.h"
#include "Timer.h"

April::Timer globalTimer;

namespace April
{
	extern void (*g_logFunction)(chstr);

	float cursor_x=0,cursor_y=0;

	unsigned int platformLoadGLTexture(const char* name,int* w,int* h)
	{
		GLuint texid;
		ImageSource* img=loadImage(name);
		if (!img) return 0;
		*w=img->w; *h=img->h;
		glGenTextures(1, &texid);
		glBindTexture(GL_TEXTURE_2D, texid);
		
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

		glTexImage2D(GL_TEXTURE_2D, 0, img->bpp == 4 ? GL_RGBA : GL_RGB, img->w,img->h, 0, img->format, GL_UNSIGNED_BYTE,img->data);
		delete img;

{'fraction_non_alphanumeric': 0.23331733077292366, 'fraction_numerical': 0.010081613058089293, 'mean_word_length': 3.349686847599165, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '810369', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1301, 'n_words': 298}