EE_USE_DOUBLES is disabled by default in all archs.

Reduced unnecessary OpenGL calls.
Added eeColorAff typedef.
This commit is contained in:
Martín Lucas Golini
2013-11-04 02:48:09 -03:00
parent 825c50e20f
commit d7288f956c
8 changed files with 33 additions and 14 deletions

View File

@@ -157,14 +157,6 @@
#define EE_API
#endif
#ifndef EE_USE_DOUBLES
#ifdef EE_64BIT
#define EE_USE_DOUBLES 1
#else
#define EE_USE_DOUBLES 0
#endif
#endif
#if ( defined( EE_GLES2 ) || defined( EE_GLES1 ) ) && !defined( EE_GLES )
#define EE_GLES
#endif
@@ -185,7 +177,7 @@
#define eeINDEX_NOT_FOUND 0xFFFFFFFF
namespace EE {
#if 1 == EE_USE_DOUBLES
#ifdef EE_USE_DOUBLES
typedef double eeFloat;
#define eesqrt sqrt
#define eesin sin

View File

@@ -3,7 +3,7 @@
#include <eepp/declares.hpp>
#if 1 == EE_USE_DOUBLES
#ifdef EE_USE_DOUBLES
#define GL_FP GL_DOUBLE
#else
#define GL_FP GL_FLOAT

View File

@@ -219,6 +219,7 @@ class EE_API cGL {
Uint32 mStateFlags;
bool mPushClip;
bool mQuadsSupported;
bool mBlendEnabled;
int mQuadVertexs;
GLfloat mLineWidth;
GLuint mCurVAO;

View File

@@ -195,6 +195,7 @@ typedef tColor<Uint8> eeColor;
typedef tColor<eeFloat> eeColorf;
typedef tColorA<Uint8> eeColorA;
typedef tColorA<eeFloat> eeColorAf;
typedef tColorA<float> eeColorAff;
//! @brief Small class to help in some color operations
class Color {

View File

@@ -78,7 +78,6 @@ void cVertexBufferOGL::SetVertexStates() {
}
}
GLi->ActiveTexture( GL_TEXTURE0 );
GLi->ClientActiveTexture( GL_TEXTURE0 );
}

View File

@@ -332,7 +332,6 @@ void cVertexBufferVBO::Unbind() {
GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY );
}
GLi->ActiveTexture( GL_TEXTURE0 );
GLi->ClientActiveTexture( GL_TEXTURE0 );
if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) {

View File

@@ -98,6 +98,7 @@ cGL::cGL() :
mStateFlags( 1 << GLSF_LINE_SMOOTH ),
mPushClip( true ),
mQuadsSupported( true ),
mBlendEnabled( false ),
mQuadVertexs( 4 ),
mLineWidth( 1 ),
mCurVAO( 0 )
@@ -353,10 +354,38 @@ void cGL::Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) {
}
void cGL::Disable ( GLenum cap ) {
switch ( cap )
{
case GL_BLEND:
{
if ( !mBlendEnabled ) {
return;
}
mBlendEnabled = false;
break;
}
}
glDisable( cap );
}
void cGL::Enable( GLenum cap ) {
switch ( cap )
{
case GL_BLEND:
{
if ( mBlendEnabled ) {
return;
}
mBlendEnabled = true;
break;
}
}
glEnable( cap );
}

View File

@@ -65,8 +65,6 @@ cRendererGL3CP::cRendererGL3CP() :
mStack = eeNew( cMatrixStack, () );
mStack->mProjectionMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix
mStack->mModelViewMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix
cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE );
}
cRendererGL3CP::~cRendererGL3CP() {