mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-23 03:02:50 +03:00
EE_USE_DOUBLES is disabled by default in all archs.
Reduced unnecessary OpenGL calls. Added eeColorAff typedef.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -219,6 +219,7 @@ class EE_API cGL {
|
||||
Uint32 mStateFlags;
|
||||
bool mPushClip;
|
||||
bool mQuadsSupported;
|
||||
bool mBlendEnabled;
|
||||
int mQuadVertexs;
|
||||
GLfloat mLineWidth;
|
||||
GLuint mCurVAO;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -78,7 +78,6 @@ void cVertexBufferOGL::SetVertexStates() {
|
||||
}
|
||||
}
|
||||
|
||||
GLi->ActiveTexture( GL_TEXTURE0 );
|
||||
GLi->ClientActiveTexture( GL_TEXTURE0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ) ) {
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user