Use EXT version of gl functions
This commit is contained in:
		
							parent
							
								
									ef6bacf201
								
							
						
					
					
						commit
						abc927c91d
					
				
					 3 changed files with 19 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -519,7 +519,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	gState->bindTex();
 | 
			
		||||
	TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA);
 | 
			
		||||
	TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA_EXT);
 | 
			
		||||
	TEX::setSmooth(true);
 | 
			
		||||
 | 
			
		||||
	Quad &quad = gState->gpQuad();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -166,26 +166,26 @@ namespace FBO
 | 
			
		|||
	inline ID gen()
 | 
			
		||||
	{
 | 
			
		||||
		ID id;
 | 
			
		||||
		glGenFramebuffers(1, &id.gl);
 | 
			
		||||
		glGenFramebuffersEXT(1, &id.gl);
 | 
			
		||||
 | 
			
		||||
		return id;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	inline void del(ID id)
 | 
			
		||||
	{
 | 
			
		||||
		glDeleteFramebuffers(1, &id.gl);
 | 
			
		||||
		glDeleteFramebuffersEXT(1, &id.gl);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	inline void bind(ID id, Mode mode = Default)
 | 
			
		||||
	{
 | 
			
		||||
		static const GLenum modes[] =
 | 
			
		||||
		{
 | 
			
		||||
			GL_DRAW_FRAMEBUFFER,
 | 
			
		||||
			GL_READ_FRAMEBUFFER,
 | 
			
		||||
			GL_FRAMEBUFFER
 | 
			
		||||
			GL_DRAW_FRAMEBUFFER_EXT,
 | 
			
		||||
			GL_READ_FRAMEBUFFER_EXT,
 | 
			
		||||
			GL_FRAMEBUFFER_EXT
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		glBindFramebuffer(modes[mode], id.gl);
 | 
			
		||||
		glBindFramebufferEXT(modes[mode], id.gl);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	inline void unbind(Mode mode = Default)
 | 
			
		||||
| 
						 | 
				
			
			@ -195,12 +195,12 @@ namespace FBO
 | 
			
		|||
 | 
			
		||||
	inline void setTarget(TEX::ID target, unsigned colorAttach = 0)
 | 
			
		||||
	{
 | 
			
		||||
		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_TEXTURE_2D, target.gl, 0);
 | 
			
		||||
		glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_TEXTURE_2D, target.gl, 0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	inline void setTarget(RBO::ID target, unsigned colorAttach = 0)
 | 
			
		||||
	{
 | 
			
		||||
		glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_RENDERBUFFER, target.gl);
 | 
			
		||||
		glFramebufferRenderbufferEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_RENDERBUFFER, target.gl);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	inline void blit(int srcX, int srcY,
 | 
			
		||||
| 
						 | 
				
			
			@ -208,7 +208,7 @@ namespace FBO
 | 
			
		|||
	                 int dstX, int dstY,
 | 
			
		||||
	                 int dstW, int dstH)
 | 
			
		||||
	{
 | 
			
		||||
		glBlitFramebuffer(srcX, srcY, srcX+srcW, srcY+srcH,
 | 
			
		||||
		glBlitFramebufferEXT(srcX, srcY, srcX+srcW, srcY+srcH,
 | 
			
		||||
		                     dstX, dstY, dstX+dstW, dstY+dstH,
 | 
			
		||||
		                     GL_COLOR_BUFFER_BIT, GL_NEAREST);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,20 +69,20 @@ void GLBlendMode::apply(const BlendType &value)
 | 
			
		|||
 | 
			
		||||
	case BlendNormal :
 | 
			
		||||
		glBlendEquation(GL_FUNC_ADD);
 | 
			
		||||
		glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
 | 
			
		||||
		glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
 | 
			
		||||
		                       GL_ONE,       GL_ONE_MINUS_SRC_ALPHA);
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case BlendAddition :
 | 
			
		||||
		glBlendEquation(GL_FUNC_ADD);
 | 
			
		||||
		glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE,
 | 
			
		||||
		glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE,
 | 
			
		||||
		                       GL_ONE,       GL_ONE);
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case BlendSubstraction :
 | 
			
		||||
		// FIXME Alpha calculation is untested
 | 
			
		||||
		glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
 | 
			
		||||
		glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE,
 | 
			
		||||
		glBlendEquation(GL_FUNC_REVERSE_SUBTRACT_EXT);
 | 
			
		||||
		glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE,
 | 
			
		||||
		                       GL_ONE,       GL_ONE);
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue